TerrainParameters

Description

sealed class Tinman.Engine.Rendering.Effects.TerrainParameters

Derived from

RenderEffectParameters abstract

Render effect parameters for ITerrainEffect.

The following low-level render effect parameter slots are always defined:

Public / Constants

ChangedCamera


public constant ChangedCamera → (1:int32)

Changed flag for Camera.

ChangedDecal


public constant ChangedDecal → (1 << 1:int32)

Changed flag for Decal.

ChangedHighlight


public constant ChangedHighlight → (1 << 2:int32)

Changed flag for Highlight.

ChangedLayerBlend


public constant ChangedLayerBlend → (1 << 3:int32)

Changed flag for LayerBlend.

ChangedLighting


public constant ChangedLighting → (1 << 4:int32)

Changed flag for Lighting.

ChangedMaterial


public constant ChangedMaterial → (1 << 5:int32)

Changed flag for Material.

ChangedMesh


public constant ChangedMesh → (1 << 6:int32)

Changed flag for Mesh.

ChangedShadow


public constant ChangedShadow → (1 << 7:int32)

Changed flag for Shadow.

ChangedTexture


public constant ChangedTexture → (1 << 8:int32)

Changed flag for Texture.

ChangedVertexBlend


public constant ChangedVertexBlend → (1 << 9:int32)

Changed flag for VertexBlend.

FlagSimple


public constant FlagSimple → (1:int32)

Only simplified terrain rendering with feature level TerrainFeatureLevel.DX9 is available.

PassColor


public constant PassColor → (0:int32)

Render effect pass: vertex color shading.

PassDecal


public constant PassDecal → (1:int32)

Render effect pass: terrain decal overlay.

PassHighlight


public constant PassHighlight → (2:int32)

Render effect pass: simple highlighting with alpha blending.

PassMaterial


public constant PassMaterial → (3:int32)

Render effect pass: material based terrain texturing.

PassShadow


public constant PassShadow → (5:int32)

Render effect pass: shadow map.

PassTextureAtlas


public constant PassTextureAtlas → (6:int32)

Render effect pass: unique texturing with texture pyramids via TextureAtlas.

PassWireframe


public constant PassWireframe → (7:int32)

Render effect pass: terrain wireframe overlay.

Required parameters of Camera:

PassXDagSectorList


public constant PassXDagSectorList → (8:int32)

Render effect pass: decode sector list primitive on GPU.

PassXDagTerminalTriangle


public constant PassXDagTerminalTriangle → (9:int32)

Render effect pass: decode terminal triangle primitive on GPU.

Public / Constructors

TerrainParameters


public constructor TerrainParameters → (1)

featureLevel in : TerrainFeatureLevel

The GPU feature level.

Creates a new instance of TerrainParameters.

Public / Methods

ComputeVertexBlend


public method ComputeVertexBlend → (2)

viewport in : Viewport

[not-null]
The viewport.

mesh in : IMeshDynamic

[not-null]
The terrain mesh.

Computes and sets VertexBlend, using the given values.

CreateEffect


[OwnerReturn]
public static method CreateEffect → (3)

context in : IGraphicsContext

[not-null]
The graphics context to use.

featureLevelMin opt : TerrainFeatureLevel = TerrainFeatureLevel.DX9

The minimum feature level (inclusive).

featureLevelMax opt : TerrainFeatureLevel = TerrainFeatureLevel.DX12

The maximum feature level (inclusive).

returns → ITerrainEffect

The resulting ITerrainEffect or null iff no feature level is applicable to the given graphics context in.

Tries to create a ITerrainEffect with the highest feature level between featureLevelMin opt and featureLevelMax opt.

RenderException

If a graphics subsystem error has occurred.

FeatureLevelMax


public static method FeatureLevelMax → (1)

context in : IGraphicsContext

The graphics context.

returns → TerrainFeatureLevel

The maximum feature level.

Determines the maximum TerrainFeatureLevel that is supported by the given graphics context in.

FeatureLevelMin


public static method FeatureLevelMin → (1)

context in : IGraphicsContext

The graphics context.

returns → TerrainFeatureLevel

The maximum feature level.

Determines the minimum TerrainFeatureLevel that is supported by the given graphics context in.

Public / Attributes

Camera


public readonly attribute Camera → (CameraParameters)

The aggregated camera parameters.

Decal


public readonly attribute Decal → (DecalParameters)

The aggregated decal parameters.

FeatureLevel


public attribute FeatureLevel → (get)

value : TerrainFeatureLevel

The feature level.

The GPU feature level.

Highlight


public attribute Highlight → (get,set)

value : int64

The color value, see Colors.

Custom color value to blend the terrain to (used for highlighting mesh sectors).

Defaults to 0.

LayerBlend


public attribute LayerBlend → (get,set)

value : Fade

The fade range.

Fade range to use for blending terrain layers.

Defaults to Fade.AlwaysZero.

Lighting


public readonly attribute Lighting → (LightingParameters)

The aggregated lighting parameters.

Material


public readonly attribute Material → (TerrainMaterialParameters)

The aggregated material parameters.

Mesh


public readonly attribute Mesh → (MeshParameters)

The aggregated mesh parameters.

Shadow


public readonly attribute Shadow → (ShadowParameters)

The aggregated shadow parameters.

Texture


public readonly attribute Texture → (TerrainTextureParameters)

The aggregated parameters for unique terrain multi-texturing.

VertexBlend


public attribute VertexBlend → (get,set)

value : Vec4F

The coefficient vector.

Coefficients to use for blending vertex data between LOD levels:

x := screenSpace / terrainSpace * cameraDistance
y := x * x
z := qualityThresholdInScreenSpace
w := log2(pi * z * z)

x may be obtained by passing (1, 1) to Viewport.Project.
z may be obtained by getting IMeshDynamic.QualityThreshold.
w is the screen-space area of circle with radius z.

Set to (0,0,-1,-1) to use maximum LOD everywhere.

Defaults to Vec4F.Zero.