This page has been translated automatically.
Getting Started
Migrating to UNIGINE 2.0
C++ API Migration
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

LightWorld Class

This class is used to create world light sources. This type of lite sources imitates sunlight and uses parallel-split shadow mapping.

LightWorld Class

This class inherits from Light

Members


LightWorld (vec4 color)

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

Arguments

  • vec4 color - Color of the new light source.

int getNumShadowSplits ()

Returns number of shadow splits.

Return value

Return number of shadow splits.

int getScattering ()

Returns a value indicating if scattering is associated with the world light.

Return value

Positive number if scattering is associated with the light; otherwise, 0.

float getShadowDistribute ()

Returns a coefficient indicating how distance between split planes should change (Unigine uses PSSM to render shadows).

Return value

Coefficient indicating how distance between split planes should change. 0 means that the distances between planes increase logarithmically. 1 means that linear splits are used. Values in between specify interpolation between the above two strategies.

float getShadowRange ()

Returns a range, in which objects cast shadows created by the light. This range is measured along the light direction, not the camera direction, however, the center of the range lies on the camera direction line.

Return value

Shadow map depth.

void setNumShadowSplits (int num)

Sets a number of shadow map splits. Take into the account that excessive number of splits heavily increase polygon count in the scene.

Arguments

  • int num - Number of shadow splits, accepted values are from 1 to 4 (4 by default).

void setScattering (int mode)

Sets a value indicating if scattering should be associated with the world light.

Arguments

  • int mode - Positive number to associate scattering with the light, 0 to not associate.

void setShadowDistribute (float coefficient)

Sets a coefficient indicating how distance between split planes should change (Unigine uses PSSM to render shadows).

Arguments

  • float coefficient - Coefficient indicating how distance between split planes should change. 0 means that the distances between planes increase logarithmically. 1 means that linear splits are used. Values in between specify interpolation between the above two strategies. The provided value will be saturated in range [0; 1].

void setShadowRange (float distance)

Sets a range, in which objects cast shadows created by the light. This range is measured along the light direction, not the camera direction, however, the center of the range lies on the camera direction line.

Arguments

  • float distance - Shadow map depth. If a negative value is provided, 0 will be used instead.
Last update: 2017-07-03
Build: ()