About the Bake Light and Shadows Module

Scene > Bake Light and Shadows

Use the Bake Light and Shadows module to set parameters for direct and indirect illumination, subdividing polygon meshes, and calculating ambient occlusion. This can improve the visual quality of OpenGL and raytracing precomputed renders.

Use baked lightmaps for storing a static rendered image of lighting that won't change. To edit the UV sets for a lightmap, use the UV Editor.

Bake Light and Shadows

Tip:

Another way to access the Bake Light and Shadows module is to right-click the empty space next to the Quick Access Bar and select it from the list.

The Bake Light and Shadows module has a menu bar, two tabs (Bake Settings and Advanced), and an icon bar at the bottom for quick access to commonly used tools.

File Menu

This menu contains options for loading, saving, and updating paths locations for lightmaps. Triplanar & Layout

Load Lightmaps

Loads all lightmaps without a bake calculation.

Using File > Load Lightmaps, select all files to load. The following is the behavior to expect:

Note:

If loading lightmaps via the Advanced GUI, it saves or loads the lightmaps via its controls. There is no removal of connected lightmaps or name updates.

Save Lightmaps

Saves all lightmaps used either to the scene file or an external location (if Save Texture As External Reference is enabled).

Saved lightmaps will be named as follows:

If files already exist at the export location with lightmaps of the same name:

Repath Lightmaps

Opens a set folder and looks for file names matching the lightmap names. If a file cannot be found, the Repath dialog appears for locating the file. The following is the behavior to expect:

Note:

If you have a missing non-inlined texture (you see a pink and black checkboard texture) and know where the missing file is located on disk, load the file, using the Bake Light and Shadows module > Advanced tab > Lightmap section > Texture controls. If many of the lightmap files are now in a different folder, try repathing these lightmaps all at once (if the new ones are all in the same folder), by selecting the geometries with the missing lightmaps, then in the Bake Light and Shadows module, select File menu > Repath Lightmaps.

Statistics

Opens the Lightmap Statistics dialog, providing stats on the number of nodes and total texture memory used by all nodes, as well as for only the selected nodes. Use this to get an overview of the texture memory size, as large numbers of baked lightmaps can negatively impact the performance of your scene.

Select Menu

This menu contains options for selecting specific groups of nodes in the Scene Graph. Use these to help identify nodes that have or have not been baked, have an active or non-active bake type, and/or align with the selected bake type.

Select Nodes With Bake

Selects all nodes that have either a vertex or texture bake, regardless of the active bake type.

Select Nodes Without Bake

Selects all nodes without a vertex or texture bake.

Select Nodes With Missing Bake

Selects all nodes of the selected bake type missing a bake, as well as unbaked nodes with Active Bake set to None. Use this to save time by only performing calculations on these nodes, instead of including nodes with a bake. Hidden nodes are not respected.

Tip:

The Calculate Missing button selects the same content; however, doesn't display it in the viewport.

Select Nodes With Texture Bake

Selects all nodes with an existing texture bake, regardless of what is set as the active bake type.

Select Nodes With Vertex Bake

Selects all nodes with an existing vertex bake, regardless of what is set as the active bake type.

Select Nodes With Texture And Vertex Bake

Selects all nodes with both an existing texture and vertex bake, regardless of what is set as the active bake type.

Select Nodes With Active Texture Bake

Selects all nodes with a texture bake set as the active bake type.

Select Nodes With Active Vertex Bake

Selects all nodes with a vertex bake set as the active bake type.

Settings Menu

This menu contains options for loading and saving lightmaps, as well as saving, editing, accessing bake presets.

Load from Node

Loads the lights and shadows from the selected node.

Save

Saves the current lights and shadows.

Save As

Creates a new preset, once changes are made to an existing one. The new preset appears at the bottom of the preset list with (Vertex) or (Texture) appended to its name. For example, if the current bake type is set to Texture and the preset is named, Bumper, it will appear as Bumper (Texture) in the Settings and Save Preset lists.

