TextureLayer

Description

sealed class Tinman.Engine.Scenes.Entities.TextureLayer

Derived from

TerrainLayerProvider abstract
ILightingProperty

A scene entity that adds a texture layer to the terrain.

Up to three IPixelPyramid objects may be used as input for a texture layer. The content mapping specifies how the color channels of each input pixel pyramid shall be interpreted (see ContentMapping).

The default value for the ILightingProperty.Lighting property is true.

Public / Constructors

Texture​Layer


public constructor TextureLayer → (10)

sortIndex in : int32

The layer sort index. Layers with larger sort index values are rendered on top of those with smaller sort index values.

atlasId0 in : string

[not-empty]
ID of the texture atlas to use for content index 0. Must refer to one of the IDs that have been declared via SceneOptions.TextureAtlas.

contentCacheId0 opt : string = null

ID of the cache to use for content tiles of index 0 of this layer. If not null, must refer to one of the IDs that have been declared via SceneOptions.CacheId.

textureCacheId0 opt : string = null

ID of the cache to use for texture tiles of index 0 of this layer. If not null, must refer to one of the IDs that have been declared via SceneOptions.CacheId.

atlasId1 opt : string = null

ID of the texture atlas to use for content index 1. If not null, must refer to one of the IDs that have been declared via SceneOptions.TextureAtlas.

contentCacheId1 opt : string = null

ID of the cache to use for content tiles of index 1 of this layer. If not null, must refer to one of the IDs that have been declared via SceneOptions.CacheId.

textureCacheId1 opt : string = null

ID of the cache to use for texture tiles of index 1 of this layer. If not null, must refer to one of the IDs that have been declared via SceneOptions.CacheId.

atlasId2 opt : string = null

ID of the texture atlas to use for content index 2. If not null, must refer to one of the IDs that have been declared via SceneOptions.TextureAtlas.

contentCacheId2 opt : string = null

ID of the cache to use for content tiles of index 2 of this layer. If not null, must refer to one of the IDs that have been declared via SceneOptions.CacheId.

textureCacheId2 opt : string = null

ID of the cache to use for texture tiles of index 2 of this layer. If not null, must refer to one of the IDs that have been declared via SceneOptions.CacheId.

Creates a new instance of TextureLayer.

The number of content pixel pyramids (see ContentCount) is determined from the values of the atlasId* arguments that are passed to this constructor. Their values cannot be changed later. The texture and content cache IDs may be changed later by using CacheId2.

Public / Methods

Cache​Id

2 overloads


[Pure]
public method CacheId1 → (2)

index in : int32

[0..TextureLayer.ContentCount-1]
The content index.

texture in : bool

true to return the cache ID that is used for the texture cache,
false to return the one for the content cache.

returns → string

The cache ID or null if none.

Returns the cache ID of the given content index.


public method CacheId2 → (3)

index in : int32

[0..TextureLayer.ContentCount-1]
The content index.

texture in : bool

true to set the cache ID that is used for the texture cache,
false to set the one for the content cache.

cacheId in : string

ID of the cache to use for content index 2 of this layer. If not null, must refer to one of the IDs that have been declared via SceneOptions.CacheId.

Sets the cache ID of the given content index.

Content​At

2 overloads


[Pure]
public method ContentAt1 → (1)

index in : int32

[0..TextureLayer.ContentCount-1]
The content index.

returns → IPixelPyramid

The IPixelPyramid content or null if none.

Returns the index in-th pixel pyramid content.


public method ContentAt2 → (3)

index in : int32

[0..TextureLayer.ContentCount-1]
The content index.

content in : IPixelPyramid own

The IPixelPyramid content or null if none.

linear opt : bool = false

Interpret pixel color channels as linear values instead of compressed sRGB?

Sets the index in-th pixel pyramid content.

Content​Prepared​At


public method ContentPreparedAt → (1)

index in : int32

[0..TextureLayer.ContentCount-1]
The content index.

returns → IPixelPyramid

The prepared content or null if no content has been specified.

Returns the prepared content of this texture layer.

The returned pixel pyramid takes into account all layer properties:

Use this pyramid to export the texture layer to a dataset.

Export​Dataset


[OwnerReturn]
public method ExportDataset → (3)

output in : Path

[not-null]
Path to output dataset.

index opt : int32 = 0

[0..TextureLayer.ContentCount-1]
The content index.

identifier opt : GUID = default(GUID)

The dataset indentifier, see PixelPyramidBuilder.Identifier

returns → IOperation

The background operation or null iff ContentPrepared returns null.

Exports the prepared content of this texture layer to a dataset.

IOException

If an I/O error has occurred while creating the output dataset.

Public / Attributes

Content


[OwnerValue]
public attribute Content → (get,set)

value : IPixelPyramid

The imagery content or null for none.

Shortcut to ContentAt1 resp. ContentAt2 for index 0.

Defaults to null.

Content​Count


public attribute ContentCount → (get)

value : int32

[1..3]
The number of content pixel pyramids.

Returns the number of content pixel pyramids.

Content​Mapping


public attribute ContentMapping → (get,set)

value : TerrainSlotMapping

The terrain slot mapping.

The terrain slot mapping for the input pixel pyramids.

The default mapping uses the red, green and blue channels of the pixel pyramid at index zero for TerrainSlotMapping.Albedo and the alpha channel of the same pixel pyramid as TerrainSlotMapping.Opacity.

Content​Prepared


public attribute ContentPrepared → (get)

value : IPixelPyramid

The prepared content or null if not content has been specified.

Shortcut to ContentPreparedAt for index 0.

Ground​Sample​Distance


public attribute GroundSampleDistance → (get,set)

value : RangeD

The ground sample distance range.

Restricts the set of content tiles to the given ground sample distance range.

The ground sample distance of a content tile is the real-world distance that corresponds to the edge length of a tile pixel.

Defaults to RangeD.Pos.

Is​Locked


public attribute IsLocked → (get)

value : bool

true if this texture layer is locked,
false if not.

Is this texture layer currently in locked mode?

In locked mode, only those pyramid files that are already present in the cache will be returned. In effect, the underlying content pyramid will never be accessed.

Levels


public attribute Levels → (get,set)

value : RangeI

The content level range.

Restricts the set of content tiles to the given pyramid level range.

Defaults to RangeI.Pos.

Opaque


public attribute Opaque → (get,set)

value : bool

true if this texture layer is opaque,
false if not.

Is this texture layer opaque?

If a texture layer is opaque, it will occlude all layers below, i.e. those with smaller sort index values.

Defaults to false.

Preload


public attribute Preload → (get,set)

value : bool

true to enable background preloading.
false to disable it.

Shall the content at index 0 of this texture layer be preloaded in the background?

Defaults to false.

Preloading


public attribute Preloading → (get)

value : IProgressInfo

The progress of the current preloading operation or null if no preloading is performed.

Returns progress information about the current preloading operation.

Region


public attribute Region → (get,set)

value : IShape

The vector shape.

Restricts the set of content tiles by intersecting them with the given vector shape.

Defaults to null.

Zoom


public attribute Zoom → (get,set)

value : bool

true to increase texture detail according to the current zoom-level of the scene camera (see Camera.Zoom),
false to ignore the current zoom-level and provide texture detail for a zoom-level of 1.

Increase texture detail when zooming in?

Defaults to true.

Logging

Logger


public static readonly attribute Logger → (ILogger)

The logger object of this class.