TerrainMaterialLayer Class |
Namespace: DigitalRune.Graphics
The TerrainMaterialLayer type exposes the following members.
Name | Description | |
---|---|---|
TerrainMaterialLayer(IGraphicsService) |
Initializes a new instance of the TerrainMaterialLayer class with the default
material.
| |
TerrainMaterialLayer(Material) |
Initializes a new instance of the TerrainMaterialLayer class with a custom
material.
|
Name | Description | |
---|---|---|
Dispose |
Releases all resources used by an instance of the TerrainLayer class.
(Inherited from TerrainLayer.) | |
Dispose(Boolean) |
Releases the unmanaged resources used by an instance of the TerrainLayer class
and optionally releases the managed resources.
(Inherited from TerrainLayer.) | |
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
Aabb |
Gets (or sets) the axis-aligned bounding box of the area that is influenced by this terrain
layer.
(Inherited from TerrainLayer.) | |
Alpha |
Gets or sets the opacity (alpha). (This is a material parameter - see remarks.)
| |
BlendHeightInfluence |
Gets or sets the influence of the HeightTexture on the blend weight.
(This is a material parameter - see remarks.)
| |
BlendNoiseInfluence |
Gets or sets the influence of the noise on the blend weight.
(This is a material parameter - see remarks.)
| |
BlendRange |
Gets or sets the blend range. (This is a material parameter - see remarks.)
| |
BlendTexture |
Gets or sets the texture which contains the blend weights.
(This is a material parameter - see remarks.)
| |
BlendTextureChannel |
Gets or sets the texture channel of the BlendTexture which contains the blend
weight for this material. (This is a material parameter - see remarks.)
| |
BlendThreshold |
Gets or sets the threshold for the blend weights.
(This is a material parameter - see remarks.)
| |
DiffuseColor |
Gets or sets the diffuse color. (This is a material parameter - see remarks.)
| |
DiffuseTexture |
Gets or sets the diffuse texture. (This is a material parameter - see remarks.)
| |
FadeInEnd |
Gets or sets the clipmap level where the fade-in ends and this terrain layer is fully
visible. (This is a material parameter - see remarks.)
(Inherited from TerrainLayer.) | |
FadeInStart |
Gets or sets the clipmap level where this terrain layer starts to fade in.
(This is a material parameter - see remarks.)
(Inherited from TerrainLayer.) | |
FadeOutEnd |
Gets or sets the clipmap level where the fade-out ends and this terrain layer is not
rendered anymore. (This is a material parameter - see remarks.)
(Inherited from TerrainLayer.) | |
FadeOutStart |
Gets or sets the clipmap level where this terrain layer starts to fade out.
(This is a material parameter - see remarks.)
(Inherited from TerrainLayer.) | |
HeightTexture |
Gets or sets the height texture, which stores relative height values.
(This is a material parameter - see remarks.)
| |
HeightTextureBias |
Gets or sets the bias that is added to samples of the height texture.
(This is a material parameter - see remarks.)
| |
HeightTextureScale |
Gets or sets the scale that is multiplied with samples of the height texture.
(This is a material parameter - see remarks.)
| |
IsDisposed |
Gets a value indicating whether this instance has been disposed of.
(Inherited from TerrainLayer.) | |
Material |
Gets (or sets) the material that is used to render this terrain layer.
(Inherited from TerrainLayer.) | |
MaterialInstance |
Gets the material instance.
(Inherited from TerrainLayer.) | |
NoiseTileSize |
Gets or sets the size of the tiling noise map in world space units.
(This is a material parameter - see remarks.)
| |
NormalTexture |
Gets or sets the normal texture. (This is a material parameter - see remarks.)
| |
SpecularColor |
Gets or sets the specular color. (This is a material parameter - see remarks.)
| |
SpecularPower |
Gets or sets the specular color exponent. (This is a material parameter - see remarks.)
| |
SpecularTexture |
Gets or sets the specular texture. (This is a material parameter - see remarks.)
| |
TerrainHeightBlendRange |
Gets or sets the range for terrain height-based blending in world space units.
(This is a material parameter - see remarks.)
| |
TerrainHeightMax |
Gets or sets the max terrain height in world space. The material is not rendered above this
height. (This is a material parameter - see remarks.)
| |
TerrainHeightMin |
Gets or sets the min terrain height in world space. The material is not rendered below this
height. (This is a material parameter - see remarks.)
| |
TerrainSlopeBlendRange |
Gets or sets the range for terrain slope-based blending in radians.
(This is a material parameter - see remarks.)
| |
TerrainSlopeMax |
Gets or sets the max terrain slope in radians. The material is not rendered if the terrain
is steeper than this slope. (This is a material parameter - see remarks.)
| |
TerrainSlopeMin |
Gets or sets the min terrain slope in radians. The material is not rendered if the terrain
is flatter than this slope. (This is a material parameter - see remarks.)
| |
TileSize |
Gets or sets the tile size of the textures in world space.
(This is a material parameter - see remarks.)
| |
TintStrength |
Gets or sets the influence of the TintTexture.
(This is a material parameter - see remarks.)
| |
TintTexture |
Gets or sets the tint texture. (This is a material parameter - see remarks.)
| |
TriplanarTightening |
Gets or sets the tightening factor for triplanar texture mapping. (Use -1 to disable
triplanar texture mapping. This is a material parameter - see remarks.)
|
The TerrainMaterialLayer renders a material, such as grass, dirt, rocks, etc., onto the terrain.
Material textures:
The material is defined by several tiling textures:
Blend texture:
The BlendTexture contains blend weights. It is a non-tiling texture which covers
the terrain tile. (In other tools or engines this texture is called splat map,
control map, alpha map, material map, weight map, or mask
texture.) A blend texture can contain several blend weights (e.g. an RGBA texture can
contain 4 blend weights - one weight per channel). The property
BlendTextureChannel determines which channel is used by the material layer.
The material reads the blend weight from the blend texture and if the blend weight is greater than BlendThreshold, the material is drawn. There is a small transition zone around the threshold where the material fades out. This transition zone is defined by BlendRange.
The HeightTexture of the material can be used to modify the blending. This can be used to create more realistic transitions between two materials. For example: One material layer draws a dirt texture. The next material layer blends a stone texture over the dirt texture. The stone material includes a height texture. This is used to create a dirt-stone transition where more dirt is visible in the gaps between stones (low height values). BlendHeightInfluence controls how much the height texture influences the blending.
Noise can also be used to make transitions between two material layers visually more interesting. If BlendNoiseInfluence is greater than 0, a noise value is added to the blend weight to make transitions less uniform. NoiseTileSize controls the size of the tiling noise texture.
Tint texture:
The TintTexture contains a color that is multiplied with the material. Like the
BlendTexture, the TintTexture is a non-tiling texture which covers
the entire terrain tile. TintStrength defines the influence of the
TintTexture.
Height-based and slope-based blending based:
The properties TerrainHeightMin, TerrainHeightMax,
TerrainSlopeMin, and TerrainSlopeMax can be used to apply the
material only on terrain geometry with a certain height or slope. Near these limits the
material fades out. The fade-out range is determined by TerrainHeightBlendRange
and TerrainSlopeBlendRange.
Triplanar texture mapping:
The material textures are usually projected top-down onto the material. This may lead to
distorted textures on very steep slopes. Triplanar texture mapping can be used to reduce
distortions. If the triplanar texturing is enabled, the terrain normals are checked and the
texture is projected vertically (y direction) or horizontally (x or z direction) to minimize
distortions.
Triplanar texture mapping is disabled by default (TriplanarTightening = -1). Set TriplanarTightening to a positive value, e.g. 0.5, to enable triplanar texturing. Larger TriplanarTightening values make the transitions between different projection directions shorter.