Class ArrayMesh

Namespace
Elegy.RenderBackend
Assembly
Elegy.RenderBackend.dll

A convenience layer for creating buffers from a Mesh.

public class ArrayMesh : IDisposable
Inheritance
ArrayMesh
Implements
Inherited Members

Constructors

ArrayMesh(GraphicsDevice, Mesh)

public ArrayMesh(GraphicsDevice device, Mesh meshData)

Parameters

device GraphicsDevice
meshData Mesh

Fields

BoneIndexBuffer

Bone index buffer.

public DeviceBuffer? BoneIndexBuffer

Field Value

DeviceBuffer

BoneWeightBuffer

Bone weight buffer.

public DeviceBuffer? BoneWeightBuffer

Field Value

DeviceBuffer

Color0Buffer

Colour buffer, channel 0.

public DeviceBuffer? Color0Buffer

Field Value

DeviceBuffer

Color1Buffer

Colour buffer, channel 1.

public DeviceBuffer? Color1Buffer

Field Value

DeviceBuffer

Color2Buffer

Colour buffer, channel 2.

public DeviceBuffer? Color2Buffer

Field Value

DeviceBuffer

Color3Buffer

Colour buffer, channel 3.

public DeviceBuffer? Color3Buffer

Field Value

DeviceBuffer

DynamicVertices

The number of dynamic vertices.

public int DynamicVertices

Field Value

int

IndexBuffer

Vertex index buffer.

public DeviceBuffer? IndexBuffer

Field Value

DeviceBuffer

Is2D

Whether this has 2D position vertices or not.

public bool Is2D

Field Value

bool

NormalBuffer

Normal buffer.

public DeviceBuffer? NormalBuffer

Field Value

DeviceBuffer

NumIndices

Number of indices. Determining it from IndexBuffer is not reliable.

public uint NumIndices

Field Value

uint

PositionBuffer

Position buffer.

public DeviceBuffer? PositionBuffer

Field Value

DeviceBuffer

TangentBuffer

Tangent buffer.

public DeviceBuffer? TangentBuffer

Field Value

DeviceBuffer

Uv0Buffer

UV buffer, channel 0.

public DeviceBuffer? Uv0Buffer

Field Value

DeviceBuffer

Uv1Buffer

UV buffer, channel 1.

public DeviceBuffer? Uv1Buffer

Field Value

DeviceBuffer

Uv2Buffer

UV buffer, channel 2.

public DeviceBuffer? Uv2Buffer

Field Value

DeviceBuffer

Uv3Buffer

UV buffer, channel 3.

public DeviceBuffer? Uv3Buffer

Field Value

DeviceBuffer

Properties

IsDynamic

Whether this mesh is dynamic.

public bool IsDynamic { get; }

Property Value

bool

IsLogicallyEmpty

Whether this mesh has nothing to render.

public bool IsLogicallyEmpty { get; }

Property Value

bool

Methods

Dispose()

Frees all device buffers.

public void Dispose()

GetBuffer(VertexSemantic, int)

Obtains a GPU buffer from the given vertex semantic and optionally channel.

public DeviceBuffer? GetBuffer(VertexSemantic semantic, int channel = 0)

Parameters

semantic VertexSemantic
channel int

Returns

DeviceBuffer

UpdateDynamic(Mesh, int, int, CommandList?)

Updates the GPU buffers with the new mesh data.

public void UpdateDynamic(Mesh data, int numVertices, int numIndices, CommandList? commandList = null)

Parameters

data Mesh
numVertices int
numIndices int
commandList CommandList