TerrainMaterialBlend

Description

struct Tinman.Engine.Components.TerrainMaterialBlend

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

Public / Constants

Material​Modulate


public static readonly attribute MaterialModulate → (TerrainMaterialBlend)

Modulates material albedo with maximum-brightness vertex color.

Material​Only


public static readonly attribute MaterialOnly → (TerrainMaterialBlend)

Material albedo only.

Vertex​Modulate


public static readonly attribute VertexModulate → (TerrainMaterialBlend)

Modulates maximum-brightness vertex color with grayscale material albedo.

Vertex​Only


public static readonly attribute VertexOnly → (TerrainMaterialBlend)

Vertex color only.

Public / Constructors

Terrain​Material​Blend


public constructor TerrainMaterialBlend → (4)

blendMaterial in : float32

See BlendMaterial.

blendVertex in : float32

See BlendVertex.

materialAlbedoGrayscale in : float32

See MaterialAlbedoGrayscale.

vertexColorBrightness in : float32

See VertexColorBrightness.

Creates a new instance of TerrainMaterialBlend.

Public / Attributes

Blend​Material


public readonly attribute BlendMaterial → (float32)

Blend factor for material albedo.

Blend​Vertex


public readonly attribute BlendVertex → (float32)

Blend factor for vertex color.

Material​Albedo​Grayscale


public readonly attribute MaterialAlbedoGrayscale → (float32)

Controls saturation of the material albedo.

Vertex​Color​Brightness


public readonly attribute VertexColorBrightness → (float32)

Controls brightness of the vertex colors.