Save Preset dialog

Edit

Opens the Edit Presets dialog for activating, renaming, or deleting a preset. Right-click for these options. Activating a preset applies the bake light and shadows settings of that preset to the selected nodes.

Edit Presets

Preset List

Provides a list of presets for setting the indirect illumination quality level.

Note:

This can also be set using the Indirect Illumination Quality option.

The new preset appears at the bottom of the preset list with (Vertex) or (Texture) appended to its name. In the case, Medium Quality (Vertex), the preset would have a vertex bake type.

Bake Settings Tab

The Bake Settings tab contains parameters for configuring direct and indirect illumination, subdivisions, lightmap behavior, lightmap UV generation, as well as setting the bake type and finally calculating the bake.

General Section

Bake Type

Sets the type of baking performed. Choose whether the bake results are stored as a color for each vertex of the geometry or in a texture (called a lightmap) that's mapped onto the geometry with lightmap UVs. Both of these support the baking of ambient occlusion, shadows, and direct/indirect illumination; however; there are some differences.

Important:

Lightmap UVs are needed, so for complex or important objects in direct view, we recommend manually unwrapping UVs. To edit the UV sets for a lightmap, use the UV Editor.

One other advantage is that with texture bake type shadow maps, clones or reference objects can have different lightmaps. See Texture Baking for more information.

Note:

An XML file, BakePresets, is generated and used to store vertex and texture bake shadow presets. This hleps to avoid issues when adding or deleting presets.

  • Deleting the BakePresets file removes all non-default presets fron the preset list on your next launch.
  • If the BakePresets files doesn't exist in C:\Users\User\AppData\Roaming\VREDPro, VRED will generate one.
  • If a copy of BakePresets is made and then is used to overwrite the original in the folder, the presets in the copy are used by VRED and replace the ones in the preset list.

Renderer

Only available for the Texture Bake Type.

Sets the type of raytracing used. Select CPU or GPU Raytracing. To better understand the differences and choose the best type of raytracing for your needs, check out GPU vs. CPU Raytracing.

Hide Transparent Objects

Only available for the Texture Bake Type.

Hides glass and other transparent objects while baking, so they don't cast shadows or contribute to indirect illumination, when enabled. The shadow plane will not be hidden.

Tip:

To bake complex lighting effects, such as reflections or caustics from nearby glass or specular materials, ensure this is disabled, making these objects visible during baking.

Direct Illumination

Enables an extra calculation of direct light bounces, which increases the quality of the final result. Think of a spot light illuminating a performer on stage. Only the light source's contribution is used to calculate the light contribution to any given illuminated point.

Set the type of direct illumination you want baked. Choose from:

Ambient Occlusion

This default setting creates common ambient occlusion shadows. This is independent of light direction and takes the mutual occlusion of visible geometry into account. Ambient occlusion is calculated based on distance (mix/max).

Note:

These additional options appear when Ambient Occlusion is selected: Weighting, Minimum Distance, and Maximum Distance.

Shadows

Creates shadows by considering the lighting information from the environment and any light sources listed in the Light Editor.

Note:

If there is noise in your shadow baking, a higher sample count can correct this.

Light and Shadows

In addition to the baked shadows, lights are also baked. What is meant by lights is the direct illumination from any active light source, such as a spot light, point light, etc., including the environment. The baked illumination replaces the diffuse real-time precomputed environment lighting after baking. The shadows darken glossy and specular reflections from the real-time precomputed environment lighting in OpenGL and in the Precomputed and Precomputed + Reflections raytracing modes. Later changes to geometry objects, for example, through transformation, do not influence the displayed baked light and shadows.

Note:

As of version 2022.1, Enable Separate Illumination is not available when Light and Shadows is selected.

Go a step further and enable Indirect illumination (Indirect Illumination > Enable) to add any indirect illumination. Use the Visualization menu options, Ambient Occlusion Rendering for shadows and Precomputed Illumination Rendering for lights, to display the pure data stored in the textures or vertices.

