|
Infinity Engine v0.6.20
C++ API Documentation
|
Defines a subset of mesh geometry with an associated material. More...
#include <SubMesh.hpp>
Public Attributes | |
| uint32_t | indexOffset |
| Starting index in the mesh's IndexBuffer. | |
| uint32_t | indexCount |
| Number of indices used by this submesh. | |
| uint32_t | materialIndex |
| Index into the parent Renderable's materials array. | |
Defines a subset of mesh geometry with an associated material.
SubMesh represents a contiguous range of indices within a mesh's IndexBuffer, allowing a single mesh to use multiple materials by partitioning its geometry into material-specific sections. This enables efficient multi-material rendering without duplicating vertex data.
Each submesh specifies:
The submesh system allows:
Common use cases:
Example usage:
| uint32_t Infinity::Types::Rendering::SubMesh::indexCount |
Number of indices used by this submesh.
Count of indices to read from the IndexBuffer starting at indexOffset. For triangle topology, this should be a multiple of 3.
| uint32_t Infinity::Types::Rendering::SubMesh::indexOffset |
Starting index in the mesh's IndexBuffer.
Zero-based offset to the first index used by this submesh. The submesh uses indices from [indexOffset, indexOffset + indexCount).
| uint32_t Infinity::Types::Rendering::SubMesh::materialIndex |
Index into the parent Renderable's materials array.
References which material from the parent Renderable should be applied to this submesh's geometry during rendering.