Class TCastleTerrain

Unit

Declaration

type TCastleTerrain = class(TCastleTransform)

Description

Terrain.

Assign Data to provide some non-trivial height map, you can use there:

  • TCastleTerrainNoise to generate a height map using a dedicated algorithm for terrain generation, using smooth noise and special tricks to have smooth and heteregeneous terrain.

  • TCastleTerrainImage to generate a height map from intensities of a simple 2D image.

  • TCastleTerrainCombine to combine the above options in any expression (take minimum, maximum, sum, multiply).

The terrain starts as a standard mesh with a TPhysicalMaterialNode material. We apply on it a special affect to mix 4 layers, where each layer has a separate color and texture.

  • Each layer has a color (white by default), texture (none by default, that behaves like white) and UV scale. See TCastleTerrainLayer. Each layer is a property like Layer1, Layer2, Layer3, Layer4.

  • Only the RBG channels of textures matter, alpha is ignored.

  • Layer 1 is used for flat terrain on lower heights.

  • Layer 2 is used for steep terrain on lower heights.

  • Layer 3 is used for flat terrain on higher heights.

  • Layer 4 is used for steep terrain on higher heights.

  • The meaning of "lower" and "higher" heights is determined by Height1 and Height2. Below Height1 we show only layers 1+2, above Height2 we show only layers 3+4, between we show a smooth interpolation between them.

  • The meaning of "flat" and "steep" is determined by looking at terrain normals emphasized by SteepEmphasize.

  • The influence of this effect can be controlled by LayersInfluence.

Source: scene/castleterrain.pas (line 552).

Hierarchy


Generated by PasDoc 0.17.0.snapshot.