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

Changed​Camera


public constant ChangedCamera → (1:int32)

Changed flag for Camera.

Changed​Decal


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

Changed flag for Decal.

Changed​Highlight


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

Changed flag for Highlight.

Changed​Layer​Blend


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

Changed flag for LayerBlend.

Changed​Lighting


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

Changed flag for Lighting.

Changed​Material


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

Changed flag for Material.

Changed​Mesh


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

Changed flag for Mesh.

Changed​Shadow


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

Changed flag for Shadow.

Changed​Texture


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

Changed flag for Texture.

Changed​Vertex​Blend


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

Changed flag for VertexBlend.

Pass​Color


public constant PassColor → (0:int32)

Render effect pass: vertex color shading.

Pass​Decal


public constant PassDecal → (1:int32)

Render effect pass: terrain decal overlay.

Pass​Highlight


public constant PassHighlight → (2:int32)

Render effect pass: simple highlighting with alpha blending.

Pass​Material


public constant PassMaterial → (3:int32)

Render effect pass: material based terrain texturing.

Pass​Shadow


public constant PassShadow → (5:int32)

Render effect pass: shadow map.

Pass​Texture​Atlas


public constant PassTextureAtlas → (6:int32)

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

Pass​Wireframe


public constant PassWireframe → (7:int32)

Render effect pass: terrain wireframe overlay.

Required parameters of Camera:

Pass​XDag​Sector​List


public constant PassXDagSectorList → (8:int32)

Render effect pass: decode sector list primitive on GPU.

Pass​XDag​Terminal​Triangle


public constant PassXDagTerminalTriangle → (9:int32)

Render effect pass: decode terminal triangle primitive on GPU.

Public / Constructors

Terrain​Parameters


public constructor TerrainParameters → (1)

featureLevel in : TerrainFeatureLevel

The GPU feature level.

Creates a new instance of TerrainParameters.

Public / Methods

Compute​Vertex​Blend


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.

Create​Effect


[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.

Feature​Level​Max


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.

Feature​Level​Min


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.

Feature​Level


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.

Layer​Blend


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.

Vertex​Blend


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.