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 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 scattering - One of the LIGHT_WORLD_SCATTERING_* variables.
int getScattering()
Returns a lighting type set for the world light.Return value
One of the LIGHT_WORLD_SCATTERING_* variables.void setShadowCascadeBorder(int num, float r)
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].
- 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 at which shadows are rendered in range [0;1].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 getShadowCascadeOffset()
Returns the current offset of all the shadow cascades relative to the camera.Return value
Offset of the shadow cascades.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()
int LIGHT_WORLD_SCATTERING_MOON
Description
Render the atmosphere in accordance with the Moon's lighting.int LIGHT_WORLD_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 LIGHT_WORLD_SCATTERING_SUN
Description
Render the atmosphere in accordance with the Sun's lighting.Last update: 2017-07-03
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)