IndexExtensions Class
Namespace: Stride.ExtensionsAssembly: Stride.Rendering.dll
public static class IndexExtensions
| Name | Description | |
|---|---|---|
| Methods | ||
| CompactIndexBuffer(MeshDraw) | Compacts the index buffer from 32 bits to 16 bits per index, if possible. |
|
| GenerateIndexBuffer(MeshDraw, VertexDeclaration) | Generates an index buffer for this mesh data. |
|
| GenerateIndexBufferAEN(IndexBufferBinding, VertexBufferBinding, CommandList) | ||
| GenerateIndexBufferAEN(MeshDraw) | Generates the index buffer with dominant edge and vertex information. Each triangle gets its indices expanded to 12 control points, with 0 to 2 being original triangle, 3 to 8 being dominant edges and 9 to 11 being dominant vertices. |
|
| GenerateIndexMapping(VertexBufferBinding, CommandList, String[]) | Generates an index mapping with the specified vertex elements. If no vertex elements are specified, use the whole vertex. |
|
| GetReversedWindingOrder(MeshDraw, out Byte[]) | Reverses the winding order of an index buffer. Assumes it is stored in TriangleList format. Works on both 32 and 16 bit indices. |
|
| RemoveIndexBuffer(MeshDraw) | Expand vertices using index buffer (if existing), and remove it. |
|
| ReverseWindingOrder(MeshDraw) | Reverses the winding order of an index buffer. Assumes it is stored in TriangleList format. Works on both 32 and 16 bit indices. |
|
Methods
CompactIndexBuffer(MeshDraw)
Compacts the index buffer from 32 bits to 16 bits per index, if possible.
public static bool CompactIndexBuffer(this MeshDraw meshData)
Parameters
| Type | Name | Description |
|---|---|---|
| MeshDraw | meshData | The mesh data. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if index buffer was actually compacted. |
Exceptions
| Type | Condition |
|---|---|
| System.NotImplementedException |
GenerateIndexBuffer(MeshDraw, VertexDeclaration)
Generates an index buffer for this mesh data.
public static void GenerateIndexBuffer(this MeshDraw meshData, VertexDeclaration declaration)
Parameters
| Type | Name | Description |
|---|---|---|
| MeshDraw | meshData | The mesh data. |
| VertexDeclaration | declaration | The final vertex declaration |
GenerateIndexBufferAEN(IndexBufferBinding, VertexBufferBinding, CommandList)
public static int[] GenerateIndexBufferAEN(IndexBufferBinding indexBuffer, VertexBufferBinding vertexBuffer, CommandList commandList = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IndexBufferBinding | indexBuffer | |
| VertexBufferBinding | vertexBuffer | |
| CommandList | commandList |
Returns
| Type | Description |
|---|---|
| System.Int32[] |
GenerateIndexBufferAEN(MeshDraw)
Generates the index buffer with dominant edge and vertex information. Each triangle gets its indices expanded to 12 control points, with 0 to 2 being original triangle, 3 to 8 being dominant edges and 9 to 11 being dominant vertices.
public static void GenerateIndexBufferAEN(this MeshDraw meshData)
Parameters
| Type | Name | Description |
|---|---|---|
| MeshDraw | meshData | The mesh data. |
GenerateIndexMapping(VertexBufferBinding, CommandList, String[])
Generates an index mapping with the specified vertex elements. If no vertex elements are specified, use the whole vertex.
public static IndexExtensions.IndexMappingResult GenerateIndexMapping(this VertexBufferBinding vertexBufferBinding, CommandList commandList, params string[] usages)
Parameters
| Type | Name | Description |
|---|---|---|
| VertexBufferBinding | vertexBufferBinding | The vertex buffer binding. |
| CommandList | commandList | |
| System.String[] | usages | The vertex element usages to consider. |
Returns
| Type | Description |
|---|---|
| IndexExtensions.IndexMappingResult |
GetReversedWindingOrder(MeshDraw, out Byte[])
Reverses the winding order of an index buffer. Assumes it is stored in TriangleList format. Works on both 32 and 16 bit indices.
public static bool GetReversedWindingOrder(this MeshDraw meshData, out byte[] outBytes)
Parameters
| Type | Name | Description |
|---|---|---|
| MeshDraw | meshData | |
| System.Byte[] | outBytes | Output of the operation, the indices matching the reversed winding order |
Returns
| Type | Description |
|---|---|
| System.Boolean |
RemoveIndexBuffer(MeshDraw)
Expand vertices using index buffer (if existing), and remove it.
public static void RemoveIndexBuffer(this MeshDraw meshData)
Parameters
| Type | Name | Description |
|---|---|---|
| MeshDraw | meshData | The mesh data. |
ReverseWindingOrder(MeshDraw)
Reverses the winding order of an index buffer. Assumes it is stored in TriangleList format. Works on both 32 and 16 bit indices.
public static bool ReverseWindingOrder(this MeshDraw meshData)
Parameters
| Type | Name | Description |
|---|---|---|
| MeshDraw | meshData |
Returns
| Type | Description |
|---|---|
| System.Boolean |