Search Unity

Global Illumination updates in 2022.2 and beyond

December 21, 2022 in Technology | 14 min. read
Global Illumination updates in 2022.2 and beyond | Hero image
Global Illumination updates in 2022.2 and beyond | Hero image

With the release of the 2022.2 Tech Stream, you’ll find improved performance and stability for light baking with Unity’s Progressive Lightmappers, as well as small, quality-of-life improvements that enhance the user experience. We’ve also included changes for path tracing in the High Definition Render Pipeline (HDRP), and added features in the Preview release of Adaptive Probe Volumes (APV). Plus, you’ll find details about our planned deprecation of Enlighten. Continue reading for highlights on each of these updates and don’t miss the final section, which provides an overview of Unity’s planned Global Illumination (GI) roadmap.

Enlighten Baked GI deprecation

In our forum post Update on Global Illumination 2021, we provided more information about our roadmap for Global Illumination and our plans for deprecating Enlighten. It is important to note that Enlighten Realtime GI is not affected at this time.

For Baked Global Illumination, we remain focused on improving the stability and reach of Unity’s GPU Lightmapper. We are doing this so that we can deliver a solution that is fast, stable, and more accessible to more of you.

As part of this aim, we are following through on our deprecation path for Enlighten, starting with Enlighten Baked GI. Unity’s Lightmappers offer an alternative to Enlighten Baked GI and have been in use for a number of releases. We recommend those of you who are currently using Enlighten Baked GI and intend to upgrade to 2022.2 or later, to transition to Unity’s Lightmappers and start new projects with these Lightmappers from the 2022.2 release.

You will notice that, with the 2022.2 release, Enlighten Baked GI has been marked as obsolete in the API, and, by default, this has been hidden as an option for generating Baked GI in Unity’s Lighting settings in the Editor. Those of you upgrading to the 2022.2 Unity release and using Enlighten Baked GI in your existing projects will find your Lighting settings automatically changed to Progressive CPU baking instead (or Progressive GPU for Apple silicon devices). From here, you can choose to use either Unity’s CPU or GPU Progressive Lightmappers going forward.

During this transition from Enlighten Baked GI to Unity’s Lightmappers, we understand that you might wish to continue using Enlighten Baked GI. If you need Enlighten Baked GI to assist with your transition, we have made it possible for you to reactivate Enlighten Baked GI via a toggle in the settings under Edit > Project Settings > Graphics. However, this setting will be removed with the 2023.1 release.

We want you to succeed as you transition from Enlighten Baked GI to Unity’s Lightmappers. If you encounter any issues, please post your feedback on Unity’s Global Illumination forum, or submit a bug using Unity QA – Bug reporting.

Adaptive Probe Volumes

With the 2022.2 release, we’ve continued the development of Preview features for Adaptive Probe Volumes. This begins with an initial implementation of light leaking prevention.

Light leaking prevention represents a step toward enabling probe-lit static geometry. It makes it possible for Light Probes to replace some lightmaps for static objects in certain scenarios.

In addition, GPU memory streaming is now supported. Leverage it to build and run scenes where Light Probe data doesn’t fit entirely in GPU memory.

A debug view of Adaptive Probe Volumes demonstrating how probes’ density increases with the density of the area of the scene: This image uses the ArchVizPRO Interior Vol.8 assets from the Unity Asset Store.
A debug view of Adaptive Probe Volumes demonstrating how probes’ density increases with the density of the area of the scene: This image uses the ArchVizPRO Interior Vol.8 assets from the Unity Asset Store.

Finally, we provide a Preview offering for baking multiple Light Probe-lit lighting scenarios. This enables you to author, bake, and blend between multiple lighting datasets during authoring and at runtime.

An example of Llight Pprobe-lit lighting scenarios, one scenario for daytime lighting and one scenario for nighttime lighting.  This image uses assets from ArchVizPro Interior Vol.7 HDRP from the Unity Asset Store.
An example of Light Probe-lit lighting scenarios, one scenario for daytime lighting and one scenario for nighttime lighting. This image uses assets from ArchVizPro Interior Vol.7 HDRP from the Unity Asset Store.

HDRP Path Tracing Denoising

HDRP Path Tracing Denoising provides you with the ability to achieve noise-free, path-traced images in situations where this simply wasn’t possible before or that would’ve taken much more time with unfiltered sample accumulation/convergences. Note that this is related to denoising for offline or interactive rendering, so it does not support path tracing in real-time for game experiences.

Part of the HDRP template scene demonstrating a comparison of path tracing with denoising off vs denoising on
Part of the HDRP template scene demonstrating a comparison of path tracing with denoising off vs denoising on

Optix 7 update and memory consumption reduction

In 2022.2, the Optix denoiser for the Lightmapper was updated to version 7. At the same time, denoising uses tiling to reduce memory consumption. As a result, you can now bake and denoise higher-resolution lightmaps with less risk of running out of memory.

Unity Denoising package and public scripting API

