Insights From The Blog

New Approaches to Providing Global Lighting for Your Worlds in Unity 6

With the much-anticipated Unity 6 release just around the corner, our delve into the preview has highlighted some major new features, including new ways to add light and illumination to your worlds.  

Lighting is so important in complex gaming systems and can be a real make-or break issue with users. Get the lighting right and you’ll have a series of wonderfully crafted scenes that draw the player in.  Get it wrong and you not only risk players missing essential parts of the game, but also alienate them and end up with poor reviews.  Either way, you could end up with a serious dent in your perceived income, all for the want of a bit of well-considered lighting.

Let’s have a look at the main new tools that can help you get your lighting levels right in the forthcoming release.

Global Illumination Lights the Way

Should you have previous experience with precomputed illumination data, you will be aware of how labour-intensive the procedure may be to get everything right. The precomputing procedure for Lightmaps can take a long and tedious time to perfect; Lightmap UVs need to be created, Probes need to be placed for dynamic objects to be lighted appropriately, and you will have to deal with huge textures that can seriously affect the runtime memory of your apps.

The development team has included a new method for you to build higher quality, light-probe lit scenes using Adaptive Probe Volumes (APV), and introduced basic enhancements to the light baking backend for more stability in Unity 6.  The advantages of using APV include:

  • You can place Light Probes more easily through adaptive probe distribution.
  • They iterate faster as Light Probes density adapts to the updated geometry in each scene.
  • There is a noticeably improved image quality with APV as compared to legacy Light Probes.
  • The Light Probes can affect the indirect lighting of static objects in some scenarios, giving a more natural look to scenes.
  • There is Light Probe data streaming from the CPU to the GPU.

Automatic probe placement tends to mean that light sources are generally placed in appropriate and well-considered places, offering you the best in environment illumination.  The APV system will create less probes in areas with less densely packed items, like the backdrop of a Scene, and more densely placed probes in places with more geometry due to its adaptable character.  This will let your surroundings seem more natural and allow you to create illumination depending on your buildings.

APV is kind of a big deal, and it’s worth having a bit of a deep dive into it to look at some of the features it brings.

  • APV provides streamlined procedures for placing probes and accelerates iterations for indirect diffuse lighting methods based on light probes.
  • APV per-pixel lighting surpasses Light Probe Groups in terms of quality and delivers superior directionality at the level of Lightmaps, therefore yielding exceptional overall lighting quality.
  • The APV software offers more control over optimisations for runtime performance, depending on the render pipeline and target hardware setup.
  • APV allows for visually striking lighting transitions under Sky Occlusion and Lighting Scenarios, specifically designed to replicate time-of-day and lights on/off scenarios.
  • Light Probes can affect the indirect lighting of static objects in some scenarios

In addition to these benefits over other lighting systems, APV’s streaming features allow light probe data to be streamed from Disc to CPU, and from the CPU to the GPU, seamlessly integrating with atmospherics effects like Volumetric Fog in HDRP and VFX. 

Unity’s general settings tab allows you to control the construction of APV lighting constraints as well as several subdivision levels depending on the surrounding geometry by controlling parameters such Min and Max Probe Spacing. Dense regions will often employ the best resolution by default; places with less geometry will use lesser densities. Emphasising regions most in need, this automated and adaptive behaviour guarantees effective use of resources.  This means that the APV lighting can be controlled to a very high degree. 

Under the current Light Probe approach – the light probe proxy volume (LPPV) – a 3D Renderer picks illumination from one Light Probe interpolated between the surrounding Light Probes in the Scene. 3D objects have continuous ambient illumination all throughout their surface, and on bigger 3D objects like Particle Systems specifically, this is clearly evident in the final rendering. Whereas probes in a volume are interpolated per-pixel rather than per item with the APVs, making a far superior light volumizing system.

APV is a huge game-changing addition to Unity and is likely to be a powerhouse feature in the next iteration of Unity-powered content.  With the right lighting, a scene can change from just ‘okay’ to mind-blowing in its form, and that can only be good for both gaming and the Metaverse as a whole.