This page has been translated automatically.
Programming
Fundamentials
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Core Library
Containers
Engine Classes
Node-Related Classes
Rendering-Related Classes
Physics-Related Classes
Bounds-Related Classes
GUI-Related Classes
Controls-Related Classes
Pathfinding-Related Classes
Utility Classes
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

LightWorld Class

Interface for light omni handling.

To use this class, include the UnigineLightWorld.h file.

LightWorld Class

Members


LightWorld (const Math::vec4 & color)

Constructor. Creates a new world light source with a given color.

Arguments

  • const Math::vec4 & color - Color of the new light source.

void setScattering (int scattering)

Sets a lighting type for the world light.

Arguments

void setDisableAngle (float angle)

Sets an angle at which the light source is disabled (shadows and the diffuse component is disabled). However, the light source still affects scattering.

Arguments

  • float angle - Angle at which the light source is disabled.

void setShadowCascadeBorder (int num, float r)

Calculates the distance to the border of the specified cascade.

Arguments

  • int num - The number of the cascade in range [0;num_cascades-1].
  • float r - A multiplier for the distance to the border of the cascade at which shadows are rendered in range [0;1].

int getScattering ()

Returns a lighting type set for the world light.

Return value

One of the SCATTERING_* variables.

int getNumShadowCascades ()

Returns the number of shadow cascades with different shadow maps. All the shadow maps have the same resolution, but are applied to different cascades. Thus, close-range shadows are of higher quality and distant ones of lower.

Return value

The number of shadow cascades. The minimum number of cascades is 1, the maximum is 4.

void setShadowSharpness (float sharpness)

Sets the sharpness of the shadow edges.

Arguments

  • float sharpness - Sharpness of the shadow edges.

float getShadowCascadeBorder (int num)

Returns the multiplier for the distance to the border of the specified cascade at which shadows are rendered.

Arguments

  • int num - The number of the cascade in range [0;num_cascades-1].

Return value

Multiplier for the distance to the border of the cascade.

float getShadowCascadeOffset ()

Returns the current offset of all the shadow cascades relative to the camera.

Return value

Offset of the shadow cascades.

void setNumShadowCascades (int cascades)

Sets the number of shadow cascades with different shadow maps. All the shadow maps have the same resolution, but are applied to different cascades. Thus, close-range shadows are of higher quality and distant ones of lower.

Arguments

  • int cascades - Number of shadow cascades. Accepted values are from 1 to 4. The default is 4.

float getDisableAngle ()

Returns an angle at which the light source is disabled (shadows and the diffuse component is disabled). However, the light source still affects scattering.

Return value

Angle at at which the light source is disabled.

void setShadowCascadeOffset (float offset)

Sets an offset of all the shadow cascades relative to the camera.

Arguments

  • float offset - Offset of the shadow cascades.

float getShadowSharpness ()

Returns the sharpness of the shadow edges.

Return value

Sharpness of the shadow edges.

int SCATTERING_NONE

Description

Render the atmosphere with no influence of the global lights (sun and moon), i.e. the light gradient won't be changed in any direction.

int SCATTERING_SUN

Description

Render the atmosphere in accordance with the Sun's lighting.

int SCATTERING_MOON

Description

Render the atmosphere in accordance with the Moon's lighting.
Last update: 2017-07-03
Build: ()