Programming
Fundamentials
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Core Library
Containers
Engine Classes
Node-Related Classes
Rendering-Related Classes
Physics-Related Classes
Bounds-Related Classes
GUI-Related Classes
Controls-Related Classes
Pathfinding-Related Classes
Utility Classes

LightEnvironmentProbe Class

LightEnvironmentProbe Class

Members


LightEnvironmentProbe (const Math::vec4 & color, const Math::vec3 & attenuation_distance, const char * name = 0)

Constructor. Creates a new environment probe with cubemap modulation based on given parameters.

Arguments

  • const Math::vec4 & color - Color of the environment probe.
  • const Math::vec3 & attenuation_distance - Radii of the environment probe.
  • const char * name - Path to a cube texture of the environment probe.

const char * getImageTextureName ()

Returns the path to the reflection cube texture used for the environment probe.

Return value

Path to the cube texture.

int getImageTextureImage (const Ptr<Image> & image)

Grabs the cube texture (RGBA16F) containing the rendered environment probe and saves it into the given Image instance.

Arguments

  • const Ptr<Image> & image - Image into which the texture is saved.

Return value

1 if the cube texture has been grabbed successfully; otherwise, 0.

float getZFar ()

Returns the distance to the far clipping plane used for image grabbing (available only when the Dynamic flag is set to 1)

Return value

Distance to the far clipping plane.

void setDynamic (int dynamic)

Sets the value indicating if reflections are dynamic (the cubemap is generated dynamically).

Arguments

  • int dynamic - 1 to enable dynamic reflections; 0 to use a reflection cubemap.

int setImageTextureImage (const Ptr<Image> & image, int dynamic = 0)

Sets the given image as the cube texture of the environment probe. If you need to set the cube texture for all environment probes in the scene, set the dynamic flag to 1.

Arguments

  • const Ptr<Image> & image - Cube texture to set.
  • int dynamic - Dynamic texture flag:
    • If set to 0, changing the cube texture of the current environment probe will also affect all environment probes in the scene.
    • If set to 1, a cube texture will be successfully set only for the current environment probe.

Return value

1 if the cube texture is set successfully; otherwise, 0.

int getReflectionMask ()

Returns the mask that specifies materials to reflect.
Notice
The reflection mask can be specified only for dynamic reflections (when the Dynamic flag is set to 1).

Return value

The reflection mask (integer, each bit of which is used to represent a mask).

void setImageTexture (const Ptr<Texture> & texture)

Arguments

  • const Ptr<Texture> & texture

int isDynamic ()

Returns the value indicating if reflections are dynamic (the cubemap is generated dynamically).

Return value

1 if dynamic reflections are used; 0 if a reflection cubemap is used.

Ptr<Texture> getImageTexture ()

Return value

int getResolution ()

Returns the current resolution of the reflection mask in pixels (available only when the Dynamic flag is set to 1).

Return value

Resolution of the reflection mask in pixels.

void setZFar (float zfar)

Sets the distance to the far clipping plane for image grabbing (available only when the Dynamic flag is set to 1).

Arguments

  • float zfar - Distance to the far clipping plane.

void setReflectionMask (int mask)

Sets a mask that specifies materials to reflect.
Notice
The reflection mask can be specified only for dynamic reflections (when the Dynamic flag is set to 1).

Arguments

  • int mask - Reflection mask (integer, each bit of which is used to represent a mask).

Math::vec3 getAttenuationDistance ()

Returns the distance from the light source shape, at which the light source doesn't illuminate anything.

Return value

Distance from the light source shape, at which the light source doesn't illuminate anything.

void setResolution (int resolution)

Sets the resolution of the reflection mask in pixels (available only when the Dynamic flag is set to 1).

Arguments

  • int resolution - Resolution of the reflection mask in pixels.

int getReflectionUpdate ()

Returns the current update interval set for the cube texture used for dynamic reflections.

Return value

Update interval for the dynamic cube texture. The available values are:
  • 1 - refresh only one face each frame.
  • 2 - refresh 2 faces each frame.
  • 3 - refresh 3 faces each frame.
  • 4 - refresh 4 faces each frame.
  • 5 - refresh 5 faces each frame.
  • 6 - refresh 6 faces each frame.

void setAttenuationDistance (const Math::vec3 & distance)

Sets the distance from the light source shape, at which the light source doesn't illuminate anything.

Arguments

  • const Math::vec3 & distance - Distance from the light source shape, at which the light source doesn't illuminate anything.

void setReflectionUpdate (int update)

Sets the update interval for the cube texture used for dynamic reflections.

Arguments

  • int update - Update interval for the dynamic cube texture. The available values are:
    • 1 - refresh only one face each frame.
    • 2 - refresh 2 faces each frame.
    • 3 - refresh 3 faces each frame.
    • 4 - refresh 4 faces each frame.
    • 5 - refresh 5 faces each frame.
    • 6 - refresh 6 faces each frame.

void setImageTextureName (const char * name)

Sets a path to a cube texture.

Arguments

  • const char * name - Path to a cube texture.

void setZNear (float znear)

Sets the distance to the near clipping plane for image grabbing (available only when the Dynamic flag is set to 1).

Arguments

  • float znear - Distance to the near clipping plane.

float getZNear ()

Returns the distance to the near clipping plane used for image grabbing (available only when the Dynamic flag is set to 1)

Return value

Distance to the near clipping plane.
Last update: 2017-07-03