MaterialBuffer

Description

sealed class Tinman.Terrain.Buffers.MaterialBuffer

Derived from

SampleBufferInt64 abstract

A sample buffer for material tokens.

See also

MaterialToken

Public / Constants

ScanlineRangeDefault


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

Create


public static method Create → (2)

width in : int32

[>0]
Width of the material buffer.

height in : int32

[>0]
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

ScanlineMaterials


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