Unit CastleTerrain
Description
Terrain (height map) components.
TODO: Terrain API is not finalized yet, there may be significant incompatible changes to this unit in the future. Big TODOs:
Edit terrain heights in the CGE editor.
Possible approach: turn any data (including TCastleTerrainNoise) into TCastleTerrainImage, then add editing tools to just change this image.
Alternatively user could edit a TCastleTerrainImage that is combined with TCastleTerrainNoise – this seems a powerful but uncertain feature, i.e. in the end it means you cannot directly edit the output of TCastleTerrainNoise, so it may be less comfortable (although it would allow to later regenerate TCastleTerrainNoise and keep the edits – effectively they would work like Blender modifier.)
Edit textures influence using splatmap. Just a texture where RGBA are weights for each texture.
Implement this, and also add a brush to edit splatmap in CGE editor.
The existing way to determine layers influence can then be used as just a nice (optional) way to auto-generate initial splatmap.
Adding vegetation to the terrain.
Adding grass and other small things (that must be placed in large batches and density should be dynamic).
Adding trees, boulders and other large things (their density should also be dynamic for fast rendering, but at close distance they are just 3D models).
Add non-trivial rendering algorithm. Right now it is really the simplest possible approach to generate a mesh from heights with a simplest shader mixing a few texture layers.
Smaller TODOs:
TCastleTerrain.Subdivisions should be TVector2Cardinal. Needs introducing TCastleVector2CardinalPersistent.
Enable normalmaps for each layer.
? TCastleTerrain configurable textures number. Unsure – hardcoding current 4 layers sucks, but also it makes sense for coming RGBA splatmap.
? TCastleTerrain Use GridCount, GridStep instead of Subdivisions, Size? See wyrd-forest arguments.
? TCastleTerrain add property to define material type, like in primitives - unlit, physical, phong. Wait with this for our final CGE components to define materials and effects, TCastlePhysicalMaterial, TCastleShaderEffect – they will determine how to nicely expose it here.
Uses
- SysUtils
- Classes
- CastleClassUtils
- CastleScript
- CastleImages
- X3DNodes
- CastleVectors
- CastleRectangles
- CastleTransform
- CastleScene
- X3DFields
- CastleRenderOptions
- CastleColors
- CastleTriangles
Overview
Classes, Interfaces, Objects and Records
Name | Description |
---|---|
Class TCastleTerrainData |
Terrain (height map) data that can be used for TCastleTerrain.Data. |
Class TCastleTerrainImage |
Terrain (height map) data taken from intensities in an image. |
Class TTerrainCasScript |
Terrain (height for each X, Y) data calculated from CastleScript expression. |
Class TCastleTerrainNoise |
Terrain heights are generated from a smooth noise, combined with some terrain-specific improvements (Heterogeneous). |
Class TCastleTerrainCombine |
Combine (add, multiply, do maximum or minimum) two other terrain data sources. |
Class TCastleTerrainLayer |
Layer of a terrain properties. |
Class TCastleTerrain |
Terrain. |
Types
TNoiseInterpolation = (...); |
TTerrain = TCastleTerrainData deprecated 'use TCastleTerrainData'; |
TTerrainImage = TCastleTerrainImage deprecated 'use TCastleTerrainImage'; |
TTerrainNoise = TCastleTerrainNoise deprecated 'use TCastleTerrainNoise'; |
TCastleTerrainCombineOperation = (...); |
Description
Types
TNoiseInterpolation = (...); |
This item has no description. Values
|
TTerrain = TCastleTerrainData deprecated 'use TCastleTerrainData'; |
Warning: this symbol is deprecated: use TCastleTerrainData This item has no description. |
TTerrainImage = TCastleTerrainImage deprecated 'use TCastleTerrainImage'; |
Warning: this symbol is deprecated: use TCastleTerrainImage This item has no description. |
TTerrainNoise = TCastleTerrainNoise deprecated 'use TCastleTerrainNoise'; |
Warning: this symbol is deprecated: use TCastleTerrainNoise This item has no description. |
TCastleTerrainCombineOperation = (...); |
Operation used by TCastleTerrainCombine to combine heights from 2 terrain data sources. See TCastleTerrainCombine.Operation. Values
|
Generated by PasDoc 0.16.0-snapshot.