Table of Contents

Class InstancedMeshDraw

Namespace
PopcorningGuineaPig.Engine.Rendering
Assembly
PopcorningGuineaPig.Engine.dll

Many copies of one mesh, one draw. The shader declares in mat4 instanceTransform. Each matrix is the DrawModelEx product: scale, then rotation, then translation. Copies share one material. A different tint is a different draw.

public sealed class InstancedMeshDraw : IDisposable
Inheritance
InstancedMeshDraw
Implements
Inherited Members

Constructors

InstancedMeshDraw(Shader)

public InstancedMeshDraw(Shader shader)

Parameters

shader Shader

Properties

Ready

False when the shader has no instanceTransform, or that attribute landed on locations 0–3 (those are position, uv, normal, color).

public bool Ready { get; }

Property Value

bool

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Draw(Model, ReadOnlySpan<Matrix4x4>)

public void Draw(Model model, ReadOnlySpan<Matrix4x4> transforms)

Parameters

model Model
transforms ReadOnlySpan<Matrix4x4>