Bake Lighting Tool
Bake Lighting is a tool for baking indirect lighting from light sources in static mode. It is used to:
- Calculate static voxel lighting inside Voxel Probes and put it into generated 3D lighting maps.
- Calculate reflection cubemaps for Environment Probes in static mode.
Bake Lighting tool provides a great way to improve the lighting in your scene by allowing dropping the most of lighting computations to maintain high performance at run time.
See Also
- Also light baking is available from the code by using the BakeLighting Class.
- Video Tutorial: Global Illumination.
Light Baking
Light Baking is the way of precomputing and storing data that describes how the light rays bounce around static geometry causing indirect lighting. Including indirect lighting in modelling helps to significantly improve the realistic look of your worlds.
The following comparison shows the use of different lighting in the scene containing two light sources: a red OmniLight and a WorldLight (with the Sun Shafts camera effect enabled). The left image contains the scene illuminated with direct light only, so unlit areas appear as silhouettes, the large number of details is hidden in darkness.
The right image shows the scene with both direct and indirect light which makes it look way more realistic and connected.
The computation of indirect lighting is a very expensive task for 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.
Workflow
In terms of UNIGINE light baking is available if there is at least one voxel or non-dynamic environment probe in the scene. To get the lighting baked, perform the following steps:
-
Prepare the scene: set up lighting and emissive geometry, choose the lights baking mode, hide or exclude unnecessary and dynamic objects from calculations via masking.
-
Create and place voxel probes at the places where the lighting remains relatively static (e.g. interiors, outdoor buildings and stationary objects).
Place voxel probes inside other ones to create insets defining the areas that require higher detail. Note, that voxel probes with additive blending mode enabled cannot be used for this purpose, as they are blended instead of replacing each other. -
Create non-dynamic environment probes and cover the areas which require appropriate reflections on reflective materials.
Disable the Grab by Bake Lighting parameter for ones, cubemap texture of which should not be modified by the Bake Lighting tool. This is applicable for cases when you do not want to modify your assets and going to generate new ones. - Adjust the Baking Settings of probes and the settings of the Bake Lighting tool.
-
Click Start to begin light baking and wait for the process to complete.
On this stage the Bake Lighting tool performs the following:
- For each enabled Environment Probe a cubemap is grabbed from the center point of the probe depending on its parameters.
- For each enabled Voxel Probe a cycle over all the voxels is performed in order to grab a lighting from 6 faces of a voxel and append it to the resulting 3D lighting map.
You can stop the process any time, the achieved result will be maintained. -
Enable post and camera effects.
Bake Lighting Settings
Bake Lighting Settings
Number of Bounces | Number of light ray bounces. |
---|---|
Voxel Size Multiplier | Multiplier for the Voxel Size parameter for each voxel probe. |
Voxels per Frame | Number of voxels computed and visualized per single frame. The parameter is available for changing during the light baking process. Higher values cause longer user interface response but accelerate the calculations. |
Progress Bars
Light Probe | Progress of light baking for the current probe at the moment. |
---|---|
Bounce | Progress of calculating current bounce. |
Overall | Overall progress of light baking for all the voxel and environment probes in the scene. |
Buttons
Bake selected probes | Starts light baking for selected environment and voxel probes regardless of whether they are enabled or not. |
---|---|
Bake/Stop | Starts light baking for all enabled environment and voxel probes in the scene. |
Baking Modes of Light Sources
All dynamic light sources (Omni, Proj, World) have the Mode parameter defining their contribution in the light baking process.
There are three modes on which the resulting image depends:
-
Realtime. The light source provides direct realtime lighting only. It is turned off while light baking is being calculated, that is why the scene remains unlit when the light is disabled after light baking.
Realtime mode. The light source is enabled.Realtime mode. The light source is disabled.
-
Mixed. The light source contributes to light baking and remains enabled all the time providing direct realtime lighting while the indirect light is being baked. This option can cause a lack of physical accuracy registered by the eye.
Mixed mode. The light source is enabled.Mixed mode. The light source is disabled.
-
Baked. The light source is turned off at run time and enabled for light baking only. This mode is available only for Omni-directional light sources.
Baked mode. The light source is enabled.Baked mode. The light source is disabled.