Lightmap Innovations

In 2022.1, we added separate baking of light sources, a bake render option debug mode, and options for showing baked light on Shadow materials, loading base and separate textures, and previewing base and separate illumination lightmaps. We also added the new BakePresets file that stores vertex and texture bake shadows.

Before 2022.1, to bake lights, you used Light and Shadows, but this baked the whole illumination (shadows and illumination) into the lightmap. This added light from the environment (base illumination), so the environment couldn't be switched or exposure changed. They were baked into that lightmap.

With 2022.1, our new approach provides the flexibility to bake light sources, even geometry light sources, and shadows separately. You can switch the environment or change the exposure afterwards and have ambient occlusion. Now, you can have lighting from the IBL from the HDR in real-time, and specify which light sources are separated.

Bake as Separate Illumination

Bake as Separate Illumination was added to the Properties section of the Light Editor's Light Settings tab and to the Incandescence section of the Material Editor. Use it to define light sources that should be separated. You can separate the ambient occlusion or shadows from the baked lighting for individual light sources or geometry source lighting incandescence materials. Use this with Enable Separate Illumination, then calculate the lightmaps.

With Bake as Separate Illumination, you can switch, rotate, or change an environment and/or its exposure without affecting things like a door panel's ambient light, since it was baked into a separate lightmap. Use scripts to change the intensity of separate baked lightmaps to turn a door panel's ambient light on and off and to change the color in real-time.

Only for Separate Illumination

Available only for Light and Shadows direct illumination with Enable Separate Illumination enabled.

Only for Separate Illumination was added to the Bake Light and Shadows module's Indirect Illumination section. It 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.

Enable Separate Illumination

Enable Separate Illumination was added to the Bake Light and Shadows module. VRED bakes light from the specified light source into a separate lightmap. You can 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.

For example, create an ambient light within a car using geometry with an incandescent material assigned. With the material selected, enable Bake as Separate Illumination from the Incandescence section of the Material Editor. In the Bake Light and Shadows module, select Shadow baking and Enable Separate Illumination to generate and bake the lights and shadows.

Loading and Previewing Lightmaps

Load lightmaps in the Advanced tab, using the new Base Texture and Separate Texture options to separately load these textures. To preview the lightmaps for the baked texture, select the new tabs, Base Illumination and Separate Illumination.

3 tabs

Bake Render Options

Use the Bake Render Options debug modes, added to the Visualization menu, to select the kind of baked light seen in your 3D rendering and to check what appears. Simulate switching baked lights on and off. See the contribution of the environment during run-time and how environment material controls, like Exposure, will change the illumination of the scene.

When in Precomputed Illumination Rendering mode, if the following options are enabled, you see all the illumination in the scene.

Bake Render Options Dialog

Here are scripts to use with Variant Sets:

BakePresets

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

OpenGL For Light Sources Illuminating Shadow Materials

As of 2022.1, we added OpenGL support for light sources illuminating the shadow material.

To achieve this, in the Light Editor's Properties section, enable Illuminate Shadow Material for the lights. In the Material Editor's Reflection section, with the Shadow material selected, set Reflection Mode to Diffuse Only or Diffuse & Glossy.

How to Bake Lights for Ambient Occlusion and Separate Lights

Do this to be able to change the environment in real-time and/or its exposure and see changes in the real-time lighting.

  1. In the Bake Light and Shadows module > Bake Settings > Direct Illumination section, enable Ambient Occlusion and Enable Separate Illumination.

  2. To define the light sources that should be separated.

    • In the Material Editor, select the material and in the Incandescence section, enable Bake as Separate Illumination and Use as Light Source (Raytracing Only).
    • In the Light Editor, select a light source and in the Properties section, enable Bake as Separate Illumination.
  3. Select the objects in the Scenegraph.

  4. In the Bake Light and Shadows module, click the Calculate All button.

    Tip:

    Use Visualization > Ambient Occlusion Rendering to check the ambient occlusion map. Use Precomputed Illumination Rendering to check the lighting from the geometry source lights.

How to Turn Geometry Lighting On and Off

Geometry lights are geometry with an incandescent material assigned to it that glows and adds to the illumination of the scene. Use the Bake Render Options to turn geometry source lighting on and off. In the Bake Render Options, enable or disable Separate Illumination. When disabled, you see only the ambient occlusion.

This can also be done via script in the Variant Sets module. In the Scripts tab, you can build a toggle that turns the lights on and off.

setBakeRenderOption(VR_BAKED_SEPARATE_ILLUMINATION, not
getBakeRenderOption(VR_BAKED_SEPARATE_ILLUMINATION))

How to Control the Intensity of the Separate Illumination

Bake white light, such as an ambient light for a door panel, into your scene and change the intensity in real-time.

  1. Create a separate illumination lightmap for the ambient light:

    • For a light, with the light selected, in the Bake Light and Shadows module Bake Settings tab, select Ambient Occlusion and enable Enable Separate Illumination. Click Calculate All.
    • For a geometry light source, with the geometry selected, in the Material Editor, select it material, then in the Incandescene section, enable Bake as Separate Illumination and Use as Light Source (Raytracing Only). In the Bake Light and Shadows module, click Calculate All.
  2. Select Visualization menu > Bake Render Options > Separate Illumination Options to access Intensity.

  3. Use the Intensity slider to change the brightness of all separate illumination lightmap.

Tip:

Change the intensity of the separate illumination lightmaps via Python in the Variant Sets module > Scripts tab, using setSeparateBakeInsensity(1,0), and build variants with it.

How to Control the Color Multiplier for the Separate Illumination

Bake white light into your scene, such as an ambient light for a door panel, and change the color with the multiplier in real-time.

Note:

At present, you cannot build light classes to change the intensity or the color multiplier for the separate lights individually and control, for example, a "red" light independent from a "blue".

  1. Create a separate illumination lightmap for the ambient light:

    • For a light, with the light selected, in the Bake Light and Shadows module Bake Settings tab, select Ambient Occlusion and enable Enable Separate Illumination. Click Calculate All.
    • For a geometry light source, with the geometry selected, in the Material Editor, select it material, then in the Incandescene section, enable Bake as Separate Illumination and Use as Light Source (Raytracing Only). In the Bake Light and Shadows module, click Calculate All.
  2. Select Visualization menu > Bake Render Options > Separate Illumination Options to access Color.

  3. Click the color swatch or move the slider to multiply the light with a color to change it.

Tip:

Change the color of the separate illumination lightmaps via Python in the Variant Sets module > Scripts tab, using setSeparateBakeColor(Color3f(0.0, 0.1, 0.1)), and build variants with it.