Skip to content

RectangleBatcher

interludesoftware.tick

Interlude.Tick

RectangleBatcher Class

public class RectangleBatcher : System.IDisposable

Inheritance System.Object → RectangleBatcher

Implements System.IDisposable

Constructors

RectangleBatcher(Mesh, Material) Constructor

Creates a RectangleBatcher that draws instanced quads using quadMesh and material.

public RectangleBatcher(Mesh quadMesh, Material material);

Parameters

quadMesh UnityEngine.Mesh

material UnityEngine.Material

Properties

RectangleBatcher.BatchCount Property

Returns the number of batches recorded since the last Reset().

public int BatchCount { get; }

Property Value

System.Int32

Methods

RectangleBatcher.AddToBatch(DrawCommand) Method

Appends command as a new Interlude.Tick.RectangleBatcher.RectInstance to the active batch.

public void AddToBatch(Interlude.Tick.DrawCommand command);

Parameters

command DrawCommand

RectangleBatcher.BeginBatch() Method

Opens a new batch starting at the current instance write head.

public void BeginBatch();

RectangleBatcher.Dispose() Method

Releases the GPU UnityEngine.GraphicsBuffer.

public void Dispose();

Implements Dispose()

RectangleBatcher.EndBatch() Method

Closes the current batch, discarding it if it contains no instances.

public void EndBatch();

RectangleBatcher.GetBatchStartIndexAndInstanceCount(int) Method

Returns the GPU buffer start index and instance count for the batch at index.

public (int,int) GetBatchStartIndexAndInstanceCount(int index);

Parameters

index System.Int32

Returns

<System.Int32,System.Int32>

RectangleBatcher.RecordInto(CommandBuffer, int) Method

Issues a DrawMeshInstancedProcedural call for batch index into target.

public void RecordInto(CommandBuffer target, int index);

Parameters

target UnityEngine.Rendering.CommandBuffer

index System.Int32

RectangleBatcher.Reset() Method

Clears all batches and resets the instance write head for the next frame.

public void Reset();

RectangleBatcher.UploadToGPU() Method

Uploads all accumulated instance data to the GPU structured buffer, growing the buffer if needed.

public void UploadToGPU();