Struct MaterialMeshInfo
Represents which materials and meshes to use to render an entity.
Namespace: Unity.Rendering
Assembly: solution.dll
Syntax
public struct MaterialMeshInfo : IComponentData, IQueryTypeParameter, IEnableableComponent
Remarks
This struct supports both a serializable static encoding in which case Material and Mesh are array indices to some array (typically a RenderMeshArray), and direct use of runtime BatchRendererGroup BatchMaterialID / BatchMeshID values.
Constructors
| Name | Description |
|---|---|
| MaterialMeshInfo(BatchMaterialID, BatchMeshID, sbyte) | Creates an instance of MaterialMeshInfo from material and mesh/sub-mesh IDs registered with EntitiesGraphicsSystem |
Fields
| Name | Description |
|---|---|
| Material | The material ID. |
| Mesh | The mesh ID. |
Properties
| Name | Description |
|---|---|
| HasMaterialMeshIndexRange | True if the MaterialMeshInfo is using a MaterialMeshIndex range. |
| MaterialID | The material ID property. |
| MaterialMeshIndexRange | The MaterialMeshIndex range. |
| MeshID | The mesh ID property. |
| SubMesh | The sub-mesh ID. |
Methods
| Name | Description |
|---|---|
| ArrayIndexToStaticIndex(int) | Converts the given array index (typically the index inside RenderMeshArray) into a negative number that denotes that array position. |
| FromMaterialMeshIndexRange(int, int) | Creates an instance of MaterialMeshInfo from a range of material/mesh/submesh index in the corresponding RenderMeshArray. |
| FromRenderMeshArrayIndices(int, int, sbyte) | Creates an instance of MaterialMeshInfo from material and mesh/sub-mesh indices in the corresponding RenderMeshArray. |
| StaticIndexToArrayIndex(int) | Converts the given static index (a negative value) to a valid array index. |