Unigine.LightProj Class
Inherits: | Light |
This class is used to create projected light sources that emit light from a single point and cast a cone of light. It is possible to modulate the light from these light sources with a texture.
See Also#
- A set of UnigineScript API samples located in the <UnigineSDK>/data/samples/lights/ folder:
- proj_00
- proj_03
LightProj Class
Properties
Texture Texture#
Gets a light image texture smart pointer.
set
Sets the light image texture smart pointer.
set value -
Texture smart pointer.
string TexturePath#
The name (path) of the texture used with this light source.
set
Updates the texture used with this light source.
set value -
Name (path) of the new texture.
float Penumbra#
set
set value -
float ZNear#
The distance to the near clipping plane of the projected light source. the default value is 0.1.
set
Updates the distance to the near clipping plane of the projected light source.
set value -
New distance to the near clipping plane in units. If a negative value is provided, 0 will be used instead. The default value is 0.1.
float Fov#
The current field of view of the projected light source.
set
Updates the current field of view of the projected light source. Remember that large fields of view may lead to shadow distortions.
set value -
New field of view in degrees. This value will be saturated in range [1; 180].
float ShapeHeight#
The height of the rectangular light source.
set
Updates the height of the rectangular light source.
set value -
Height of the light source shape.
float ShapeLength#
A length of the capsule-shaped or rectangular light source.
set
Updates the length of the capsule-shaped or rectangular light source.
set value -
Length of the light source shape.
float ShapeRadius#
A radius of the spherical, capsule-shaped or rectangular light source.
In case of the rectangular shape, the corner radius will be returned.
set
Updates the radius of the spherical, capsule-shaped or rectangular light source.
In case of the rectangular shape, the corner radius is set.
set value -
Radius of the light source shape.
Light.SHAPE ShapeType#
The shape of the light source.
A light source of the rectangular shape produces the light and the speck in a form of a rounded rectangle.
set
Updates the shape of the light source.
A light source of the rectangular shape produces the light and the speck in a form of a rounded rectangle.
set value -
Shape of the light source (one of the LIGHT_SHAPE_*variables).
float AttenuationDistance#
The distance from the light source shape, at which the light source doesn't illuminate anything.
set
Updates the distance from the light source shape, at which the light source doesn't illuminate anything.
set value -
Distance from the light source shape, at which the light source doesn't illuminate anything.
Members
static LightProj ( vec4 color, float attenuation_distance, float fov, string name = 0 ) #
Constructor. Creates a new projected light source with texture modulation based on given parameters.Arguments
- vec4 color - Color of the new light source.
- float attenuation_distance - Distance from the light source shape, at which the light source doesn't illuminate anything.
- float fov - Field of view of the new light source.
- string name - Path to a texture of the new light source.
int SetTextureImage ( Image image, bool dynamic = 0 ) #
Sets a given Image instance as the light image texture. If you need to set a texture of all the lights in the scene, set dynamic flag to 1.Arguments
- Image image - Image.
- bool dynamic - Dynamic texture flag.
- If set to 0, changing a texture of the light instance will also affect all the lights in the scene.
- If set to 1, an image will be successfully set only for the current light instance.
Return value
Returns 1 if the texture is set successfully; otherwise, 0.int GetTextureImage ( Image image ) #
Reads the light image texture into an Image instance.Arguments
- Image image - Image, into which the texture is read.
Return value
Returns 1 if the texture is read successfully; otherwise, 0.mat4 GetProjection ( ) #
Returns the projection matrix used with this light source.Return value
Projection matrix.static int type ( ) #
Returns the type of the node.Return value
Light type identifier.Last update:
2020-04-10
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)