TerrainLayerMaterial

Description

sealed class Tinman.Engine.Components.TerrainLayerMaterial

Settings for TerrainLayer objects of type TerrainLayerType.Material.

Public / Methods

Add


public method Add → (1)

material in : TerrainMaterial

[not-null]
The material to add.

Adds the given material to this layer, replacing any existing one.

If the given material in is already present, the method silently returns.

Add​All


public method AddAll → (1)

materials in : IEnumerable<TerrainMaterial>

[not-null]
The materials to add.

Adds the given materials to this layer, replacing any existing ones.

This method delegates to Add for each element in materials in.

Clear


public method Clear → ()

Removes all materials from this layer.

Id


public method Id → (1)

materialId in : int32

[0..255]
The material ID (see MaterialToken).

returns → TerrainMaterial

The TerrainMaterial object or null if no terrain material has been defined.

Returns a terrain material.

Remove


public method Remove → (1)

material in : TerrainMaterial

[not-null]
The material to remove.

Removes the given material from this layer.

If the given material in is not present, the method silently returns.

Public / Attributes

Chunks


public attribute Chunks → (get,set)

value : float64

The chunking coefficient.

The material chunking coefficient.

The material chunking coefficient must be divisible by all material scale factors (i.e. global factor Scale multiplied with texture factor TerrainMaterialTexture.ScaleTexture).

The default value is 1.

Height​Blend


public attribute HeightBlend → (get,set)

value : Vec3F

The coefficient vector (see remarks).

Coefficients for height-based blending of materials.

Up to four materials are blend together when material-based texturing is used, according to their respective weights in the material token (see MaterialToken). To increase visual appeal, these blend weights may be adjusted, based on material displacement:

result = weight * pow(1 + (abs(height) + X) * Y, Z)

where weight is the material token weight in the range [0..1] and height is the material height, in terrain-space. X, Y and Z are the components of this coefficient vector.

Scale


public attribute Scale → (get,set)

value : float32

The global material texture scale, in terrain-space.

The global material texture scale, in terrain-space.

The scale of each terrain texture (see TerrainMaterialTexture.ScaleTexture and TerrainMaterialTexture.ScaleDisplacement) is multiplied with this value before being used for rendering.

The global scale is intended to be used for unit conversions.

Defaults to 1.