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
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

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: 03.07.2017
Build: ()