This page has been translated automatically.
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine 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
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector 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.

LightOmni Class

Inherits: Light

This class is used to create omni directional light sources. It is possible to modulate the light from omni light sources with a texture.

See Also#

  • A set of UnigineScript samples located in the <UnigineSDK>/data/samples/lights/ folder:
    • omni_00
    • omni_03
    • omni_04
    • omni_06
    • omni_07
  • A C++ API sample located in the source/samples/Api/Nodes/Lights folder

LightOmni 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 cubemap texture used with this light source.
set
Updates the cube map texture used with this light source.
set value - Name (path) of the new cube map texture.

Light.SHAPE ShapeType#

The shape of the light source.
Notice
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.
Notice
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 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.
Notice
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.
Notice
In case of the rectangular shape, the corner radius is set.
set value - Radius of the light source shape.

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 LightOmni ( vec4 color, float attenuation_distance, string name = 0 ) #

Constructor. Creates a new omni light source with the given parameters.

Arguments

  • vec4 color - Color of the new light source.
  • float attenuation_distance - Attenuation distance
  • string name - Name of the 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 - New texture to set.
  • 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.

void SetShadowSideEnabled ( int side, int enable ) #

Enables or disables shadows for the specified side of the omni light source's cube map. By default the light source casts shadows in all directions.

Arguments

  • int side - Number of the side of the omni light source for which shadows are to be enabled or disabled. One of the following values:
    • 0 - positive X
    • 1 - negative X
    • 2 - positive Y
    • 3 - negative Y
    • 4 - positive Z
    • 5 - negative Z
  • int enable - 1 to enable shadows for the specified side of the omni light source, 0 - to disable.

int IsShadowSideEnabled ( int side ) #

Returns a value indicating if shadows are to be cast for the specified side of the omni light source. By default the light source casts shadows in all directions.

Arguments

  • int side - Number of the side of the omni light source for which shadows are to be enabled or disabled. One of the following values:
    • 0 - positive X
    • 1 - negative X
    • 2 - positive Y
    • 3 - negative Y
    • 4 - positive Z
    • 5 - negative Z

Return value

1 if shadows are to be cast for the specified side of the omni light source; otherwise, 0.

vec3 GetSize ( ) #

Returns the size of the area illuminated by the light source. Depending on the shape type, the size varies:
  • If the light is point-shaped, each component of the vector will be equal to the attenuation distance:
    Source code (C++)
    vec3(attenuation_distance)
  • If the light is spherical, each component of the vector will be equal to the attenuation distance + sphere radius:
    Source code (C++)
    vec3(attenuation_distance + sphere_radius)
  • If the light is capsule-shaped, the 1st component of the vector will be equal to attenuation distance + capsule length:
    Source code (C++)
    vec3(attenuation_distance + capsule_length,attenuation_distance,attenuation_distance)
  • If the light is rectangular, the 2nd component of the vector will be equal to attenuation distance + rectangle height:
    Source code (C++)
    vec3(attenuation_distance,attenuation_distance + rectangle_height,attenuation_distance)

Return value

A size of the illuminated area.

static int type ( ) #

Returns the type of the node.

Return value

Light type identifier.
Last update: 2020-04-10
Build: ()