Terrain_Material

Description

sealed class Tinman.Engine.Shaders.Terrain.Terrain_Material

Derived from

GpuCode abstract

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

Helper methods for terrain texturing with materials.

Public / Methods

Color


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

material in : Material

The terrain material sample.

eye in : float3

Eye vector, in light-space.

distance in : float32

Distance from fragment to camera.

shadow in : float32

Shadow factor (0 := full shadow, 1 := no shadow).

returns → float3

The resulting color.

Computes the material color.

Compute

3 overloads


[If("SHADER_GS")] [Pure]
public static method Compute1 → (1)

material in : GS_In_Material

The input data.

returns → PS_In_Material

The output data.

Computes displacement values.


[Pure]
public static method Compute2 → (2)

material in : GS_In_Material

The input data.

displacement in : DisplacementVarying

The displacement data.

returns → PS_In_Material

The output data.

Computes displacement values.


[If("SHADER_PS")] [Pure]
public static method Compute3 → (2)

data in : PS_In_Material

The input data.

face in : float32

The face orientation.

returns → PS_Out_Target

The output data.

Computes a pixel shader value.

Finish


[If("SHADER_PS")] [Pure]
public static method Finish → (6)

in : int32

The material index.

raw in : MaterialRaw

The raw material sample.

weights in : float3

The per-axis weights.

normal in : float3

Unit-length surface normal vector.

height in : float32

See Material.Height.

color in : float3

The vertex color.

returns → Material

The material sample.

Finishes computation of a material sample.

Grid​Line


[If("SHADER_PS")] [Pure]
public static method GridLine → (3)

coordinate in : float32

The coordinate from which to generate a grid line.

color in : float3

The input color.

grid in : float3

The grid color.

returns → float3

The resulting color.

Adjusts the given color in order to generate coordinate system grid lines.

Mix2


[If("SHADER_GS")] [Pure]
public static method Mix2 → (2)

in : GS_In_Material

First input vertex to mix.

in : GS_In_Material

Second input vertex to mix.

returns → GS_In_Material

The mixed vertex.

Mixes two input vertices evenly.

Mix3


[If("SHADER_TV")] [Pure]
public static method Mix3 → (4)

in : GS_In_Material

First input vertex to mix.

in : GS_In_Material

Second input vertex to mix.

in : GS_In_Material

Third input vertex to mix.

in : float3

The mix factors.

returns → GS_In_Material

The mixed vertex.

Mixes three input vertices.

Prepare


[If("SHADER_PS")] [Pure]
public static method Prepare → (8)

in : int32

The material index.

coords in : float3

The world-space coordinates.

normal in : float3

Unit-length surface normal vector.

weights out : float3

The per-axis weights.

height out : float32

See Material.Height.

planarX out : float2

Texture coordinates along the X-plane.

planarY out : float2

Texture coordinates along the Y-plane.

planarZ out : float2

Texture coordinates along the Z-plane.

Prepares computation of a material sample.

Tessellation​Factor


[Pure]
public static method TessellationFactor → (4)

a0 in : GS_In_Material

First vertex data.

a1 in : GS_In_Material

Second vertex data.

b0 in : DisplacementVarying

First displacement data.

b1 in : DisplacementVarying

Second displacement data.

returns → float32

The tessellation factor.

Computes the tessellation factor.

Weight


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

height in : float32

The displacement height value.

weight in : float32

The material weight value.

weightOriginal ref : float32

The sum of unmodified weights.

weightScaled ref : float32

The sum of scaled weights.

returns → float32

The scaled blend weight.

Computes the weight for height-based blending.

Weights


[Pure]
public static method Weights → (3)

vm in : float4

Holds an input material ID in each component.

vw in : float4

Holds an input material weight in each component.

tm in : float4

Holds an output material ID in each component.

returns → float4

The computed material weights, corresponding to the components in tm in.

Computes material weights.

The components of tm in and vw in vw are tied together.