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:
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.
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:
- InlinePointsShape: A specialized shape for efficient rendering of Points objects.
- InlineLinesShape: A specialized shape for efficient rendering of Lines objects.
- InlineMeshShape: A specialized shape for efficient rendering of PolygonMesh objects.
- InlineDebugShape: A specialized shape, providing debugging facilities, formerly known as the old InlineShape (pre 1.12.0).
- InlineFileBasedTexture: A texture using the OpenImageIO extension to read a texture image.
- InlineProceduralTexture: A texture driven by procedural content from KL.
- InlineMatrixArrayTexture: A texture driven by a matrix array. This is particularly useful for crowd rendering.
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:
- OGLInlineDrawing: The OpenGL version master InlineDrawing object
- OGLInlineShader: A generic GLSL shader which performs GLSL code compilation.
- OGLPointsShapeAdaptor: A specialized adaptor for handing rendering of InlinePointsShape shapes.
- OGLLinesShapeAdaptor: A specialized adaptor for handling rendering of InlineLinesShape shapes.
- OGLMeshShapeAdaptor: A specialized adaptor for handling rendering of InlineMeshShape shapes.
- OGLDebugShapeAdaptor: A specialized adaptor for handling rendering of InlineDebugShape shapes.
- OGLColorTextureAdaptor: A specialized adaptor for handling textures such as the InlineFileBasedTexture or the InlineProceduralTexture.
- OGLMatrixArrayTextureAdaptor: A specialized adaptor for handling InlineMatrixArrayTexture textures.
Furthermore presets of the OGLInlineShader are provided.