Unigine::LightWorld Class
Header: | #include <UnigineLights.h> |
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 LightWorldPtr create(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.
Ptr<LightWorld> cast(const Ptr<Node> & node)
Casts a LightWorld out of the Node instance.Arguments
- const Ptr<Node> & node - Pointer to Node.
Return value
Pointer to LightWorld.Ptr<LightWorld> cast(const Ptr<Light> & base)
Casts a LightWorld out of the Light instance.Arguments
- const Ptr<Light> & base - Pointer to Light.
Return value
Pointer to LightWorld.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 SCATTERING_* variables.
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 - A multiplier for the distance to the border of the cascade at which shadows are rendered in range [0;1].
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 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 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: 2017-07-03
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)