ShapeBatcher
interludesoftware.tick¶
Interlude.Tick¶
ShapeBatcher Class¶
Inheritance System.Object → ShapeBatcher
Implements System.IDisposable
Constructors¶
ShapeBatcher(Mesh, Material) Constructor¶
Creates a ShapeBatcher that draws instanced SDF shapes using quadMesh and material.
Parameters¶
quadMesh UnityEngine.Mesh
material UnityEngine.Material
Properties¶
ShapeBatcher.BatchCount Property¶
Returns the number of batches recorded since the last Reset().
Property Value¶
Methods¶
ShapeBatcher.AddToBatch(DrawCommand) Method¶
Appends command as a new Interlude.Tick.ShapeBatcher.ShapeInstance to the active batch.
Parameters¶
command DrawCommand
ShapeBatcher.BeginBatch() Method¶
Opens a new batch starting at the current instance write head.
ShapeBatcher.BuildSingleInstance(DrawCommand) Method¶
Returns the ShapeInstance derived from command as a value, avoiding the heap array allocation of the array overload. Preferred when the caller already owns a ShapeInstance[] scratch buffer.
public static Interlude.Tick.ShapeBatcher.ShapeInstance BuildSingleInstance(Interlude.Tick.DrawCommand command);
Parameters¶
command DrawCommand
Returns¶
Interlude.Tick.ShapeBatcher.ShapeInstance
ShapeBatcher.Dispose() Method¶
Releases the GPU UnityEngine.GraphicsBuffer.
Implements Dispose()
ShapeBatcher.EndBatch() Method¶
Closes the current batch, discarding it if it contains no instances.
ShapeBatcher.FillSingleInstance(DrawCommand, ShapeInstance[]) Method¶
Fills a one-element array with the ShapeInstance derived from command. Used by Drawer when issuing a single passthrough draw for a CustomShape without going through the batcher.
public static void FillSingleInstance(Interlude.Tick.DrawCommand command, out Interlude.Tick.ShapeBatcher.ShapeInstance[] data);
Parameters¶
command DrawCommand
data Interlude.Tick.ShapeBatcher.ShapeInstance[]
ShapeBatcher.GetBatchStartIndexAndInstanceCount(int) Method¶
Returns the GPU buffer start index and instance count for the batch at index.
Parameters¶
index System.Int32
Returns¶
ShapeBatcher.RecordInto(CommandBuffer, int) Method¶
Issues a DrawMeshInstancedProcedural call for batch index into target.
Parameters¶
target UnityEngine.Rendering.CommandBuffer
index System.Int32
ShapeBatcher.Reset() Method¶
Clears all batches and resets the instance write head for the next frame.
ShapeBatcher.UploadToGPU() Method¶
Uploads all accumulated instance data to the GPU structured buffer, growing the buffer if needed.