Terrain_Texture

Description

sealed class Tinman.Engine.Shaders.Terrain.Terrain_Texture

Derived from

GpuCode abstract

Full source code is included in the Tinman 3D SDK download.

Helper methods for terrain texturing with atlases.

Public / Methods

Coords


[Pure]
public static method Coords → (5)

atlas in : int32

The texture atlas index.

texCoords in : float3

Global terrain mesh coordinates:
Tinman.Terrain.Vertices.Formats.HeightmapCoordinates(CoordinatePrecision.FloatHigh)
or
Tinman.Terrain.Vertices.Formats.HeightmapCoordinates(CoordinatePrecision.Float)

texCoordsExtra in : float3

Global terrain mesh coordinates:
Tinman.Terrain.Vertices.Formats.HeightmapCoordinates(CoordinatePrecision.FloatLow)
or zero

coordsBase out : float2

Output coordinates for base texture.

coords out : float2

Output coordinates for texture.

Computes atlas texture coordinates.

Sample


[If("SHADER_PS")] [Pure]
public static method Sample → (4)

vertex in : float4

The vertex color.

coords in : float4 [ ] @ Length(Configuration.TERRAIN_TEXTURE_COUNT)

The texture coordinates for the tiles.

distance in : float32

The distance between the camera and the vertex.

opacity out : float32

The output opacity.

returns → Material

The material sample.

Fetches a material sample from the texture atlases.