Class MergeExtensions
- Namespace
- Stride.Extensions
- Assembly
- Stride.Rendering.dll
public static class MergeExtensions
- Inheritance
-
MergeExtensions
Methods
CreateDeclarationMergeGroup(IList<MeshDraw>)
Group meshes that can be merged because they have the same vertex declaration.
public static List<List<MeshDraw>> CreateDeclarationMergeGroup(IList<MeshDraw> meshDrawDatas)
Parameters
Returns
CreateIntIndexBuffer(int, int, byte[], bool)
Create an int typed index buffer.
public static byte[] CreateIntIndexBuffer(int offset, int count, byte[] baseIndices = null, bool is32Bits = true)
Parameters
offset
intThe offset to apply to the indices.
count
intThe number of indices.
baseIndices
byte[]A possible base index buffer
is32Bits
boolStating if baseIndices is filled with 32 bits int
Returns
- byte[]
A new index buffer.
CreateOptimizedMergeGroups(IList<MeshDraw>, bool)
Create group of MeshDrawData that will be merged.
public static List<List<MeshDraw>> CreateOptimizedMergeGroups(IList<MeshDraw> meshDrawDatas, bool can32BitIndex)
Parameters
meshDrawDatas
IList<MeshDraw>List of MehsDrawData to merge.
can32BitIndex
boolA flag stating if 32 bit index buffers are allowed.
Returns
CreateShortIndexBuffer(int, int, byte[], bool)
Create an short typed index buffer.
public static byte[] CreateShortIndexBuffer(int offset, int count, byte[] baseIndices = null, bool is32Bit = true)
Parameters
offset
intThe offset to apply to the indices.
count
intThe number of indices.
baseIndices
byte[]A possible base index buffer
is32Bit
boolStating if baseIndices is filled with 32 bits int
Returns
- byte[]
A new index buffer.
GroupDrawData(IList<MeshDraw>, bool)
Group the meshes.
public static List<MeshDraw> GroupDrawData(this IList<MeshDraw> meshDrawDatas, bool can32BitIndex)
Parameters
meshDrawDatas
IList<MeshDraw>The list of meshes to group.
can32BitIndex
boolA flag stating if 32 bit index buffers are allowed
Returns
IsIndexed(IList<MeshDraw>)
Check if a index buffer will be needed for this merge group.
public static bool IsIndexed(IList<MeshDraw> meshDrawDatas)
Parameters
Returns
- bool
True if an index is needed, false otherwise.
MergeDrawData(IList<MeshDraw>, bool)
Transform a vertex buffer positions, normals, tangents and bitangents using the given matrix.
public static MeshDraw MergeDrawData(IList<MeshDraw> meshDrawDatas, bool can32BitIndex)
Parameters
meshDrawDatas
IList<MeshDraw>The mesh draw datas.
can32BitIndex
boolA flag stating if 32 bit index buffers.