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