WorldOccluder Class
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.
Usage
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 Class
This class inherits from NodeMembers
WorldOccluder (vec3 size)
Constructor. Creates a new world occluder with given dimensions.Arguments
- vec3 size - Size of the new occluder.
float getDistance ()
Returns the current distance of disabling occluder.Return value
Distance in units.vec3 getSize ()
Returns the current size of the world occluder.Return value
Current size.int isBackFace ()
Returns a value indicating whether back or only front faces of the occluder box are rendered.Return value
1 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.Arguments
- 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.Arguments
- float distance - Distance in units.
void setSize (vec3 size)
Updates the current dimensions of the world occluder. The default is infinity.Arguments
- vec3 size - Size of the occluder.
Last update: 03.07.2017
Помогите сделать статью лучше
Была ли эта статья полезной?
(или выберите слово/фразу и нажмите Ctrl+Enter