With the 2022.2 release, our internal image denoising infrastructure has been moved to a package, and we’re exposing this functionality to your C# scripts through a public API. Using this common API, you can select between different denoising backends, such as Optix and OIDN, depending on your platform and hardware capabilities.

Notable fixes and improvements

Improved Light Probe stability

We had seen reports that some users working with Light Probes experienced Editor crashes in Play Mode when loading and unloading scenes additively. There were multiple root causes behind these crashes, but the common theme was that it was not clear or well-defined when the set of Light Probes for the current scene were ready for rendering. As such, the state behind the set of Light Probes could be corrupted.

With 2022.2, the code has been improved so that it is now well-defined when the set of Light Probes are staged and ready for rendering. This fixes known cases of corrupted state that could lead to crashes.

Light Probe hull searching improvements

Previously, when a Light Probe-lit object was moved outside of the tetrahedral hull, there was a very slow path taken in order to search the entire Light Probe tetrahedral hull and find the closest Light Probe. This cost scales up linearly per object outside of the hull and the complexity of the tetrahedral hull, which could have an especially large impact on large projects.

To improve default behavior in new projects (and to give users an opt-in setting for legacy projects), a new property in the Graphics settings defines the sampling behavior of Light Probe-lit objects placed outside of the bounds of the Light Probe tetrahedral hull. A new fast path has been added for objects outside the hull, which uses the ambient probe instead of searching the entire hull.

Fixes to SkyManager issues

The team recently fixed an issue where environment lighting is missing from player builds in certain scenarios. For example, this might occur in cases where the scene hasn’t been baked.

OpenCL kernel caching

To solve the problem where OpenCL shader loading time in new projects has become significantly slower, we’ve fixed a regression by speeding up the OpenCL shader loading stage through cached binaries in the GICache. In our tests, we’re seeing measurable performance improvements for GPU lightmapping when the OpenCL shaders are read from the GICache (as the image below indicates).

Note, however, that the first time the Editor is started, the cache is not yet populated, so this particular run is as slow as it was before.

Measurable performance improvements for compile times of bakes in our test environment
Measurable performance improvements for compile times of bakes in our test environment

Quality-of-life improvements

In the context of Global Illumination, here are some notable, smaller improvements that impact the overall user experience delivered in the 2022.2 release:

  • Improved alignment of fields and properties in the Lighting window
  • New and Clone buttons on same line of the UI to streamline the creation of Lighting Settings Assets
  • Consolidated Min and Max Bounces field into a single property – Max Bounces
  • Improved Gaussian filter precision to 0.1 texel increments (this was previously locked to 1-texel increments)
  • Lightmap Parameters Asset UI reorganized for better readability

The road ahead

As usual, you can find our latest planned Global Illumination roadmap on the Productboard. Here are some more highlights.

Adaptive Probe Volumes

With the 2023.1 release, the core features and user experience of Adaptive Probe Volumes are improved so that we can remove the “experimental/preview” label from this feature. We are also implementing support for Adaptive Probe Volumes in the Universal Render Pipeline (URP). Note that the first iteration will not support Lighting Scenario Blending and may not yet be optimized for performance, especially when running on lower-end platforms.

Precomputed Realtime GI

With Precomputed Realtime Global Illumination, we provide a real-time Global Illumination solution that scales across a wider range of platforms compared to Ray Traced Global Illumination (RTGI) or Screen Space Global Illumination (SSGI). This Precomputed Realtime Global Illumination solution is based on prebaked Light Probe data, which dynamically updates the indirect lighting on probe-lit objects at runtime and enables you to author, build, and run real-time Global Illumination from dynamic lights off static contributors like walls, ceilings, terrain, and other static objects.

Real-time preview of Baked GI in Editor

For quick previews of baked lighting, we provide a dedicated Preview path for faster iteration on baked lighting data. Using the “backwards” path tracing pipeline (where light paths are generated starting from the Camera) to compute lighting only for the visible parts of a scene, we enable you to preview illumination instantaneously. This feature will take advantage of hardware-accelerated ray tracing, if this is available, and will also work on non-hardware ray tracing GPUs using a compute shader fallback.

GPU Lightmapper improvements

As we continue our foundational work with the GPU Lightmapper, we will enable more of you to use it and increase your velocity with a more stable, predictable light-baking foundation.

Light Baking C# API

With the Light Baking Public C# API, we hope to provide a robust, side-effect free, and supported C# API. This API lets you define the inputs that affect a GI bake (e.g., Meshes, Transforms, Materials, Lights, and so on), as well as the outputs for generation – think of lightmaps and/or Light Probes and their individual components like irradiance, directionality, occlusion, and octahedral depth.

Enlighten Realtime GI deprecation

You can find more details on our deprecation path for Enlighten Realtime GI in the Update on Global Illumination 2021 forum post.

Additional information

December 21, 2022 in Technology | 14 min. read
Join a discussion on our Forums
Related Posts