Global Illumination
Global Illumination (GI) is a set of techniques intended to simulate realistic light propagation in a virtual environment.
The following comparison shows the use of global illumination in a scene with two light sources: a red Omni Light and a World Light.
The left image shows the scene illuminated with direct light only, so that we see only silhouettes of unlit objects and a large number of details is hidden in the darkness.
The right image shows the scene with both direct and indirect light, which makes it look way more realistic and consistent.
UNIGINE provides both realtime and precomputed solutions for GI simulation.
See Also#
Static GI#
Static Global Illumination is mainly applicable to static unchanging environments and implies baking of lighting in order to drop expensive calculations and keep the performance high.
Light Baking#
The computation of indirect lighting is a very expensive task for the processing unit, so it is usually performed once at the development stage (lighting is baked) and the results are used later for static lighting at run time.
Baking of lighting is the way of precomputing and storing data that describes how light rays bounce around static geometry causing indirect lighting. Adding indirect lighting to modelling helps significantly improve the realistic look of the scene.
The following approaches are available:
- Lightmapping.
- Voxel-based GI.
- Using Environment Probes.
You can combine these techniques to achieve the best results.
Having configured the light sources and objects, you can start light baking by pressing the corresponding button on the top toolbar. Click the gear icon to open the Bake Lighting window.
The Bake Lighting window provides the interface to light baking settings in UnigineEditor.
Modes of Light Sources#
Omni, Projected, and World light sources have the Mode parameter that defines their contribution to the light baking process and determines if shadows are to be baked.
The following modes are available:
-
Dynamic. The light source provides direct realtime lighting only. It is considered disabled while light baking is being calculated, that is why the scene remains unlit when the light is turned off after light baking. No shadows are baked.
Dynamic light source enabled. No GI is baked.Dynamic light source disabled.
-
Static. The light source contributes to light baking and remains enabled all the time providing direct realtime lighting while the indirect light is being baked. When lighting is baked, such light sources are not to be moved and modified. Changing them can make lighting inconsistent and require re-baking. Shadows for Omni, Proj, and World lights are baked.
Static light source enabled.Static light source disabled. Indirect light is baked into a Voxel Probe.
Lighting Modes#
Use the Lighting Mode parameter to define how a surface contributes to lighting. The following modes are available:
-
The Static mode is optimized for use in static global illumination, reflections and shadows.
Surfaces in the Static lighting mode block and reflect light when baking lighting to Voxel Probes and lightmaps, visible for static reflections provided by Environment Probes and cast cached shadows, lightmapping is available for them. This option is best suitable for immovable objects of static environment.
-
The Dynamic mode excludes the surface from use in static lighting and is suitable for dynamic shadows. Use this option for dynamic objects.
- The Advanced mode enables manual adjustment of all lighting-related settings:
Combining Lightmaps with Probes#
Voxel probes and lightmaps serve for the same purpose — static baked global illumination. Each technique has its pros and cons:
- Lightmaps provide the best available lighting quality and applicable only to static meshes.
- The quality of lighting provided by voxel probes highly depends on the voxel size, higher values require much more video memory. However, a voxel probe has internal volume baked and enables to shade dynamic objects within its bounds.
Voxel and environment probes do not affect lightmapped surfaces, therefore you can freely combine global illumination provided by these techniques.
Realtime GI#
For scenes that have moving light sources and changing environment, baking of lighting is inappropriate. The following realtime approaches of GI simulation are provided in UNIGINE:
-
Ambient lighting from dynamic environment probes.
-
The SSRTGI (Screen-Space Ray-Traced Global Illumination) technology is a set of screen-space ray tracing techniques for GI simulation with the real-time performance level. It incorporates Screen-Space Ambient Occlusion, Screen-Space Global Illumination and Bent Normals features. The technology doesn't require light baking, so every object and light source can be freely moved.
-
The PSDGI (Panorama Space Dynamic Global Illumination) is an advanced high-quality dynamic GI technique that fits best for open-world scenes. You can think of it as Screen Space Global Illumination but for a 360-degree range. Lighting is calculated using physically-correct formulas (with emissive materials taken into account) ensuring that reflections as well as diffuse lighting will become much more realistic in comparison with traditional cubemap-based techniques. You can optionally use only diffuse lighting or only specular. For example, if you use lightmaps providing maximum diffuse lighting information, the Raymarching Environment Probe will improve the quality of reflections pushing it close to ray tracing in terms of quality.
You can put a probe somewhere in your world like you usually do, or you can attach it as a child to a camera. In Raymarching mode the Environment Probe is always rendered dynamically - it has no static pre-baked mode.