TerrainMaterialBlend
Description
A set of coefficients that control how material albedo and vertex colors are combined.
The following formula is used to compute the final color:
materialAlbedo = Albedo of terrain material (linear sRGB) vertexColor = Vertex color of terrain mesh (linear sRGB) grayscale = Material albedo, converted to grayscale: materialAlbedo.r * 0.2126 + materialAlbedo.g * 0.7152 + materialAlbedo.b * 0.0722 maxBrightness = Vertex color, converted to maximum brightness: vertexColor / max(vertexColor.r, vertexColor.g, vertexColor.a) A = The material albedo to use for blending: (1 - MaterialAlbedoGrayscale) * materialAlbedo + MaterialAlbedoGrayscale * grayscale B = The vertex color to use for blending: (1 - VertexColorBrightness) * vertexColor + VertexColorBrightness * maxBrightness finalColor = (1 - BlendMaterial - BlendVertex) * A * B + BlendMaterial * A + BlendVertex * B