TerrainMaterial
Description
Describes a terrain material for texturing.
A TerrainMaterial object represents an immutable description of a terrain material, for use with TerrainLayer.Material and TerrainLayerMaterial.Add. To define a terrain material, use one of the For
constructors to obtain the initial descriptor. Then, use the H
and V
method to update the descriptor, as needed. Basically, these methods just update one or more properties and return the resulting descriptor. A terrain material encapsulates the following concepts:
-
Each terrain material is associated with a specific material ID (see MaterialToken) in the material layer of the terrain heightmap (see HeightmapLayer.Material).
-
Each terrain material has a color key, which is used to create the placeholder texture (see Placeholder), which is shown while the actual textures are being loaded in the background. Optionally, the color keys can be used to compute material tokens from the texture layer of the terrain heightmap (see HeightmapLayer.Texture), by using a MaterialKeys object to create a custom heightmap via IHeightmap.Material.
-
Each terrain material must have a horizontal component, defined by Horizontal, ScaleHorizontal and BlendHorizontal. If only the horizontal component is defined, the material will be applied using standard UV-mapping, which will create distortions when the terrain has steep slopes.
-
A terrain material may have a vertical component, defined by Vertical, ScaleVertical and BlendVertical. If present, the material will be applied using tri-planar texture mapping, using the vertical component for both vertical texturing planes and the horizontal component for the horizontal texturing plane.
Public / Constructors
For
2 overloads
Creates a new instance of TerrainMaterial.
Creates a new instance of TerrainMaterial.
Public / Methods
H
4 overloads
Set the value of ScaleHorizontal.
Set the value of BlendHorizontal.
Set the value of Horizontal.
Set the value of Horizontal, ScaleHorizontal and BlendHorizontal.
V
4 overloads
Set the value of ScaleVertical.
Set the value of BlendVertical.
Set the value of Vertical.
Set the value of Vertical, ScaleVertical and BlendVertical.
Public / Attributes
Key
The material key.
The material key is used to extract material weights from the HeightmapLayer.Texture layer.
ScaleHorizontal
Artificial scale factors to apply to the texture and displacement scales of Horizontal.
Vec2F.X artificially scales TerrainMaterialTexture.ScaleTexture.
Vec2F.Y artificially scales TerrainMaterialTexture.ScaleDisplacement.
- See also
ScaleVertical
Artificial scale factors to apply to the texture and displacement scales of Vertical.
Vec2F.X artificially scales TerrainMaterialTexture.ScaleTexture.
Vec2F.Y artificially scales TerrainMaterialTexture.ScaleDisplacement.