This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Landscape Tool
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
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
创建内容
内容优化
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::LightEnvironmentProbe Class

Header: #include <UnigineLights.h>
Inherits from: Light

This class allows creating and managing environment probes.

LightEnvironmentProbe Class

Members


static LightEnvironmentProbePtr create ( 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.

void setAmbientEnabled ( bool enabled ) #

Enables or disables ambient lighting for the environment probe.

Arguments

  • bool enabled - true to enable ambient lighting for the environment probe; false to disable it.

bool isAmbientEnabled ( ) const#

Returns a value indicating if ambient lighting for the environment probe is enabled.

Return value

true if ambient lighting for the environment probe is enabled; otherwise, false.

void setAmbientContrast ( float contrast ) #

Sets the ambient contrast value for the environment probe.

Arguments

  • float contrast - Ambient contrast value within the [0.0f, 1.0f] range. The default value is 1.0f.

float getAmbientContrast ( ) const#

Returns the current ambient contrast value for the environment probe.

Return value

Ambient contrast value.

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.

Math::vec3 getAttenuationDistance ( ) const#

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 setBoxGI ( float boxgi ) #

Sets the current GI factor for box projection.
Notice
Available only when the Box projection flag is set to 1.

Arguments

  • float boxgi - GI factor.

float getBoxGI ( ) const#

Returns the current GI factor for box projection.
Notice
Available only when the Box projection flag is set to 1.

Return value

GI factor.

void setBoxGlossCorners ( float corners ) #

Sets the coefficient that controls glossiness of reflections in the corners of box projection.
Notice
Available only when the Box projection flag is set to 1.

Arguments

  • float corners - New value of the glossiness coefficient for reflections in the corners of box projection. The default value is true.

float getBoxGlossCorners ( ) const#

Returns the current value of the coefficient that controls glossiness of reflections in the corners of box projection.
Notice
Available only when the Box projection flag is set to 1.

Return value

Current value of the glossiness coefficient for reflections in the corners of box projection. The default value is 1.

void setGrabByBakeLighting ( bool lighting ) #

Sets a value indicating whether the cubemap texture is to be modified by the Bake Lighting Tool.

Arguments

  • bool lighting - true to enable grabbing the cubemap texture with the Bake Lighting Tool; false - to disable it.

bool isGrabByBakeLighting ( ) const#

Returns a value indicating whether the cubemap texture is to be modified by the Bake Lighting Tool.

Return value

true if the cubemap texture will be modified by the Bake Lighting Tool; otherwise, false.

void setBoxProjection ( bool projection ) #

Enables or disables box projection for the environment probe.

Arguments

  • bool projection - true to enable box projection for the environment probe, false to disable it. The default value is false.

bool isBoxProjection ( ) const#

Returns a value indicating if box projection is enabled for the environment probe.

Return value

true if box projection is enabled for the environment probe; otherwise, false.

void setBoxSize ( const Math::vec3 & size ) #

Sets the box size for the environment probe (available only when the Box projection flag is set to true).

Arguments

  • const Math::vec3 & size - Box size along X, Y and Z axes.

Math::vec3 getBoxSize ( ) const#

Returns the current box size for the environment probe (available only when the Box projection flag is set to true).

Return value

Box size along X, Y and Z axes.

void setDynamic ( bool dynamic ) #

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

Arguments

  • bool dynamic - true to enable dynamic reflections; false to use a reflection cubemap.

bool isDynamic ( ) const#

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

Return value

true if dynamic reflections are used; false if a reflection cubemap is used.

void setTexture ( const Ptr<Texture> & texture ) #

Sets the given texture 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 true.

Arguments

  • const Ptr<Texture> & texture - Cube texture to set.

Ptr<Texture> getTexture ( ) const#

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

Return value

Texture to which the cube texture is saved.

int setTextureImage ( const Ptr<Image> & image, bool 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.
  • bool dynamic - Dynamic texture flag:
    • If set to false, changing the cube texture of the current environment probe will also affect all environment probes in the scene.
    • If set to true, 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 getTextureImage ( const Ptr<Image> & image ) const#

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.

void setTexturePath ( const char * path ) #

Sets a path to a cube texture.

Arguments

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

const char * getTexturePath ( ) const#

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

Return value

Path to the cube texture.

void setLocalSpace ( bool space ) #

Enables local space (local coordinates) for the environment probe. Can be used for scenes with moving objects.

Arguments

  • bool space - true to enable local space; otherwise, false.

bool isLocalSpace ( ) const#

Returns a value indicating if local space is enabled for the environment probe.

Return value

true to enable local space; otherwise, false.

void setReflectionViewportMask ( int mask ) #

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

Arguments

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

int getReflectionViewportMask ( ) const#

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

Return value

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

void setParallax ( float parallax ) #

Sets parallax correction value for reflection cubemaps projected by the environment probe. By the minimum value of 0 reflection cubemaps are simply projected onto objects, and do not follow the viewer's perspective. This causes an unrealistic-looking reflection for most surfaces. Parallax correction enables to take camera's position into account.
Notice
Parallax correction is not available for reflections on transparent objects.

Arguments

  • float parallax - Parallax correction value to be set for reflection cubemaps projected by the environment probe in the range [0;1]:
    • By the minimum value of 0 parallax correction is disabled (reflections will look like objects are infinitely distant).
    • By the maximum value of 1 parallax correction is enabled (reflections will look like objects are at the distance close to the radius of the environment probe).
    • Values in-between represent a linear interpolation factor for parallax correction and are to be set when the environment probe is used to fit a medium or small object into the environment for additional correction.

float getParallax ( ) const#

Returns the current parallax correction value for reflection cubemaps projected by the environment probe. By the minimum value of 0 reflection cubemaps are simply projected onto objects, and do not follow the viewer's perspective. This causes an unrealistic-looking reflection for most surfaces. Parallax correction enables to take camera's position into account.
Notice
Parallax correction is not available for reflections on transparent objects.

Return value

Current parallax correction value for reflection cubemaps projected by the environment probe in the range [0;1].
  • By the minimum value of 0 parallax correction is disabled (reflections will look like objects are infinitely distant).
  • By the maximum value of 1 parallax correction is enabled (reflections will look like objects are at the distance close to the radius of the environment probe).
  • Values in-between represent a linear interpolation factor for parallax correction and are to be set when the environment probe is used to fit a medium or small object into the environment for additional correction.

void setRenderFacesPerFrame ( int frame ) #

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

Arguments

  • int frame - 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 getRenderFacesPerFrame ( ) const#

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 setResolution ( int resolution ) #

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

Arguments

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

int getResolution ( ) const#

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

Return value

Resolution of the reflection mask in pixels.

void setSkyCutout ( bool cutout ) #

Enables or disables sky cutout for image grabbing (available only when the Dynamic flag is set to 0).

Arguments

  • bool cutout - true to enable sky cutout, false to disable it. The default value is false.

bool isSkyCutout ( ) const#

Returns a value indicating if sky cutout for image grabbing is enabled (available only when the Dynamic flag is set to 0).

Return value

true if sky cutout for image grabbing is enabled; otherwise, false.

void setUseSunColor ( bool color ) #

Enables or disables sun color modulation for the environment probe (the light of the environment probe changes as the sun color changes). This parameter can be used for outdoor-baked environment probes.

Arguments

  • bool color - true to enable sun color modulation for the environment probe, false to disable it. The default value is false.

bool isUseSunColor ( ) const#

Returns a value indicating if sun color modulation for the environment probe is enabled. This parameter can be used for outdoor-baked environment probes.

Return value

true if sun color modulation for the environment probe is enabled; otherwise, false.

void setSupersampling ( int supersampling ) #

Enables or disables supersampling for image grabbing (available only when the Dynamic flag is set to 0).

Arguments

  • int supersampling - true to enable supersampling, false to disable it. The default value is false.

int getSupersampling ( ) const#

Returns a value indicating if supersampling for image grabbing is enabled (available only when the Dynamic flag is set to 0).

Return value

true if supersampling for image grabbing is enabled; otherwise, false.

void setZFar ( float zfar ) #

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

Arguments

  • float zfar - Distance to the far clipping plane.

float getZFar ( ) const#

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

Return value

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

Arguments

  • float znear - Distance to the near clipping plane.

float getZNear ( ) const#

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

Return value

Distance to the near clipping plane.

static int type ( ) #

Returns the type of the node.

Return value

LightEnvironmentProbe type identifier.

void setCutoutByShadow ( bool shadow ) #

Returns a value indicating if reflections occluded by obstacles should be clipped or not. This feature uses the depth texture grabbed for the environment probe to determine reflections that should be visible.

Arguments

  • bool shadow - true to enable clipping of reflections occluded by obstacles, false to disable it. The default value is false.

bool isCutoutByShadow ( ) const#

Returns a value indicating if clipping of reflections occluded by obstacles is enabled. This feature uses the depth texture grabbed for the environment probe to determine reflections that should be visible.

Return value

true if clipping of reflections occluded by obstacles is enabled; otherwise, false.

void setAdditiveBlending ( bool blending ) #

Enables or disables additive blending mode for the environment probe. This option offers more flexibility in reflections control. You can use it to blend reflections of several environment probes together and control them separately .

Arguments

  • bool blending - true to enable additive blending mode for the environment probe, false to disable it. The default value is false.

bool isAdditiveBlending ( ) const#

Returns a value indicating if additive blending is enabled for the environment probe. This option offers more flexibility in reflections control. You can use it to blend reflections of several environment probes together and control them separately.

Return value

true if additive blending mode is enabled for the environment probe; otherwise, false.

void setDynamicCorrectRoughness ( Render::CORRECT_ROUGHNESS roughness ) #

Enables one of correction modes for dynamic environment reflections on rough surfaces or disables correction. Correction modes differ in the number of rays used to create a reflection on a rough surface.

Arguments

Render::CORRECT_ROUGHNESS getDynamicCorrectRoughness ( ) const#

Returns the value indicating the correction mode set for dynamic environment reflections on rough surfaces. Correction modes differ in the number of rays used to create a reflection on a rough surface.

Return value

One of the CORRECT_ROUGHNESS_* modes.

void setBakeMipmapsQuality ( float quality ) #

Sets the mipmaps quality of the environment probe for light baking.

Arguments

  • float quality - Mipmaps quality in the [0.0f; 1.0f] range.

float getBakeMipmapsQuality ( ) const#

Returns the mipmaps quality of the environment probe for light baking.

Return value

Mipmaps quality.

void setBakeVisibilityEmission ( bool emission ) #

Enables or disables baking of emission light sources to the environment probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make environment probes independent of each other and combine them to produce some sort of dynamic GI effect.

Arguments

  • bool emission - 1 to enable baking of emission light sources to the environment probe; 0 to disable it.

bool isBakeVisibilityEmission ( ) const#

Returns a value indicating if emission light sources are to be baked to the environment probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make environment probes independent of each other and combine them to produce some sort of dynamic GI effect.

Return value

1 if emission light sources are to be baked to the environment probe; otherwise, 0.

void setBakeVisibilitySky ( bool sky ) #

Enables or disables baking of lighting from the sky to the environment probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make environment probes independent of each other and combine them to produce some sort of dynamic GI effect.

Arguments

  • bool sky - 1 to enable baking of lighting from the sky to the environment probe; 0 to disable it.

bool isBakeVisibilitySky ( ) const#

Returns a value indicating if lighting from the sky is to be baked to the environment probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make environment probes independent of each other and combine them to produce some sort of dynamic GI effect.

Return value

1 if lighting from the sky is to be baked to the environment probe; otherwise, 0.

void setBakeVisibilityLightWorld ( bool world ) #

Enables or disables baking of world light sources to the environment probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make environment probes independent of each other and combine them to produce some sort of dynamic GI effect.

Arguments

  • bool world - 1 to enable baking of world light sources to the environment probe; 0 to disable it.

bool isBakeVisibilityLightWorld ( ) const#

Returns a value indicating if world light sources are to be baked to the environment probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make environment probes independent of each other and combine them to produce some sort of dynamic GI effect.

Return value

1 if world light sources are to be baked to the environment probe; otherwise, 0.

void setBakeVisibilityLightOmni ( bool omni ) #

Enables or disables baking of omni light sources to the environment probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make environment probes independent of each other and combine them to produce some sort of dynamic GI effect.

Arguments

  • bool omni - 1 to enable baking of omni light sources to the environment probe; 0 to disable it.

bool isBakeVisibilityLightOmni ( ) const#

Returns a value indicating if omni light sources are to be baked to the environment probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make environment probes independent of each other and combine them to produce some sort of dynamic GI effect.

Return value

1 if omni light sources are to be baked to the environment probe; otherwise, 0.

void setBakeVisibilityLightProj ( bool proj ) #

Enables or disables baking of projected light sources to the environment probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make environment probes independent of each other and combine them to produce some sort of dynamic GI effect.

Arguments

  • bool proj - 1 to enable baking of projected light sources to the environment probe; 0 to disable it.

bool isBakeVisibilityLightProj ( ) const#

Returns a value indicating if projected light sources are to be baked to the environment probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make environment probes independent of each other and combine them to produce some sort of dynamic GI effect.

Return value

1 if the projected light sources are to be baked to the environment probe; otherwise, 0.

void setBakeVisibilityVoxelProbe ( bool probe ) #

Enables or disables baking of voxel probe light sources to the environment probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make environment probes independent of each other and combine them to produce some sort of dynamic GI effect.

Arguments

  • bool probe - 1 to enable baking of voxel probe light sources to the environment probe; 0 to disable it.

bool isBakeVisibilityVoxelProbe ( ) const#

Returns a value indicating if voxel probe light sources are to be baked to the environment probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make environment probes independent of each other and combine them to produce some sort of dynamic GI effect.

Return value

1 if voxel probe light sources are to be baked to the environment probe; otherwise, 0.

void setBakeVisibilityEnvironmentProbe ( int probe ) #

Enables or disables baking of environment probe light sources to the voxel probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make voxel probes independent of each other and combine them to produce some sort of dynamic GI effect.

Arguments

  • int probe - true to enable baking of environment probe light sources to the voxel probe; false to disable it.

int isBakeVisibilityEnvironmentProbe ( ) const#

Returns a value indicating if environment probe light sources are to be baked to the voxel probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make voxel probes independent of each other and combine them to produce some sort of dynamic GI effect.

Return value

true if environment probe light sources are to be baked to the voxel probe; otherwise, false.

void setBakeVisibilityLightmap ( bool lightmap ) #

Enables or disables baking of lightmapped surfaces to the environment probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make environment probes independent of each other and combine them to produce some sort of dynamic GI effect.

Arguments

  • bool lightmap - 1 to enable baking of lightmapped surfaces to the environment probe; 0 to disable it.

bool isBakeVisibilityLightmap ( ) const#

Returns a value indicating if lightmapped surfaces are to be baked to the environment probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make environment probes independent of each other and combine them to produce some sort of dynamic GI effect.

Return value

1 if lightmapped surfaces are to be baked to the environment probe; otherwise, 0.
Last update: 2022-03-10
Build: ()