PaintingBuffer

Description

sealed class Tinman.Terrain.Heightmaps.Painting.PaintingBuffer

Helper object that allows reusing of buffers when performing painting with heightmap data.

Public / Constructors

Painting​Buffer

2 overloads


public constructor PaintingBuffer1 → (3)

width in : int32

[>0]
The heightmap region width.

height in : int32

[>0]
The heightmap region height.

layers in : HeightmapLayer

The heightmap layers.

Creates a new instance of PaintingBuffer.

A new input buffer will be created according to the given parameters.


public constructor PaintingBuffer2 → (1)

samples in : HeightmapRegion

[not-null]
The heightmap region buffer.

Creates a new instance of PaintingBuffer.

The given input buffer will be wrapped by this object.

Pool


public static method Pool → (3)

width in : int32

[>0]
The buffer width, in pixels.

height in : int32

[>0]
The buffer height, in pixels.

layers in : HeightmapLayer

The heightmap layers.

returns → IObjectPoolFactory<PaintingBuffer>

The object pool factory.

Creates a new instance of IObjectPoolFactory that creates PaintingBuffer objects.

The following values will be reset when a PaintingBuffer object is fetched from the pool:

The buffer contents are undefined.

Public / Methods

Copy​For


public method CopyFor → (2)

brush in : IBrush

[not-null]
The brush for which to create an input buffer.

output opt : HeightmapLayer = HeightmapLayer.All

The output layers that are going to be computed.

returns → PaintingBuffer

The copied buffer.

Creates a copy of this buffer, for being used as input to brush in.

Samples​Dirty


public method SamplesDirty → (1)

layers opt : HeightmapLayer = HeightmapLayer.All

The heightmap layers to mark as dirty.

Marks the given layers of Samples as dirty.

This method needs to be called after the samples of Samples have been modified, to make sure that dependent computations will be performed again.

Public / Attributes

Coords


public attribute Coords → (get,set)

value : CubemapFaceCoordsI

The heightmap coordinates.

The heightmap coordinates that correspond to the top-left sample in the heightmap region buffer (see Samples).

This value only needs to be set when computing terrain-space normal vectors (see Geometry). Defaults to CubemapFaceCoordsI.Undefined.

Geometry


public attribute Geometry → (get,set)

value : IGeometry

The geometry to use or null to compute tangent-space normal vectors.

The geometry to use for computing terrain-space normal vectors.

When computing terrain-space normal vectors, the Coords property must be set before calling IPixelLayer.ComputeLayerPixels.

Height


public attribute Height → (get)

value : int32

[>0]
The buffer height, in heightmap samples.

Height of the painting buffer.

Modifier


public attribute Modifier → (get,set)

value : IMeshModifier

The mesh modifier or null.

Optional mesh modifier to use when computing terrain-space normal vectors.

The value of this property will be ignored if Geometry is null.

Normals


public attribute Normals → (get)

value : NormalBuffer

[not-null]
The computed normal buffer.

Returns the normal buffer.

The normal buffer contains tangent-space normal vectors iff Geometry is null. Otherwise, it contains terrain-space normal vectors.

Using the normal buffer requires HeightmapLayer.Elevation as input layer.

All layers declared by the used mesh modifier (see Modifier) are required as input layers.

The normal buffer is (re-)computed after SamplesDirty has been called with HeightmapLayer.Elevation or when the value of Step is modified.

Samples


public readonly attribute Samples → (HeightmapRegion)

The heightmap samples of this buffer.

Slopes


public attribute Slopes → (get)

value : SlopeBuffer

[not-null]
The computed slope buffer.

Returns the slope buffer.

Using the slope buffer requires HeightmapLayer.Elevation as input layer.

The normal buffer is (re-)computed after SamplesDirty has been called with HeightmapLayer.Elevation or when the value of Step is modified.

Step


public attribute Step → (get,set)

value : int32

[>=1]
The sample step value.

The sample step distance of the input data.

Defaults to 1.

Width


public attribute Width → (get)

value : int32

[>0]
The buffer width, in heightmap samples.

Width of the painting buffer.