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

struct Tinman.Material.Key

Short Name:
  • struct Key
Fields:

A material key defines the parameters that define the mapping from color values to material weights.

For each material ID, a material key is defined in the containing Keys object. For a given color, material weights are computed for each key and the weighted materials are then combined into a material token.

The weight w for a material key is computed as follows:

  1. The relative color distance dst is computed between the material key color (see Key.color) and the input color.

  2. The distance dst is divided by the configured distance range (see Key.distance), which reduces the range of the material key.

  3. The distance dst is clamped using the configured clamp amount (see Key.clamp): dst = max(0, Clamp - dst) / Clamp. This cuts off small material weights while retaining the full weight range.

  4. The distance dst is scaled by the configured weight (see Key.weight, yielding the final material weight. This affects how strong the material will be realized in relation to the other material keys.

Fields

The following table lists all fields of this config type.

Field Type Constraint Default
required material number
# >= 0 && # <= 255
 

The material ID in the range [0..255] or -1 if this material key is invalid.

required color Tinman.Color    

The color key of the material.

optional distance number  
1

The color distance range of this material.

The material has full weight where the color distance is zero. The weight drops to zero when this distance value is reached.

optional weight number  
1

The relative weight of this material.

optional clamp number  
1

The relative clamp amount of this material.

A clamp amount less than one will cut off small material weights. A clamp amount greater than one will add small material weights.

Usages

The following table shows all usages of this config type.

Used By: