Programming
Fundamentals
Setting Up Development Environment
Usage Examples
UnigineScript
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and 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
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
CIGI Client Plugin
Rendering-Related Classes

Environment Probe

Environment Probe is a light source which also provides reflections on an object inside the probe by using a cubemap (pre-baked or dynamically changing each frame). In Unigine, Environment Probes have two types of projections:

  • Box projection - works better for indoor scenes (when the room has a 3D box shape) or box-shaped outdoor scenes (back alley between buildings).
  • Spherical projection - works better for all other cases (reflections on car, spherical room, etc.).

With Environment Probes you can create reflections instead of creating reflection materials.

See Also

Overview

Environment Probe is a great thing to increase performance, decrease the number of materials and make the life of content designers easier.

Environment probes use cubemaps that were baked (or grabbed with a special tool). This cubemap will play the role of the reflection and the light simulation. Here is an example:

We have two houses with different color of the interior and put same objects (with reflection material, for example, metal) into these houses. What will happen?

If we don't speak about the dynamic reflections, you'll need to reflect the interior on each object. But interiors have different ambient color, and that is why you'll need to create 2 different materials for them. Not optimized at all.

Environment probes remove this flaw. Once you added an object, you don't think about the reflection material for it. The environment probe will map the cubemap to the object.

There is a difference in mapping cubemaps to transparent and non-transparent objects:

  • If an object is transparent, the environment probe will map the cubemap only if the entire object is inside the radius of the environment probe. Otherwise, the object won't be affected by the environment probe at all.
  • If an object is non-transparent, the environment probe will map the cubemap to any part of the object which is inside the radius of the probe.
Transparent object illuminated by environment probe
Non-transparent object illuminated by environment probe

If you put several environment probes that illuminate a non-transparent object (rendered in the deferred pass) their cubemaps will be blended smoothly. Here is an example, a long corridor which has walls painted in different colors.

We put two environment probes and both of them affect the object (when the object will be in the intercrossing area). When you have large locations, you should use several environment probes instead of one to make the final image more realistic.

The SSR (Screen Space Reflections) effect makes the final image more realistic, because it appends reflections that cannot be baked into cubemaps. Using environment probes and SSR is a great method for pretty fast imitation of reflections with dynamic lighting.

Multiple Environment Probes for Transparent Objects

The Multiple Environment Probes option set for a transparent object (rendered in the forward pass) allows several environment probes illuminate the object and map their cubemaps to it.

  • When the option is disabled, only the last set environment probe will illuminate the object. At that the entire object must be inside the radius of the environment probe. Otherwise, it won't be affected by the enviroment probe at all.
  • When the option is enabled, the object will be lit by all of the environment probes: each probe will affect the part of the object, which is inside the probe. Cubemaps of the environment probes will be blended in the intercrossing areas.
Multiple Environment Probes is off: only the left cubemap is mapped to the object
Multiple Environment Probes is on: both cubemaps are mapped and blended

Adding Environment Probe

To add an Environment Probe object to the scene via UnigineEditor, do the following:

  1. Run UnigineEditor.
  2. On the Menu bar, click Create -> Light -> Environment Probe.

  3. Place the environment probe.
  4. Grab the cubemap texture for the environment probe. You can grab it in the Light tab of the Environment Probe's node or you can grab it by using Grabber.
    Notice
    To bake lighting to the environment probe properly the following sequence of actions is recommended:
    1. Set light color to black and click Grab. Thus, you'll get the first GI bounce.
    2. Set light color back to white and click Grab againg. Thus, you'll get the second GI bounce.
    Setting black color first, helps to hide ambient lighting and reflections from the global environment at the moment of baking.
  5. Adjust the environment probe settings.
Notice
You can't bake "real" lights (LightOmni, LightProj, etc.) to an environment probe. Maximum you can do here, is place spheres with emission materials instead of lights, adjust emission intensity and then bake lighting. However, the result will look worse than you'd have with real lights.

Environment Probe Settings

Here is a set of environment probe settings.

Common Parameters

Light Sets the shadow mask.
Viewport Sets the viewport mask for the light.
Color Sets the light color in the RGBA format. The color defines both the plausibility of virtual representation and its aesthetic component.
Intensity Sets the light color multiplier, which provides fine control over color intensity of the emitted light:
  • The minimum value of 1 corresponds to the least saturated light color.
  • The maximum value of 100 equals the most bright and intense color.
Sun light color Enables the influence of sun light color on the environment probe.
Notice
When enabled, this option makes the environment probe color black at night, or orange at sunset.
Box projection Enables box projection mode of Environment Probe.

Reflection Parameters

Intensity Sets the intensity of environment probe's reflection. 0 value means no reflection.
Notice
This parameter is used for manual adjustment in case if resulting intensity is too high or insufficient.
Color Sets the color of the reflection.

Ambient Parameters

Intensity Sets the intensity of ambient lighting.
Notice
This parameter is used for manual adjustment in case if resulting intensity is too high or insufficient.
Color Sets the color of ambient lighting.

Box Projection Parameters

Size Specifies the size of the box projection.
Gloss corners Sets the intensity of the gloss near the box projection corners.
Global illumination Enables the global illumination simulation. Environment probe generates fake GI by using given cubemap.

Attenuation Parameters

Attenuation power Sets the attenuation power of the light.
Attenuation distance Sets the attenuation distance for the light.

Grab Texture Parameters

Notice
Re-grab the cubemap texture, when you make changes to these parameters
Resolution Sets the resolution of the reflection in pixels.
Notice
Setting too high resolution on a low-performance GPU with low memory capacity may cause engine crash.
Near clipping Sets distance to near clipping plane for image grabbing.
Notice
Recommended value for rooms is 0.01.
Far clipping Sets distance to far clipping plane for image grabbing.
Notice
Recommended value for rooms is 1000.
Sky cutout Cuts out sky rendering in the environment probe and renders dynamic reflection instead of the sky.
Notice
This parameter can be used to render changes of the sky gradient in a window, when the time of the day changes.
Dynamic Specifies if the reflection is dynamic.
Notice
The Dynamic Reflections option should be enabled: Rendering -> Features -> Dynamic Reflections.

Update Specifies the cubemap update interval.
  • 1 - Refresh only one face every frame.
  • 2 - Refresh two faces every frame.
  • 3 - Refresh three faces every frame.
  • 4 - Refresh four faces every frame.
  • 5 - Refresh five faces every frame.
  • 6 - Refresh all six faces every frame.
Reflection mask Specifies a mask that specifies materials to reflect.
Local space Sets local space (local coordinates) for environment probes. Can be used for scenes with moving objects.
Notice
It is recommended to use this parameter, if you plan to rotate the environment probe after baking.
Mipmaps quality Set the quality of mipmaps.
Notice
Setting too quality on a low-performance GPU with low memory capacity may cause engine crash.
Texture Sets the cubemap texture for reflection.

Render Parameters

Water Renders the environment probes on water.
Transparent Renders the environment probes on transparent object.
Last update: 2017-12-21