TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

struct ChunkingBatch in Tinman.Terrain.Meshing

Output batch of the Chunking class.

struct ChunkingBatch implements IComparable<ChunkingBatch>
  IEquatable<ChunkingBatch>

Remarks

ChunkingBatch values have this sort order:

  1. MaterialGroup (ascending)
  2. BatchIndex (ascending)
  3. Materials (X, Y, Z, W - ascending)
  4. Batch (ascending)

Public / Attributes

Batch

The sector batch to use for rendering.

public readonly field Batch
type SectorBatch

BatchIndex

The overdraw index of Batch.

public readonly field BatchIndex
type int32

Remarks:

The overdraw index is 0 for the first instance of Batch, and is incremented for each subsequent instance. This value can be used to setup different render states for each batch instance.

MaterialGroup

The material group of this batch.

public readonly field MaterialGroup
type int32

Remarks:

This value is the index in the configured list of material groups (see MaterialGroups).

Materials

The materials that are present in this chunk.

public readonly field Materials
type Vec4I

Remarks:

The IDs of the chunk materials are encoded like this:
X:= ID of first material or -1 for none.
Y:= ID of second material or -1 for none.
Z:= ID of third material or -1 for none.
W:= ID of fourth material or -1 for none.

The material IDs are always sorted in descending order, i.e. X >= Y >=Z >=W. This allows to compare material vectors in order to find out if the set of materials has changed.

MaterialsFloat

The Materials vector, divided by 255f.

public property MaterialsFloat { get }
type Vec4F
value The normalized Materials vector.

Public / Methods

CompareTo

public method CompareTo (ChunkingBatch other)
type int32
params other

Equals

public method Equals (ChunkingBatch other)
type bool
params other