Table of Contents

Class IndexExtensions

Namespace
Stride.Extensions
Assembly
Stride.Rendering.dll
public static class IndexExtensions
Inheritance
IndexExtensions

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

meshData MeshDraw

The mesh data.

Returns

bool

Returns true if index buffer was actually compacted.

Exceptions

NotImplementedException

GenerateIndexBuffer(MeshDraw, VertexDeclaration)

Generates an index buffer for this mesh data.

public static void GenerateIndexBuffer(this MeshDraw meshData, VertexDeclaration declaration)

Parameters

meshData MeshDraw

The mesh data.

declaration VertexDeclaration

The final vertex declaration

GenerateIndexBufferAEN(IndexBufferBinding, VertexBufferBinding, CommandList)

public static int[] GenerateIndexBufferAEN(IndexBufferBinding indexBuffer, VertexBufferBinding vertexBuffer, CommandList commandList = null)

Parameters

indexBuffer IndexBufferBinding
vertexBuffer VertexBufferBinding
commandList CommandList

Returns

int[]

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

meshData MeshDraw

The mesh data.

GenerateIndexMapping(VertexBufferBinding, CommandList, params 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

vertexBufferBinding VertexBufferBinding

The vertex buffer binding.

commandList CommandList
usages string[]

The vertex element usages to consider.

Returns

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

meshData MeshDraw
outBytes byte[]

Output of the operation, the indices matching the reversed winding order

Returns

bool

RemoveIndexBuffer(MeshDraw)

Expand vertices using index buffer (if existing), and remove it.

public static void RemoveIndexBuffer(this MeshDraw meshData)

Parameters

meshData MeshDraw

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

meshData MeshDraw

Returns

bool