sealed class Tinman.Terrain.Buffers.MaterialBuffer

Derived from

SampleBufferInt64 abstract

A sample buffer for material tokens.

See also


Public / Constants


public static readonly attribute ScanlineRangeDefault → (PixelRange)

The default value of ISampleBuffer.ScanlineRange.

For image coding, the raw pixel value corresponds to the material weight (see MaterialToken).

The default pixel range maps the material weight values 0 and 255 to black resp. white (per color channel, the alpha channel is inverted).

Public / Constructors


public static method Create → (2)

width in : int32

Width of the material buffer.

height in : int32

Height of the material buffer.

returns → MaterialBuffer

The material buffer.

Creates a new instance of MaterialBuffer.

Instances of ColorBuffer can be pooled by calling IDeletable.Delete.

Public / Attributes


public attribute ScanlineMaterials → (get,set)

value : Vec4I

The material mapping (see remarks).

Mapping between material IDs and pixel channels when reading from resp. writing to scanlines.

The components Vec4I.X, Vec4I.Y, Vec4I.Z and Vec4I.W of the material vector are mapped to the PixelChannel.Red, PixelChannel.Green, PixelChannel.Blue and PixelChannel.Alpha channels, respectively.

The default value is (0,1,2,3).