| TerrainHelperCreateNormalTexture Method |
Creates a normal map which can be used for terrain rendering.
Namespace: DigitalRune.GraphicsAssembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax public static void CreateNormalTexture(
GraphicsDevice graphicsDevice,
float[] heights,
int textureWidth,
int textureHeight,
float cellSize,
bool useNearestNeighborFilter,
ref Texture2D normalTexture
)
Public Shared Sub CreateNormalTexture (
graphicsDevice As GraphicsDevice,
heights As Single(),
textureWidth As Integer,
textureHeight As Integer,
cellSize As Single,
useNearestNeighborFilter As Boolean,
ByRef normalTexture As Texture2D
)
public:
static void CreateNormalTexture(
GraphicsDevice^ graphicsDevice,
array<float>^ heights,
int textureWidth,
int textureHeight,
float cellSize,
bool useNearestNeighborFilter,
Texture2D^% normalTexture
)
static member CreateNormalTexture :
graphicsDevice : GraphicsDevice *
heights : float32[] *
textureWidth : int *
textureHeight : int *
cellSize : float32 *
useNearestNeighborFilter : bool *
normalTexture : Texture2D byref -> unit
Parameters
- graphicsDevice
- Type: GraphicsDevice
The graphics device. - heights
- Type: SystemSingle
The terrain heights. - textureWidth
- Type: SystemInt32
The width of the texture. - textureHeight
- Type: SystemInt32
The height of the texture. - cellSize
- Type: SystemSingle
The cell size of the height map. - useNearestNeighborFilter
- Type: SystemBoolean
to use nearest-neighbor filtering (= every second pixel is dropped)
for creating mipmaps. to use a 3x3 filter (default).
- normalTexture
- Type: Texture2D
The created height texture. If this parameter is set to a matching texture, then the content
of this texture is updated and no new texture is created. (If this method is called with a
texture with wrong size or format, an exception is thrown.)
Exceptions See Also