This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1
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.

LightEnvironmentProbe Class

LightEnvironmentProbe Class

This class inherits from Light

Members


LightEnvironmentProbe (vec4 color, vec3 radius, string texture = 0)

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

Arguments

  • vec4 color - Color of the environment probe.
  • vec3 radius - Radii of the environment probe.
  • string texture - Path to a cube texture of the environment probe.

int getImageTextureImage (Image image)

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

Arguments

  • Image image - Image into which the texture is saved.

Return value

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

string getImageTextureName ()

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

Return value

Path to the cube texture.

vec3 getRadius ()

Returns the radius of the environment probe.

Return value

Radius of the environment probe.

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).

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.

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.

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.

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.

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.

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 (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

  • 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.

void setImageTextureName (string name)

Sets a path to a cube texture.

Arguments

  • string name - Path to a cube texture.

void setRadius (vec3 radius)

Sets the radius of the environment probe.

Arguments

  • vec3 radius - Radius of the environment probe.

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).

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 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.

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 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.
Last update: 2017-07-03
Build: ()