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