TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class Semantic in Tinman.Terrain.Vertices

Instances of the Semantic class are used as handles for vertex data container semantics (vertex position, normal vectors, etc.).

[ShutdownSurvive]
sealed class Semantic  

Remarks

The Semantic class defines default semantic handles for common vertex data containers. Applications are free to instantiate additional semantic handles as needed.

See also:

VertexArrays

Public / Attributes

All

Returns all existing Semantic objects.

public static property All { get }
type Semantic[]
value [not-null] A list of all Semantic objects.

DefaultUsage

Returns the default VertexElementUsage for this Semantic.

public property DefaultUsage { get }
type VertexElementUsage
value The default GPU usage or Unknown if this Semantic is not intended for being used on the GPU.

Id

The ID of this semantic object.

public property Id { get }
type int32
value [0..255] The unique identifier of this semantic object.

Name

The name of this vertex data container semantic.

public property Name { get }
type string
value [not-null] The semantic name.

TupleSize

The tuple size.

public property TupleSize { get }
type int32
value [1..4] The tuple size.

TupleType

The tuple element type.

public property TupleType { get }
type TupleType
value The tuple type.

Public / Constants

Area

Per-sector terrain-space area values.

public static readonly field Area
type Semantic

Remarks:

Name: 'Area'
Tuple size: 2
Tuple type: Float
Default usage: TextureCoords

Each tuple stores two terrain-space areas, having the following meaning:

In addition to level-of-detail computations, the actual mesh sector areas of this semantic can be used instead of approximating them using the bounding sphere radii (see IMeshBoundMinSize, for example).

See also:

XDag

Displacement

Terrain-space vertex displacement amount, along base vertex normal vector.

public static readonly field Displacement
type Semantic

Remarks:

Name: 'Displacement'
Tuple size: 1
Tuple type: Float

Elevation

Terrain-space vertex elevation values.

public static readonly field Elevation
type Semantic

Remarks:

Name: 'Elevation'
Tuple size: 1
Tuple type: Float

See also:

HeightmapLayer.Elevation
ElevationMinMax

ElevationMinMax

Holds minimum (see X) and maximum (see Y) elevation values per mesh sector.

public static readonly field ElevationMinMax
type Semantic

Remarks:

Name: 'ElevationMinMax'
Tuple size: 2
Tuple type: Float

See also:

Elevation

ErrorMaterial

Enables the static per-vertex error term based on material tokens that describe the terrain surface (see Material).

public static readonly field ErrorMaterial
type Semantic

Remarks:

Name: 'ErrorMaterial'
Tuple size: 1
Tuple type: Float

The error term is given in squared terrain-space.

ErrorNormal

A static per-vertex error term based on the curvature of the terrain surface (see Normal).

public static readonly field ErrorNormal
type Semantic

Remarks:

Name: 'ErrorNormal'
Tuple size: 1
Tuple type: Float

The error term is given in squared terrain-space.

ErrorPosition

Enables the static per-vertex error term based on the terrain geometry (see Position).

public static readonly field ErrorPosition
type Semantic

Remarks:

Name: 'ErrorGeometry'
Tuple size: 1
Tuple type: Float

The error term is given in squared terrain-space.

ErrorTexture

A static per-vertex error term based on diffuse colors that describe the terrain surface (see Texture).

public static readonly field ErrorTexture
type Semantic

Remarks:

Name: 'ErrorTexture'
Tuple size: 1
Tuple type: Float

The error term is given in squared terrain-space.

Geographic

Geographic latitude (within [-90..90]°, stored in Y) and longitude (within[-180..180]°, stored in X).

public static readonly field Geographic
type Semantic

Remarks:

Name: 'Geographic'
Tuple size: 2
Tuple type: Double

Ellipsoid height can be obtained from the Elevation array.

HeightmapCoords

Vertex heightmap coordinates.

public static readonly field HeightmapCoords
type Semantic

Remarks:

Name: 'HeightmapCoords'
Tuple size: 3
Tuple type: Int
Default usage: TextureCoords

Heightmap coordinates are stored with respect to a heightmap of size MaxSize. Use bit-shifting to translate coordinates to smaller heightmap sizes (see ComputeShiftToMaxSize).

Horizon

Per-vertex horizon.

public static readonly field Horizon
type Semantic

Remarks:

Name: 'Horizon'
Tuple size: 1
Tuple type: Long

When this vertex array and Elevation are present, an ambient occlusion term into will be put into the alpha channel of the diffuse colors in Texture.

Material

