This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
FAQ
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes
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.

Unigine.LightWorld Class

Inherits:Light

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

LightWorld Class

Members


static LightWorld(vec4 color)

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

Arguments

  • vec4 color - Color of the new light source.

LightWorld cast(Node node)

Casts a LightWorld out of the Node instance.

Arguments

  • Node node - Node instance.

Return value

LightWorld instance.

LightWorld cast(Light base)

Casts a LightWorld out of the Light instance.

Arguments

  • Light base - Light instance.

Return value

LightWorld instance.

void setMode(int mode)

Sets rendering mode for the light source. This option determines whether the light is to be rendered as a dynamic or static one.

Arguments

  • int mode - Light mode, one of the MODE_* variables. By default the mode is set to MODE_MIXED.

int getMode()

Returns the current rendering mode for the light source. This option determines whether the light is to be rendered as a dynamic or static one.

Return value

Light mode, one of the MODE_* variables. By default the mode is set to MODE_MIXED.

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.

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 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.

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 setScattering(int scattering)

Sets a lighting type for the world light.

Arguments

int getScattering()

Returns a lighting type set for the world light.

Return value

One of the SCATTERING_* variables.

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 - Multiplier for the distance to the border of the cascade.

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.

void setShadowSharpness(float sharpness)

Sets the sharpness of the shadow edges.

Arguments

  • float sharpness - Sharpness of the shadow edges.

float getShadowSharpness()

Returns the sharpness of the shadow edges.

Return value

Sharpness of the shadow edges.

int type()

Returns the type of the node.

Return value

Light type identifier.

int SCATTERING_MOON

Description

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

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.
Last update: 2018-08-10
Build: ()