A MaterialKey defines the parameters that define the mapping from color values to material weights.
For each material ID, a MaterialKey is defined in the containing MaterialKeys object. For a given color, material weights are computed for each key and the weighted materials are then combined into a material token.
w for a material key is computed as follows:
dstis divided by the configured distance range (see Distance), which reduces the range of the material key.
dstis clamped using the configured clamp amount (see Clamp):
dst = max(0, Clamp - dst) / Clamp. This cuts off small material weights while retaining the full weight range.
dstis scaled by the configured weight (see Weight, yielding the final material weight. This affects how strong the material will be realized in relation to the other material keys.
The invalid (i.e. non-existent) material key.
- See also
Creates a new instance of MaterialKey.
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.
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.
Is this material key invalid?
- See also
The material ID in the range [0..255] or
-1 if this material key is invalid (see IsInvalid).