Enable Separate Illumination

VRED bakes light from the specified light source into a separate lightmap. Bake a specific lighting setup or many indirections from the environment to lighten a scene, along with additional separated lights that can be toggled on and off afterwards. This option shows the correct baking of ambient occlusion/shadows and environment lighting for base illumination and separate direct/optional indirect illumination for separate illumination, when this option and the light source's Bake as Separate Illumination option or geometry light source's option are enabled.

When this option is enabled, the following happens:

When is option is disabled, all active lights are baked, regardless of whether they have Bake as Separate Illumination enabled or disabled.

Quality

Sets the number of image samples used to define the direct shadow quality. Six presets are available, as well as a custom quality setting:

Weighting

Only available with Ambient Occlusion selected.

Sets the weighting of the samples while calculating ambient occlusion for both vertex and texture baking. Use this to improve your shadows. Select one of the following:

Minimum Distance

Only available with Ambient Occlusion selected.

Sets the minimum distance of objects to be considered for the Ambient Occlusion calculation. This value defines black areas, where full occlusion takes place.

Maximum Distance

Only available with Ambient Occlusion selected.

Sets the maximum distance of objects to be considered for the Ambient Occlusion calculation. This value defines white areas, where no occlusion takes place. This value can also be seen as the maximum expansion of the virtual hemisphere.

Clear All

Only available for the Vertex Bake Type.

Deletes the Ambient Occlusion calculation of the whole scene.

Clear Visible

Only available for the Vertex Bake Type.

Deletes the Ambient Occlusion on selected geometry.

Important:

The total calculation time depends on the complexity of the scene and chosen shadow quality preset.

Indirect Illumination

Enables an extra calculation of indirect light bounces, which increases the quality of the final result.

Enable

Enables/disables the indirect illumination mode. When enabled, extra calculations of indirect light bounces are preformed, which increases the quality of the final result, but increases calculation time.

To see the differences between vertex and texture baking for indirect lights, refer to the following table.

Only for Separate Illumination

Available only for the Texture Bake Type with Enable Separate Illumination enabled.

Provides indirect illumination only for the separate illumination and omits the base illumination from baking, increasing the brightness of the scene. If you don't need increased brightness, disable this.

Quality

Only available for the Vertex Bake Type.

Sets the quality of indirection. The higher the values, the better the results.

Indirections

The number of indirections defines the number of calculated light bounces. The default value is one, so only one light bounce is calculated.

Important:

Higher values produce better quality, but increase calculation time.

Enable Color Bleeding

Enables the transfer of color between nearby surfaces, caused by the colored reflection of the indirect illumination option. Color bleeding causes a white wall close to a red wall to appear pink because it receives red light from the red wall. When disabled, the illumination color is stored as greyscale.

Override Material

Overrides all non-transparent objects with a chosen flat diffuse material color for indirect illumination calculation.

Note:

Displacement textures are not respected when this option is enabled. Baking displacements is only possible with texture baking.

Color

Sets the color used for the indirect illumination when Override Material is enabled.

Clear All

Only available for the Vertex Bake Type.

Deletes the indirect illumination calculation of the whole scene.

Clear Visible

Only available for the Vertex Bake Type.

Deletes the indirect illumination on the selected geometry.

Lightmap

Only available for the Texture Bake Type.

This section contains options for sharing lightmaps for clones, saving textures externally, using a denoiser, and setting for resolution and edge dilation.

Share Lightmaps For Clones

Shares lightmaps for clones in a scene, when enabled. Disable to calculate different lightmaps for clones of the same geometry in the scene, before calculating. With vertex baking, geometries that are clones have the same bake result. With texture baking, these geometry clones can have different lightmaps.

This is the expected behavior for clones with smart references:

Save Texture As External Reference

Enables the storing of all lightmaps and all baked textures in an external file location (non-inlined). Use the Location option to set where they will be stored.

Note:

