ChunkingBatch

Description

struct Tinman.Terrain.Meshing.ChunkingBatch

Output batch of the Chunking class.

ChunkingBatch values have the following natural sort order:

  1. BaseChunk (descending, i.e. true comes first)

  2. MaterialGroup (ascending)

  3. MaterialCount (descending)

  4. Vec4I.X of Materials (ascending)

  5. Vec4I.Y of Materials (ascending)

  6. Vec4I.Z of Materials (ascending)

  7. Vec4I.W of Materials (ascending)

  8. Batch (ascending)

Public / Constants

Empty


public static readonly attribute Empty → (ChunkingBatch)

The empty batch.

Public / Attributes

Base​Chunk


public readonly attribute BaseChunk → (bool)

Is this the base chunk of this Batch?

A single Batch may have more than one chunks. The first chunk (i.e. the base chunk) contains the most prominent materials.

The base chunk can be obtained via IBatchContainerBase.GetBatchForSector, passing SectorBatch.Sector.

This value can be used to setup different render states for each batch instance, for example alpha-blending vs. additive blending.

Batch


public readonly attribute Batch → (SectorBatch)

The sector batch to use for rendering.

Material​Count


public attribute MaterialCount → (get)

value : int32

[1..4]
The number of materials.

The number of materials that are present in Materials.

Material​Group


public readonly attribute MaterialGroup → (int32)

The material group of this batch.

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

Materials


public readonly attribute Materials → (Vec4I)

The materials that are present in this chunk.

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

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