TerrainClipmap Class |
Namespace: DigitalRune.Graphics
The TerrainClipmap type exposes the following members.
Name | Description | |
---|---|---|
TerrainClipmap |
Initializes a new instance of the TerrainClipmap class.
|
Name | Description | |
---|---|---|
Dispose |
Releases all resources used by an instance of the TerrainClipmap class.
| |
Equals | (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.) | |
Invalidate |
Invalidates the cached clipmap.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
MaxNumberOfLevels |
The maximum number of clipmap levels.
|
Name | Description | |
---|---|---|
CellSizes |
Gets the cell sizes of all clipmap levels.
| |
CellsPerLevel |
Gets or sets the number of cells (texels) per clipmap level.
| |
EnableAnisotropicFiltering |
Gets or sets a value indicating whether the clipmap is sampled using anisotropic
filtering.
| |
EnableMipMap |
Gets or sets a value indicating whether the clipmap textures use mipmaps.
| |
LevelBias |
Gets or sets the level bias.
| |
MinLevel |
Gets or sets the index of the first level which is actively used.
| |
NumberOfLevels |
Gets or sets the number of clipmap levels.
| |
Origins |
Gets the world space origin of each clipmap level.
| |
Textures |
Gets the clipmap textures.
|
For a basic introduction to clipmaps, see Clipmaps (Wikipedia).
The clipmap can store geometry information (e.g. heights, normals, holes) or material information (e.g. diffuse color, specular color). The usage of a clipmap can vary and is not defined by this class itself. The only restriction is that all textures of this clipmap use the same texture format.
The clipmap consists of several levels, which are similar to mipmap levels. Level 0 has the finest resolution. All other levels have a lower resolution. The cell size (= texel size) is usually doubled between levels, but this can be configured using the property CellSizes. For example: A clipmap which stores terrain height values can use a resolution of 1 meter per cell at level 0, 2 meters per cell at level 1, 4 meters per cell at level 2, etc.
There is one texture for each clipmap level. All texture have the same size which is defined by CellsPerLevel. The number of levels is defined by NumberOfLevels.
Further a clipmap can consist of several textures per level, e.g. one texture to store detail normal vectors, a second texture to store diffuse color, a third texture to store specular color. Because of XNA limitations it might be necessary to combine several textures into a single texture atlas, where each texture atlas contains all levels with the same content. For example: One texture atlas contains all level textures with detail normal vectors, a second texture atlas contains all level textures with diffuse colors, the third texture atlas contains all level textures with specular colors. - All textures can be accessed using the Textures collection. (It can be helpful to visualize the textures for debugging).