For saving textures non-inlined for specific lightmaps, bake the lightmaps with Save Texture as External Reference activated. Those lightmaps will be saved non-inlined in the vpb, even if the Preference option, Use Inline Textures, is enabled.

Use this option for creating variants for certain geometry. When unchecked, lightmaps and baked textures are saved into the scene file (inlined).

Location

Displays the location where the lightmap textures are saved. Click Open to open a browser and save the lightmap textures in a designated location.

Clear All

Deletes all lightmap textures from all selected objects.

Clear Active

Deletes all lightmap textures from all visible selected objects.

Use Denoising

Reduces noise in the final lightmap texture, using either a GPU or CPU denoiser.

Note:

VRED will use GPU denoising, if there is a GPU graphics card; otherwise, calculations are done on the CPU.

Use Existing Resolution

Uses previously calculated lightmap resolutions, if valid lightmaps already exists; otherwise, the resolution is calculated based on the current settings.

When nodes have different lightmap resolution settings, their resolutions are preserved, instead of overwritten. Anything without existing settings will have then calculated, using the current settings.

If you want the resolution recalculated for everything, disable this. Any lightmaps that had different resolutions will be changed and might look different.

Resolution

Defines the resolution used as either Static or Dynamic.

Texel Density px/m

Sets the number of pixels per meter for the lightmap texture. The lightmap resolution will be calculated, using this value. Therefore, smaller objects will have a lower density and smaller resolution than larger ones.

Things, such as faces, may need a higher pixel density, due to the amount of detail. Objects out of view can have a lower density. This tool is essential for game development and film production.

Edge Dilation

Prevents seams that can occur when a lightmap has low edge dilation. this means no unintended edges of color from the background around the texture. By increasing the edge dilation of the outermost pixel (ensuring sufficient rays), this eliminates the seam (border). Therefore, there are valid pixels at the borders, which fit.

Note:

The resolution of the lightmap can also play a roll in a seam appearing. To improve this further, increase the resolution of the lightmap, using Maximum Resolution, then pressing Calculate All.

Lightmap UV

Only available for the Texture Bake Type.

This section sets the method used for UV generation and provides the option for using existing UV sets.

UV Generation

Use this first time you bake new geometry without lightmap UVs. It automatically generate s UVs. Just select the method used for generating the lightmap UV Sets before the baking process, if Use Existing Lightmap UV Set is unchecked or the geometry has no lightmap UVs. Select one of the following:

Use Existing Lightmap UV Set

Use if your geometry already has lightmap UVs and you want the existing lightmap UV layout reused. When enabled, it will use the previously created UV set. This is the default state, since most people want to use the existing lightmap UVs.

Warning:

When disabled, any existing calculations are lost and cannot be retrieved. New lightmap UV set creations replace the existing one, which could result in layout and bake results that differ from the previous ones.

Subdivision

Only available for the Vertex Bake Type.

Use these settings to subdivide the mesh for polygons that cannot be retessellated, but have shadow results that need improvement.

Enable

Enables/disables the subdivision mode. When enabled, the Quality, Minimum Edge Length, and Intensity Threshold options become available.

Quality

Causes geometries to be refined during the ambient occlusion calculation process, when the Enable subdivision check box is checked. Extra vertices are inserted into the meshes to try and get smoother results on the geometry. Three presets are available:

Minimum Edge Length

Defines the threshold of the subdivision. If the length of an edge between two vertices is below the defined value, it is not subdivided and no additional vertices are added.

Intensity Threshold

Sets the threshold of intensity values of two vertices, to force a subdivision of the triangle edge.

Caution:

Enabling this feature increases calculation time and the polygon count of the scene.

Calculate Buttons

Use these buttons at the bottom of the Bake Settings tab to create a bake calculation. Press the button that best fits your needs.

Calculate Missing

Calculates ambient occlusion, shadows, or light and shadows for all visible and selected nodes in the Scene Graph hierarchy without baking or baking of the selected bake type. When complete, the viewport will update to display the baked lights and shadows. Use this to select nodes more automatically, instead of searching for and selecting them one at a time.

