TerrainLayerSlot

Description

sealed class Tinman.Engine.Components.TerrainLayerSlot

Derived from

Disposable abstract

Represents a single texture slot in a TerrainLayer.

A single pixel pyramid may be specified as texture source for each terrain layer slot (see Set). Additionally, the sRGB behaviour for encoding texels may be specified separately for each terrain layer slot. This flag may be different to the sRGB behaviour of the cache textures in the texture atlas (see ISrgb.Srgb).

Public / Methods

Clear


public method Clear → ()

Clears the texture assignment of this terrain layer slot.

Prepare


[OwnerReturn]
public method Prepare → (1)

pyramid in : IPixelPyramid

[not-null]
The pixel pyramid to prepare.

returns → IPixelPyramid

The prepared pixel pyramid.

Prepares the given pixel pyramid so that when passed to Set, no adjustments will be necessary and PixelPyramid will return the same object.

GeorefException

If pyramid in needs to be projected at runtime but has an invalid geo-reference.

Set


public method Set → (4)

pyramid in : IPixelPyramid

[not-null]
The pixel pyramid.

textureAtlas in : int32

[>=0]
The texture atlas index. Must be less than TerrainBufferOptions.TextureAtlasCount.

pyramidId opt : int32 = -1

The pyramid cache ID.

srgb opt : bool = true

The sRGB behaviour flag (see ISrgb).

Assigns the given texture to this terrain layer slot.

Because of adjustments that might be necessary for the given pyramid in, the actual pixel pyramid of the layer (see PixelPyramid) can be a different instance than the given pyramid in. To make sure that the actual pixel pyramid is the same as pyramid in, use Prepare.

Once a pixel pyramid has been assigned to the persistent cache, modifications made to it will invalidate the cache contents.

The PyramidFlags.Alpha flag is used to choose the texture atlas (see TerrainBufferOptions.TextureAtlas) to use for the given layer pyramid in.

GeorefException

If pyramid in needs to be projected at runtime but has an invalid geo-reference.

Public / Attributes

HasTexture


public attribute HasTexture → (get)

value : bool

true if this layer has a texture pyramid, false if not.

Does this terrain layer slot have a texture pyramid?

PixelPyramid


public attribute PixelPyramid → (get)

value : IPixelPyramid

The pixel pyramid or null.

The current pixel pyramid of this terrain layer slot.

PixelPyramidId


public attribute PixelPyramidId → (get)

value : int32

[-1..1023]
The pixel pyramid ID or -1 if caching is disabled.

The current pixel pyramid ID to use for caching (see PyramidFileCache).

TexelPyramid


public attribute TexelPyramid → (get)

value : ITexelPyramid

The texel pyramid or null.

The current texel pyramid of this terrain layer slot.