Table of Contents

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

meshDrawDatas IList<MeshDraw>

The list of meshes.

Returns

List<List<MeshDraw>>

A list of grouped meshes.

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 int

The offset to apply to the indices.

count int

The number of indices.

baseIndices byte[]

A possible base index buffer

is32Bits bool

Stating 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 bool

A flag stating if 32 bit index buffers are allowed.

Returns

List<List<MeshDraw>>

A List of groups to merge internally.

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 int

The offset to apply to the indices.

count int

The number of indices.

baseIndices byte[]

A possible base index buffer

is32Bit bool

Stating 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 bool

A flag stating if 32 bit index buffers are allowed

Returns

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

meshDrawDatas IList<MeshDraw>

The list of MeshDrawdata to merge.

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 bool

A flag stating if 32 bit index buffers.

Returns

MeshDraw