Click or drag to resize
DigitalRuneTerrainClipmap Class
Represents a clipmap which stores terrain data.
Inheritance Hierarchy
SystemObject
  DigitalRune.GraphicsTerrainClipmap

Namespace: DigitalRune.Graphics
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public sealed class TerrainClipmap : IDisposable

The TerrainClipmap type exposes the following members.

Constructors
  NameDescription
Public methodTerrainClipmap
Initializes a new instance of the TerrainClipmap class.
Top
Methods
  NameDescription
Public methodDispose
Releases all resources used by an instance of the TerrainClipmap class.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInvalidate
Invalidates the cached clipmap.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Public fieldStatic memberMaxNumberOfLevels
The maximum number of clipmap levels.
Top
Properties
  NameDescription
Public propertyCellSizes
Gets the cell sizes of all clipmap levels.
Public propertyCellsPerLevel
Gets or sets the number of cells (texels) per clipmap level.
Public propertyEnableAnisotropicFiltering
Gets or sets a value indicating whether the clipmap is sampled using anisotropic filtering.
Public propertyEnableMipMap
Gets or sets a value indicating whether the clipmap textures use mipmaps.
Public propertyLevelBias
Gets or sets the level bias.
Public propertyMinLevel
Gets or sets the index of the first level which is actively used.
Public propertyNumberOfLevels
Gets or sets the number of clipmap levels.
Public propertyOrigins
Gets the world space origin of each clipmap level.
Public propertyTextures
Gets the clipmap textures.
Top
Remarks

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).

See Also