mix() -, . :
mix(v1, v2, a) = v1 * (1 - a) + v2 * a
, , v1 v2 w1 w2, 0.0 1.0, w1 + w2 = 1.0:
v1 * w1 + v2 * w2
, 2 . , 3 v1, v2 v3 3 w1, w2 v3, w1 + w2 + w3 = 1.0, :
v1 * w1 + v2 * w2 + v3 * w3
, , - :
weightIce = ...;
weightStone = ...;
weightGrass = 1.0 - weightIce - weightStone;
color = texture2D(ice_layer_tex, texcoord) * weightIce +
texture2D(stone_layer_tex, texcoord) * weightStone +
texture2D(grass_layer_tex, texcoord) * weightGrass;