IDecal

Description

interface Tinman.Terrain.Meshing.IDecal

Extended by

TerrainDecal sealed

Represents a terrain mesh decal texture.

A decal texture is a quadrilateral with an associated coordinate system, which is used to define its four vertex points, in clockwise winding:

(A)---------(B)    A := top-left
 |           |
 |           |     B := top-right
 |           |
 |           |     C := bottom-right
 |           |
(D)---------(C)    D := bottom-left

The Decaling class consumes zero or more decal textures and produces DecalingBatch values accordingly. During processing of the produced batches, additional information is required in most cases, for example GPU texture resources. Such information may be provided by classes that implement the IDecal interface.

See also

Decaling

Public / Methods

Coordinates​Of


public method CoordinatesOf → (1)

index in : int32

[0..3]
The decal vertex index, mapped to: A, B, C and D.

returns → Vec2D

The vertex coordinates, to be interpreted according to Coordinates.

Returns the coordinates of the given decal texture vertex.

If the coordinates of any vertex are undefined (see Vec2D.Undefined), the decal texture will be skipped silently during processing.

Public / Attributes

Coordinates


public attribute Coordinates → (get)

value : CoordinateSystem

The coordinate system to use for interpreting the transformed vertex coordinates or null if not specified.

The coordinate system to use for interpreting the transformed vertex coordinates.

If the coordinate system is null, the decal texture will be skipped silently during processing.

Priority


public attribute Priority → (get)

value : int32

The priority value; decal textures with higher priority are rendered on top of decal textures with lower priority (i.e. they are processed later and thus appear later in the list of computed decaling batches).

The priority of this decal texture.

Texture​Clip


public attribute TextureClip → (get)

value : Vec4F

The texture clip rectangle.

The texture clip rectangle.

The decal vertices A, B, C and D (see remarks) are mapped to normalized texture coordinates in the range [0..1]. The texture clip rectangle spans the texture coordinate range from (X,1-Z) to (Y,1-W). Pixels that lie outside of the clip rectangle are discarded during rendering. Using Vec4F.Zero will make the clip rectangle encompass the whole texture.