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 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.
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 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.
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.
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.
Shadows - Displays the shadow baked lightmap.
For older scene (not created in 2022.1), no baked light will appear on the Shadow material.
Separate Illumination - Displays the illumination from everything baked separately using Enable Separate Illumination and Bake Separate Illumination. Disabling this displays the base illumination map coming from the environment and some indirections from geometry.
Separate Illumination Options - Opens the Bake Render Options dialog with controls for changing the intensity and color of all separate lightmaps, and toggling texture compression for OpenGL on and off.
Intensity - Controls for changing the intensity of all separate lightmaps. Use it to turn lights on and off or dim and brighten them. You can use scripts to create Variant Sets.
Color - Controls for changing the color of all separate lightmaps. Use it to multiply the light with a color and change it. You can use scripts to create Variant Sets.
GPU Texture Compression (OpenGL) - Use for separate illumination lightmaps for OpenGL rendering.
Enables compression is done at run-time by the graphics card driver on texture upload and is on by default. Toggle off if any compression artefacts become visible in the OpenGL rendering.
Please note, artefacts might be more visible when viewing the raw texture data with Visualization > Precomputed Illumination Rendering, but less visible in Realistic Rendering, depending on how the lightmap data is combined with other real-time light (e.g., from the environment).
For Python users, try this script: setLightmapGPUTextureCompression(on)
Here are scripts to use with Variant Sets:
To enable the controls:
setBakeRenderOptions(VR_BAKED_BASE_ILLUMINATION, True)
setBakeRenderOptions(VR_BAKED_SEPARATE_ILLUMINATION, True)
setBakeRenderOptions(VR_BAKED_SHADOWS, True)
To disable the controls:
setBakeRenderOptions(VR_BAKED_BASE_ILLUMINATION,False)
setBakeRenderOptions(VR_BAKED_SEPARATE_ILLUMINATION,False)
setBakeRenderOptions(VR_BAKED_SHADOWS,False)
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.
Deleting the BakePresets
file removes all non-default presets from the preset list on your next launch.
If the BakePresets
file 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.
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.
Do this to be able to change the environment in real-time and/or its exposure and see changes in the real-time lighting.
In the Bake Light and Shadows module > Bake Settings > Direct Illumination section, enable Ambient Occlusion and Enable Separate Illumination.
To define the light sources that should be separated.
Select the objects in the Scenegraph.
In the Bake Light and Shadows module, click the Calculate All button.
Use Visualization > Ambient Occlusion Rendering to check the ambient occlusion map. Use Precomputed Illumination Rendering to check the lighting from the geometry source lights.
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))
Bake white light, such as an ambient light for a door panel, into your scene and change the intensity in real-time.
Create a separate illumination lightmap for the ambient light:
Select Visualization menu > Bake Render Options > Separate Illumination Options to access Intensity.
Use the Intensity slider to change the brightness of all separate illumination lightmap.
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.
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.
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".
Create a separate illumination lightmap for the ambient light:
Select Visualization menu > Bake Render Options > Separate Illumination Options to access Color.
Click the color swatch or move the slider to multiply the light with a color to change it.
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.