Table of Contents

Class TerrainDetailBake.IndexMap

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

One terrain's index map (TerrainIndexMap) as the cut stored it: every alphamap texel's four strongest layers and their weights, two words a texel, row by row — the CPU bake from the alphamaps the cut wrote, the GPU bake's texels bit for bit. A player binds it instead of baking from the alphamaps, so a client build can leave the alphamaps out (ClientTerrainLayerStripper, which checks the map against them first).

[Serializable]
public sealed class TerrainDetailBake.IndexMap
Inheritance
TerrainDetailBake.IndexMap
Inherited Members

Remarks

Its own validity, apart from the tile's Stale (a height edit leaves the map good) and from Version (the grass and scatter arithmetic): Format and Stale, set in the editor when the terrain's alphamaps are written after the bake (TerrainDetailBaker).

Fields

Format

StoredFormat when stored; 0 for none.

public int Format

Field Value

int

Layers

public int Layers

Field Value

int

Map

Two words a texel (ids, weights), texel (x, y) at 2 (y × Resolution + x).

public uint[] Map

Field Value

uint[]

Resolution

The alphamap resolution it was baked at (square) and the layer count it names.

public int Resolution

Field Value

int

Stale

Set in the editor when the terrain's alphamaps were written after the map was stored.

public bool Stale

Field Value

bool

Methods

UsableFor(TerrainData)

True when it may be drawn on a tile of this data (IsUsable(int, bool, int, int, int, int, int)).

public bool UsableFor(TerrainData data)

Parameters

data TerrainData

Returns

bool