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.
w for a material key is computed as follows:
The relative color distance
dstis computed between the material key color (see Key.color) and the input color.
dstis divided by the configured distance range (see Key.distance), which reduces the range of the material key.
dstis 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.
dstis 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.
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.