Calculate All

Calculates ambient occlusion, shadows, or lights and shadows for all visible and selected nodes in the Scene Graph hierarchy. Geometry with existing baking of the selected bake type are recalculated. When complete, the viewport will update to display the baked lights and shadows.

Advanced Tab

The Advanced tab contains an overview of settings used for baking and shows what can be seen in the viewport, such as the light baking textures.

Tip:

To see the light baking textures directly on the model, from the Visualization menu, select Precomputed Illumination Rendering.

Properties

Displays the bake properties and states for the selected nodes.

Note:

Changing the Select option or manually selecting something else, changes the content listed in this section.

Name

Displays the name of the selected node. If multiple are selected, the name is highlighted in yellow, indicating the name differs among the selected nodes.

Multiple things are selected

Vertex Bake and Texture Bake

Displays the current bake state of the selected node. There are three states that can be set:

Active Bake

Sets the active type of baking (vertex or texture) which is rendered in the viewport. Select None to toggle baked light and shadows off.

Note:

Another way to set the active bake type is to right-click within the Scene Graph to access the context menu, select Edit > Baked Light and Shadows, then choose Use No Bake, Use Vertex Bake, or Use Texture Bake.

Lightmap

Only available for nodes where texture bake calculations were performed.

Lightmap preview

This section displays the shadow and illumination maps for the geometry selected in the viewport.

Note:

The Properties section cannot display multiple lightmaps. Therefore, you must select one thing at a time to preview the textures. To select another image file, click the Open icon Open icon, select another image, then Open. The new texture is loaded into the Lightmap section. Be aware that the UV layout must be identical to the new loaded texture and Lightmap UV set to achieve the correct results.

Tip:

If you are expecting to see a lightmap and there is none, ensure the texture and/or vertex bake have a Valid state in properties and that Active Bake is not set to None.

Name

Provides an auto-generated name for the lightmap of the selected node. Notice that the name is a combination of the node name followed by _Lightmap and followed by _ numeration, if several lightmaps were baked on nodes with the same name. This name is used when saving the lightmap as an external reference.

Tip:

If you see a yellow highlighted field, this indicates that multiple nodes are selected with different names.

Multiple things are selected

Note:

Use Delete when you've renamed a node after baking and want VRED to generate a new name with a new calculation that matches the renamed node. This will make it easier for the artist to identify which lightmap is assigned to which node.

Base Texture and Separate Texture

Provides controls for loading, refreshing, and deleteing base and separate lightmap image, as well as they're location.

Use External Texture Reference

Stores the texture outside VRED in an external location when saving the file. The image data is then not stored within the project file.

Note:

If the referenced texture file cannot be found when saving the project, the texture will be included in the project file. You need to save a currently inlined texture, first, using File > Save Lightmaps to a folder outside VRED to set up a referenced file location.

Size

Provides the dimensions of the lightmap.

Preview

Vertex Bake Settings and Texture Bake Settings

Provides an overview of the settings used for baking the selected object (parameters from the Bake Settings tab). Find the mode set, whether indirect illumination, color bleeding, material override, and subdivisions are enabled, the number of indirections, the quality settings for direct and indirect quality, and much more.

Note:

These are a part of the same settings seen in the Bake Settings tab, if you select the Settings menu, then Load from Node.

Tip:

A quick way to access this tool is to use Load from Node icon, found in the Icon Bar.

Icon Bar

This contains three tools that apply to both vertex and texture baking:

Load Settings from Node

Load from Node Loads the bake setting from the selected node. It is a shortcut for Load from Node.

Clear Active

Clear Active Clears all the active bake type data for the currently selected node hierarchies in the Scene Graph.

Select Missing

Select Missing Selects all geometries of the selected Scene Graph hierarchy (or whole scene if nothing selected) without any baking or baking for the selected bake type.