shown in other instead.
This class creates a box-shaped occluder that is used to cull surfaces that are currently hidden behind it. The objects behind the occluder are not sent to the GPU which saves performance.
In order to enhance performance, occluders should be used wisely.
- Occluders can be highly effective in case of complex environments where there are many objects that occlude each other and are costly to render (they have a lot of polygons and/or heavy shaders).
- Effective culling is possible if objects are not too large, since if any part of their surface is seen, it cannot be culled. In case objects are big and have a few surfaces, it is likely that an additional performance load of an occluder will not pay off.
- In case the scene is filled with flat objects or a camera looks down on the scene from above (for example, in flight simulators), it is better not to use occluders at all or disable them.
WorldOccluder ClassThis class inherits from Node
WorldOccluder (vec3 size)Constructor. Creates a new world occluder with given dimensions.
- vec3 size - Size of the new occluder.
float getDistance ()Returns the current distance of disabling occluder.
Return valueDistance in units.
vec3 getSize ()Returns the current size of the world occluder.
Return valueCurrent size.
int isBackFace ()Returns a value indicating whether back or only front faces of the occluder box are rendered.
Return value1 if back faces of the occluder are rendered; otherwise, 0.
void setBackFace (int back)Updates the value indicating whether back or front faces of the occluder box should be rendered. The default is 0.
- int back - Positive value to render back faces of the occluder; 0 to render front ones.
void setDistance (float distance)Updates the distance for disabling occluder.
- float distance - Distance in units.
void setSize (vec3 size)Updates the current dimensions of the world occluder. The default is infinity.
- vec3 size - Size of the occluder.