PixelLayer
Description
- Derived from
Abstract base class for IPixelLayer implementations.
Public / Constructors
Coverage
Creates a pixel layer that renders the coverage layer (see HeightmapLayer.Coverage) into the output pixel buffer.
Displacement
Creates a pixel layer that reads HeightmapLayer.Displacement samples, applies a color-ramp to them and stores the resulting pixels in the output buffer.
Elevation
Creates a pixel layer that reads HeightmapLayer.Elevation samples, applies a color-ramp to them and stores the resulting pixels in the output buffer.
Material
2 overloads
Creates a pixel layer that renders the material layer (see HeightmapLayer.Material) into the output pixel buffer, using the given material color keys.
- See also
Creates a pixel layer that renders the given materials of the material layer (see HeightmapLayer.Material) into the output pixel buffer.
- See also
Normals
Renders normal vectors (see PaintingBuffer.Normals) into the output pixel buffer.
The red, green and blue channels define the tangent-space normal vector (not necessarily of unit length). The alpha channel is ignored.
The relative pixel intensities (red, green, blue) in the range [0..1] are mapped to the unit cube:
red :[0..1] => X:[-1 .. +1] green:[0..1] => Y:[-1 .. +1] blue :[0..1] => Z:[-1 .. +1]
where X+
is the tangent direction (positive texture U-axis), Y+
is the bitangent direction (positive texture V-axis) and Z+
is direction of the surface normal vector.
Occlusion
Creates a pixel layer that renders ambient occlusion terms as grayscale pixels into the output pixel buffer (black := fully occluded, white := no occlusion).
Ambient occlusion is computed by casting 16 rays (see 0
.. F
) per pixel (see x
), collecting the horizon angle for each one. The resulting ambient occlusion term is the average horizon angle (i.e. 0
means no occlusion at 0°, 1
means maximum occlusion at 90°).
+---+---+---+---+---+ | A | B | C | D | E | +---+---+---+---+---+ | 9 | | | | F | | +---+---+---+---+---+ | | 8 | | x | | 0 | ---+--> X +---+---+---+---+---+ | | 7 | | | | 1 | V +---+---+---+---+---+ Y | 6 | 5 | 4 | 3 | 2 | +---+---+---+---+---+
The range opt parameter can be used to speed up computation time, at the cost of accuracy. In combination with the padding opt parameter, the generated pyramid tiles will be seamless iff range opt is not zero and less than or equal to padding opt.
Protected / Methods
DoComputeLayerPixels
Performs the work of IPixelLayer.ComputeLayerPixels, after all input parameters have been validated.