shown in other instead.
To provide increased performance, terrain occluders should be used wisely.
- If terrain relief is changed in the runtime, it is not recommended to use the occluder.
The terrain occluder is generated basing on its downsized height map using cone-step mapping. Generation of an occluder texture is a time-consuming operation that should be done only once rather than each time on world load.
To set a texture for WorldOccluderTerrain in real-time, use the following steps:
- Set a height map texture (in R8, R16 or RG8 format) via setHeightsImageName(). Cone-step mapping will be calculated and a new image (in RGB8 format) will be generated. It contains all data necessary to perform occlusion.
- Get newly generated occluder image (RGB8) via getHeightsImage().
- Save this occluder image (RGB8) to disk with same name.
static int type ()WorldOccluderTerrain type.
Return valueWorldOccluderTerrain type identifier.
static Ptr< WorldOccluderTerrain > create (const NodePtr & node)WorldOccluderTerrain constructor.
- const NodePtr & node - Node smart pointer.
static Ptr< WorldOccluderTerrain > create (const vec3 & size)WorldOccluderTerrain constructor.
virtual Ptr< Node > getNode () const =0Returns a node pointer.
Return valueNode pointer.
virtual void setSize (vec3 & size) =0Sets the dimensions of the terrain occluder.
- vec3 & size - Size of the terrain occluder in units. If a negative value is provided, vec3(0.0f) will be used instead.
virtual vec3 getSize () const =0Returns the current dimensions of the terrain occluder.
Return valueSize of the terrain occluder in units.
virtual void setRadius (float radius) =0Radius of ray tracing to perform occlusion. The radius is counted off starting from the camera.
- float radius - Radius of occlusion in units.
virtual float getRadius () const =0Returns the current ray tracing radius to perform occlusion.
Return valueRadius of occlusion in units.
virtual void setDistance (float distance) =0Sets the distance for disabling terrain occluder.
- float distance - Distance in units. If a negative value is provided, 0 will be used instead.
virtual float getDistance () const =0Returns the current distance for disabling terrain occluder.
Return valueDistance in units.
virtual int setHeightsImageName (const char * name) =0Sets the name of the height map that repeats terrain heights. The height map can be smaller in size compared to terrain's one. It will be automatically converted into the RGB8 format.
- const char * name - Height map name.