This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Content Creation
Materials
Unigine Material Library
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

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 Node

Members


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: 2017-07-03
Build: ()