Bake Lighting Window
Bake Lighting is a tool that incorporates all light baking tasks. It is used for the following operations:
- Calculate and bake global illumination into lightmaps assigned to surfaces.
- Calculate static voxel-based GI and put it into generated voxel lighting maps.
- Calculate reflection cubemaps and cutout depth textures for Environment Probes in static mode.
- Calculate shadow maps for light sources in static mode.
The Bake Lighting tool enables you to improve performance by dropping the most of light and shadow computations.
To open the Bake Lighting window, choose Tools -> Bake Lighting in the Menu Bar or click the gear icon in the upper-right corner of the UnigineEditor.
To learn how to use the tool, watch this video tutorial.
To learn how to use the tool, watch this video tutorial.
Bake Lighting Tool
See Also#
- Light baking is available via code by using the BakeLighting Class.
- Video Tutorial: Global Illumination.
Workflow#
Basically, light baking is available if there is at least one of the following entities is in the scene:
- Voxel Probe
- Environment Probe in Static mode with Grab by Bake Lighting enabled.
- Mesh Static with at least one surface that has Lightmaps enabled and the Bake Unique Texture mode selected.
- Light source in Static mode.
To get the lighting baked, perform the following steps:
- Prepare the scene: set up lighting and emissive geometry, select the Light Baking Mode and Lighting Modes for surfaces, hide or exclude unnecessary and dynamic objects from calculations via masking and/or adjusting surface flags, enable Lightmaps and select the Lightmaps Mode for surfaces of Mesh Static objects intended to be lightmapped.
- Create and place voxel probes at the places where the lighting remains relatively static (e.g. interiors, outdoor buildings, and immovable objects). Select Half or Full Bake Internal Volume mode for voxel probes to illuminate dynamic objects that move within their volume.
Place voxel probes inside other voxel probes to create insets defining the areas that require higher detail. Note that voxel probes with the 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 probes, the 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. - Adjust the Baking Settings of probes and the settings of the Bake Lighting tool.
- Click Bake to begin light baking for all enabled objects and light sources (or Bake selected lights to affect only selected objects and light sources) and wait for the process to complete. You can also click Bake All Lighting in the right corner of the top toolbar.
At this stage, the Bake Lighting tool performs the following:
- For each enabled Omni and Projected light source in the Static mode the shadow map is grabbed and saved in the Depth Texture asset.
- For each enabled World light source in the Static Shadow Cascade mode the shadow map is grabbed and saved in the Depth Texture asset.
- For each Mesh Static surface with Lightmaps enabled and Bake Unique Texture mode selected, lighting is baked into a lightmap texture.
- For each enabled Environment Probe, a cubemap is grabbed from the center point of the probe depending on its parameters. If the environment probe has the Cutout By Shadow option enabled, a depth texture is grabbed for the probe as well.
- For each enabled Voxel Probe, a cycle over all the voxels is performed in order to grab lighting from 6 faces of a voxel and append it to the resulting 3D lighting map.
All generated textures will be saved to the bake_lighting folder of your data project's folder.
You can stop the process at any moment and you will be prompted to keep the achieved result or restore the previous textures. - Enable post and camera effects.
Bake Lighting Settings#
Bake Static Shadows For Lights#
Bake Static Shadows For Lights | Enable baking of cached shadows for static light sources. |
---|---|
Automatic Rebake | Enable auto-rebake of shadows on transforming a static light source or changing its parameters. |
Bake Lightmaps For Surfaces#
Bake Lightmaps For Surfaces | Enable baking of lightmaps for surfaces. |
---|---|
Baking Viewport Masks | For the light or surface to contribute to static GI, their viewport masks should match the Baking Viewport Mask. |
Quality | Baking quality preset. |
Far Clipping | Far clipping distance for light rays. |
Bake Voxel Probes#
Bake Voxel Probes | Enable baking of voxel-based GI to voxel probes. |
---|---|
Voxel Size Multiplier | Multiplier for the Voxel Size parameter for each voxel probe. |
Bake Environment Probes#
Bake Environment Probes | Enable baking of reflection cubemaps to environment probes. |
---|---|
Automatic Rebake | Enable auto-rebake of the cubemap of an Environment Probe on transforming it or changing its parameters. |
Common Settings#
Number of Bounces | Number of light ray bounces. |
---|---|
Samples per Frame | Number of sampling units processed and visualized simultaneously each frame (samples for lightmaps and voxels for Voxel Probes):
The parameter is available for changing during the baking process. Higher values cause longer user interface response but accelerate the calculations. |
Buttons#
Bake Selected | Starts baking for the selected static lights, probes and lightmapped surfaces regardless of whether they are enabled or not. |
---|---|
Bake/Stop | Starts baking for all enabled static lights, probes and lightmapped surfaces in the scene. |
Progress Bars#
The following progress bars are shown in the viewport during the process of light baking:
Node/Surface | Progress of light baking for the current node/surface at the moment. |
---|---|
Bounce | Progress of calculating the current bounce. |
Overall | Overall progress of light baking for all nodes in the scene. |
Video Tutorial#
Watch the video below to learn how to work with the Bake Lighting tool.
Last update:
2024-08-16
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)