Introduction

バージョン 1.12.0 で追加.

InlineDrawing エクステンション provides functionality for direct rendering into DCC viewports (such as Maya etc). For this the extension provides a series of KL interfaces. The inheritance hierarchy of the data structures is as follows:

InlineEntity InlineEntity InlineEntity InlineEntityBase InlineEntityBase InlineEntityBase->InlineEntity DrawContext DrawContext DrawContext->InlineEntityBase DrawingHandle DrawingHandle DrawingHandle->InlineEntityBase InlineDrawingBase InlineDrawingBase InlineDrawingBase->InlineEntityBase OGLInlineDrawing OGLInlineDrawing OGLInlineDrawing->InlineDrawingBase InlineInstance InlineInstance InlineInstance->InlineEntityBase InlineMaterial InlineMaterial InlineMaterial->InlineEntityBase InlineShapeBase InlineShapeBase InlineShapeBase->InlineEntityBase InlineBaseTextShape InlineBaseTextShape InlineBaseTextShape->InlineShapeBase InlineGeometryAttributeTextShape InlineGeometryAttributeTextShape InlineGeometryAttributeTextShape->InlineBaseTextShape InlineTextShape InlineTextShape InlineTextShape->InlineBaseTextShape InlineDebugShape InlineDebugShape InlineDebugShape->InlineShapeBase InlineGeometryShape InlineGeometryShape InlineGeometryShape->InlineShapeBase InlineCurvesShape InlineCurvesShape InlineCurvesShape->InlineGeometryShape InlineLinesShape InlineLinesShape InlineLinesShape->InlineGeometryShape InlineMeshShape InlineMeshShape InlineMeshShape->InlineGeometryShape InlinePointsShape InlinePointsShape InlinePointsShape->InlineGeometryShape InlineTexture InlineTexture InlineTexture->InlineEntityBase InlineAtlasTexture InlineAtlasTexture InlineAtlasTexture->InlineTexture InlineFileBasedTexture InlineFileBasedTexture InlineFileBasedTexture->InlineTexture InlineMatrixArrayTexture InlineMatrixArrayTexture InlineMatrixArrayTexture->InlineTexture InlineProceduralTexture InlineProceduralTexture InlineProceduralTexture->InlineTexture InlineTransformBase InlineTransformBase InlineTransformBase->InlineEntityBase ConstantScreenSizeTransform ConstantScreenSizeTransform ConstantScreenSizeTransform->InlineTransformBase OGLInlineShader OGLInlineShader OGLInlineShader->InlineEntityBase OGL2DTextShader OGL2DTextShader OGL2DTextShader->OGLInlineShader OGL3DTextShader OGL3DTextShader OGL3DTextShader->OGLInlineShader OGLCurveShader OGLCurveShader OGLCurveShader->OGLInlineShader OGLCurveVertexColorShader OGLCurveVertexColorShader OGLCurveVertexColorShader->OGLInlineShader OGLDebugAxesShader OGLDebugAxesShader OGLDebugAxesShader->OGLInlineShader OGLDebugPointShader OGLDebugPointShader OGLDebugPointShader->OGLInlineShader OGLDebugVectorShader OGLDebugVectorShader OGLDebugVectorShader->OGLInlineShader OGLFlatShader OGLFlatShader OGLFlatShader->OGLInlineShader OGLFlatTextureShader OGLFlatTextureShader OGLFlatTextureShader->OGLInlineShader OGLFlatVertexColorShader OGLFlatVertexColorShader OGLFlatVertexColorShader->OGLInlineShader OGLGeometryAttributeTextShader OGLGeometryAttributeTextShader OGLGeometryAttributeTextShader->OGLInlineShader OGLHUDShader OGLHUDShader OGLHUDShader->OGLInlineShader OGLLinesShader OGLLinesShader OGLLinesShader->OGLInlineShader OGLNormalShader OGLNormalShader OGLNormalShader->OGLInlineShader OGLSurfaceNormalMapShader OGLSurfaceNormalMapShader OGLSurfaceNormalMapShader->OGLInlineShader OGLSurfaceShader OGLSurfaceShader OGLSurfaceShader->OGLInlineShader OGLSkinnedSurfaceShader OGLSkinnedSurfaceShader OGLSkinnedSurfaceShader->OGLSurfaceShader OGLSurfaceGizmoShader OGLSurfaceGizmoShader OGLSurfaceGizmoShader->OGLSurfaceShader OGLSurfaceOverlayShader OGLSurfaceOverlayShader OGLSurfaceOverlayShader->OGLSurfaceShader OGLVertexColorOverlayShader OGLVertexColorOverlayShader OGLVertexColorOverlayShader->OGLSurfaceOverlayShader OGLSurfaceTextureShader OGLSurfaceTextureShader OGLSurfaceTextureShader->OGLSurfaceShader OGLSurfaceVertexColorShader OGLSurfaceVertexColorShader OGLSurfaceVertexColorShader->OGLSurfaceShader OGLWireFrameShader OGLWireFrameShader OGLWireFrameShader->OGLInlineShader

The InlineDrawing is the master object. It manages the InlineShader, InlineShape and InlineTransform objects. It also provides a root InlineTransform, which can be used to build up a transform hierarchy. The InlineTransform is nestable, and can be used to represent a scene hierarchy.

../../_images/inlinedrawing02.png

Each InlineTransform can contain a series of Xfo values, so it can be used to represent a single scene entity or the same scene entity instanced a series of times.

So building up a renderable scene involves:

  • Defining shaders and materials
  • Defining shapes
  • Building a transform hierarchy
  • Defining instances by combining shapes + transforms

For rendering textures the InlineTexture interface is provided. Users can implement their own textures as well, but the InlineDrawing comes with a series of implementations already.

Shapes and textures are defined in a renderer-agnostic way. Special objects, called adaptors are used to perform the translation of the shape data to the renderer specific version. The generic objects provided by the InlineDrawing extension are:

Since most of the InlineDrawing objects required are just interfaces, a specialized implementation has to be used. For OpenGL direct rendering the extension provides a series of KL objects:

Furthermore presets of the OGLInlineShader are provided.