Material tokens for the terrain surface (see MaterialToken).

public static readonly field Material
type Semantic

Remarks:

Name: 'Material'
Tuple size: 1
Tuple type: Long

See also:

MaterialMask
ErrorMaterial

MaterialMask

Nested bitflags of material tokens for the terrain surface.

public static readonly field MaterialMask
type Semantic

Remarks:

Name: 'MaterialMask'
Tuple size: 1
Tuple type: Long

For each material ID m in the range [0..63], the flag bit 2^m will be set in the bitflag of a vertex iff the material is present somewhere in its mesh sector.

See also:

Material

MaterialRange

Nested material weights for the terrain surface.

public static readonly field MaterialRange
type Semantic

Remarks:

Name: 'MaterialRange'
Tuple size: 1
Tuple type: Int

Please refer to Range for details on how to interpret the bits of a material weight range value.

Normal

Vertex normal vectors.

public static readonly field Normal
type Semantic

Remarks:

Name: 'Normal'
Tuple size: 3
Tuple type: Float
Default usage: Normal

See also:

ErrorNormal

NormalBase

Vertex base normal vectors.

public static readonly field NormalBase
type Semantic

Remarks:

Name: 'NormalBase'
Tuple size: 3
Tuple type: Float
Default usage: Normal

During rendering, an application may choose to interpolate between actual normal vectors and base normal vectors, according to Area, in order to avoid visual aliasing artifacts when zooming out from a highly detailed mesh.

See also:

ErrorNormal

Position

Vertex positions.

public static readonly field Position
type Semantic

Remarks:

Name: 'Position'
Tuple size: 3
Tuple type: Double
Default usage: Position

See also:

ErrorPosition

Radius

Vertex bounding sphere radii.

public static readonly field Radius
type Semantic

Remarks:

Name: 'Radius'
Tuple size: 1
Tuple type: Float

The bounding sphere of a mesh sector contains all bounding spheres of its child mesh sectors (see GetChild.

TangentX

Vertex tangent vectors along the heightmap space X-axis.

public static readonly field TangentX
type Semantic

Remarks:

Name: 'TangentX'
Tuple size: 3
Tuple type: Float
Default usage: Tangent

For rectangular heightmaps, these vectors correspond to the usual tangent vectors.

TangentY

Vertex tangent vectors along the heightmap space Y-axis.

public static readonly field TangentY
type Semantic

Remarks:

Name: 'TangentY'
Tuple size: 3
Tuple type: Float
Default usage: Tangent

For rectangular heightmaps, these vectors correspond to the usual bitangent vectors.

TangentZ

Vertex tangent vectors along the heightmap space Z-axis.

public static readonly field TangentZ
type Semantic

Remarks:

Name: 'TangentZ'
Tuple size: 3
Tuple type: Float
Default usage: Tangent

These vectors are only used for cubemap heightmaps. In order to avoid distortions at the edges of the cubemap, it is necessary to combine the tangent vectors for the heightmap space X-, Y- and Z-axes separately for each cubemap face during rendering.

Texture

Diffuse colors for terrain texture.

public static readonly field Texture
type Semantic

Remarks:

Name: 'Texture'
Tuple size: 1
Tuple type: Long

See also:

ErrorTexture

TextureCoords

Custom vertex texture coordinates.

public static readonly field TextureCoords
type Semantic

Remarks:

Name: 'TextureCoords'
Tuple size: 2
Tuple type: Float
Default usage: TextureCoords

Version

Version counter that indicates structural changes of each terrain mesh sector.

public static readonly field Version
type Semantic

Remarks:

Name: 'Version'
Tuple size: 1
Tuple type: Int

The version of a vertex is incremented if one of the following happens inside of its mesh sector:

Public / Constructors

Semantic

Creates a new instance of Semantic.

public constructor Semantic (string name, int32 tupleSize, TupleType tupleType, VertexElementUsage defaultUsage = VertexElementUsage.Unknown)
params name [not-null] The name of the semantic object.
  tupleSize [1..4] The tuple size.
  tupleType The tuple type.
  defaultUsage The default GPU usage or Unknown if the semantic is not intended for being used on the GPU. Defaults to Unknown.

Remarks:

The maximum number of Semantic objects that may be created is 256.

Public / Methods

CreateVertexData

Creates a new vertex data container for this semantic.

public method CreateVertexData (int32 capacity)
type IVertexArray
params capacity [>0] The capacity of the container, in vertices.
returns [not-null] The created container.

ToString

public override method ToString ()
type string