Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Official Feedback Request: Global Illumination changes with the 2023.1 beta tech stream

Discussion in 'Global Illumination' started by StevenK_Unity3D, Mar 15, 2023.

  1. StevenK_Unity3D

    StevenK_Unity3D

    Unity Technologies

    Joined:
    Jun 18, 2021
    Posts:
    17
    Global Illumination changes with the 2023.1 beta tech stream, we want to hear your feedback (survey is now closed)!


    We want to make sure we are providing you with the best products for your day to day experience in Unity. We want to learn from you how you are experiencing the changes related to global illumination which we delivered in the 2023.1 beta release.

    This survey is now closed.

    What’s changing with the 2023.1 release?
    Our focus for the 2023.1 release is to provide you with a more predictable and stable light baking experience through our new light baking architecture LightBaker v1.0, and to improve on the probe volume workflows and scalability for Adaptive Probe Volumes.

    New light baking architecture “LightBaker v1.0”
    Baked Global Illumination now uses our new LightBaker v1.0 architecture for on-demand bakes. The New Light Baking Architecture impacts the production of most artifacts related to baked lighting: lightmaps, light probes, shadowmasks, ambient occlusion textures, etc. In the new architecture, code is internally split into modules with clear responsibilities and well-defined inputs and outputs. This redesign has significantly simplified our code base. Simpler code makes it easier and faster to fix bugs and it lowers the risk of introducing new ones.

    Note that Auto mode still uses the existing progressive baking feature.

    For creators working with Baked Global Illumination, Unity’s new light-baking architecture will mean few changes. We have built this new architecture with Editor responsiveness and baking speed in mind. When using on-demand baking, Unity now takes a “snapshot” of the Scene state when the Generate button is clicked. This snapshot is then sent to the bake process and the bake will continue uninterrupted, unless the Cancel button is clicked. Unity no longer checks the Scene state every frame, which previously undermined Editor performance.

    Unity also now provides a Baking Profile. This can be found in the Lighting window when using the GPU backend in on-demand mode, and offers users a tradeoff between performance and GPU memory usage.




    URP and HDRP - Adaptive Probe Volumes (APV)
    With the 2023.1 release, the core functionality and user experience of Adaptive Probe Volumes are improved and are officially supported.

    Compelling visual experiences also need to be performant at runtime. Adaptive Probe Volumes move beyond Unity’s existing Light Probe capabilities, providing performant Scene-wide indirect lighting with these main benefits:
    1. You can now place Light Probes automatically, with adaptive distribution
    2. You can iterate faster as Light Probe density dynamically adapts to Scene geometry
    3. Better image quality with APV’s per-pixel lighting as compared to Light Probe Groups
    4. Static and dynamic objects are better integrated, as both can be lit using the same system
    5. Lower memory usage at runtime for Light Probes, as this data can be streamed from CPU to GPU
    6. Baking Sets enable lighting scenario blending for Light Probe-lit objects (HDRP only)


    Exterior scene using APV with debug tools showing the grid (this image uses the [HDRP] Abandoned Factory Buildings - Day/Night Scene package from the Unity Asset Store)

    Also new with 2023.1 beta is the first release of Adaptive Probe Volumes in URP. Note that this iteration for URP will not support Lighting Scenario Blending nor Lighting Normalization for Reflection Probes and may not yet be optimal for performance, especially when running on lower-end mobile platforms.

    ------------------------------
    Find the feedback request for the 2023.2 global illumination changes here.
     
    Last edited: Nov 2, 2023
  2. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    Hi,

    glad to hear it. In my experience, and for me, lightmapping in unity has been very painful that I simply gave up on it. I fix one issue, another comes up, it feels endless.

    I want to talk about the probe volume though, APV is great, but I feel it's potential has been left and forgotten.
    In its current state it reminds me of lightmapping, countless issues that never end. Hacky solutions (like it's anti light leaking) that cause issues while fixing others. Same thing with dilation, it can sometimes cause light leaks, but you need it for other areas to fix things up.


    I've used APV so much that I memorized every parameter it has and it's debugger. Using too much view bias can leads to issues, but sometimes you have no choice. Same thing with normal bias.


    Most of all it struggles with interiors, dark areas, dim lit rooms, thin objects, weirdly shaped objects, the list goes on.
    Unity's demo had a lot of windows, open areas for outside lighting to come in and it was very bright. This masked all the issues with APV.


    Take this for example,


    This is lit entirely with APV, everything receives and contributes probe lighting. It looks great, but this is because there is so much lighting that all issues are masked by the amount of indirect lighting going around.

    In a real scene, with rooms, interiors, or just dark exterior areas, this is what you can expect from APV:

    (This used a very extreme amount of probes & samples)

    Note this picture is using view-bias to the extreme, otherwise the light leaking is much worse. But since view bias is camera based, while moving lights will move, leaking will come and go, it's not something you can really use to extreme amounts other than still images.

    Then there's the sample issues, APV struggles more the darker an area is, this one isn't even that dark. There's still a ton of indirect light coming from the doors. (And a lot of light leaking on the walls but the camera angle hides it).
    The more probes you have, the more samples you need. In my testing even with a crazy probe density, and tons of samples (so much it took over 500mb of disk space for a tiny room), the issues were still there. Light leaking In particular.


    Another example:

    This isn't a closed off interior, it's just a building out in the open, but as you can see there's a lot of light leaking.
    APV struggles with thin walls/roofs and in general anything thin, you can see it's also leaking from the terrain on the ground which is set to APV lighting.

    Let's use some probe touchup volumes to give the walls artificial thickness:


    Much better, but still light leaking in the roof at the right, and on the wall in front. And just for this small areas I needed to use multiple touchup volumes. Much of the light leaking is reduced by SSAO or hidden by gizmos, to see it better check this image:

    Test done in latest 2023.1.beta:
    probe density 1, 30k env samples, 2k indirect samples. I also tested with 0.3 probe density.


    You can see in the following picture, the wall is using probes inside geometry to light itself, causing strong light leaking. I'm using both dilation & virtual offset, but virtual offset fails to detect some probes. It also often pushes probes inside of geometry, and not out.
    (The highlighted probes are the ones being used by the pixel I selected)


    You can see in the next picture virtual offset doesn't detect the probes inside the wall here at all, and leaves them be:



    The worst part is all this leaking isn't just for static objects, it's for everything - dynamic or static - contribute gi on or off, if your character walks next to this wall, it will receive light leaking.

    For example, the exact same scene as the above, check this cube that only receives probe lighting, doesn't contribute:


    Half of the cube is lit unrealistically, light leaking, and this is with touchup volumes.

    there's also the sampling noise, which is very noticeable without TAA. The cubes look more noticeable as they have no textures, which isn't a realistic use case.
    Sometimes even with TAA enabled, and animated sampling noise enabled, you can still notice it.

    I'm jaded with GI in unity, I was hoping APV would be my way out of using unity's lightmapper for regular baking, but I just moved to a different tool with the same unending issues.

    I even tested it for just dynamic chars, and the light leaking was still very noticeable - so it's not just an issue for people trying to use APV as a full static lighting replacement.

    I have much more to say, but for my sanity, and your sanity, I will stop here. I doubt anyone will read this post in its entirety anyways, nor will it change anything, maybe I'm writing this to myself more than others. A wake-up call of some sorts, who knows :)
     
    Last edited: Mar 27, 2023
  3. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,973
    Also put this in the survey, but would love to see a way to bake 1 scene into chunks. Now I have to break it up in multiple scenes.
    Example:
    Have both interior and exterior elements in a scene. I would like to use different baking settings for both, which would require multiple scenes now.
    The new system looks cool btw, might try it out later
     
  4. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    293
    I tried baking a scene using an environment from asset store. It predictably produced artefacts all over the place. The culprit is ofcourse 'UV overlap'. After checking the UV overlap debug view I just gave up lol RED.

    Then I tried APV. I like APV a lot even though there are many light leaks. In most environments where light leaking could be mitigated by whatever means the GI team provides (view bias mostly), it works amazingly well both perf wise and authoring wise. It's WAY WAY better than having to pull my hair fixing uv overlap for sure.

    Combining APV with half resolution SSGI enhanced the result even further. Hopefully they are as capable on 2022 as we cannot risk upgrading our project beyond that version(and it's likely to take around a year to be stable anyway given Unity track record)
     
    DevDunk likes this.
  5. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136

    This is why I put my hopes on APV, it fixes many of the issues that come with lightmapping.
    But other than exteriors, APV will struggle. Especially in dim closed off interiors.

    SSGI is not a good idea due to fixed thickness, so if you have grass/small objects in your scene, SSGI will make them very noisy and dark, unrealistically so. If you don't have any of these two in your project, it can work very well with APV, much better contact shadows (AO) compared to SSAO. SSGI can also cause excessive shimmering for vegetation, especially when not running at full res.

    Improving SSGI, focused on its the use case alongside APV could be interesting (improving performance, less reliant on excessive blur, depth aware thickness to work well with small objects).
     
    DevDunk likes this.
  6. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    293
    My hope is with H-trace 2.0 currently
     
  7. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    594
    With the AVP window you can set up your groups on a scene by scene (singular or multi), then within each scene you can create multiple Probe volume game objects, you could potentially break this down into finer details each pass. IIRC similar to Reflection probes' smaller wins priority so you could set your internals smaller as independent probe volume game object to say a scene scaled one which would then have the lower priority for that specific area
     
    Misaki_eKU likes this.
  8. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,973
    Oh cool!
    Also saw something about multiple lighting senarios with bakes in the GDC events from Unity which looked very promising
     
  9. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    594
    Yeah, for times of day, absolutely essential. Baking in certain times of day for your lighting set ups to stack multiple APV and then interpolate between them is an amazing step forward for the team.
     
    DevDunk likes this.
  10. Wattosan

    Wattosan

    Joined:
    Mar 22, 2013
    Posts:
    456
    I'm genuinely curious about how would these be fixed, at a code level? What's the solution for all of these problems? Do the solutions even exists, i.e. is there a reason to be optimistic about the future of APV?
     
  11. Deleted User

    Deleted User

    Guest

    Try setting the ssgi ray steps to zero and play around only with the ssgi denoiser as per your needs and performance(i generally set the denoiser radius to 1 for maximum quality), see if it helps in reducing the ugly effects on vegetation and light leaking of apv.
     
  12. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    I already did that. If you set it low enough to avoid all the issues on vegetation, it loses all AO/contact shadows, or most of it. At that point you're better off with SSAO.

    For light leaking, it helps with APV due to the excessive blurring its denoisers do, there's no special way it helps other than that. The AO from SSGI could also help hide it, similar to SSAO I suppose.
     
  13. Misaki_eKU

    Misaki_eKU

    Joined:
    May 3, 2018
    Posts:
    93
    unity can implement visibility check to solve the light leaking issue
     
  14. StevenK_Unity3D

    StevenK_Unity3D

    Unity Technologies

    Joined:
    Jun 18, 2021
    Posts:
    17
    We also recently shared more details about APV at GDC 2023:
     
    lilacsky824, pbritton, echu33 and 2 others like this.
  15. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    Thanks for the link. In the video I can see he's updating probe validity with touchup volumes without baking, this is great and a big-time saver, I haven't noticed it in recent versions so assuming it's coming soon :D
     
    pbritton likes this.
  16. useraccount1

    useraccount1

    Joined:
    Mar 31, 2018
    Posts:
    275
    One slide claims that APV brings improved integration with volumetric lights, then the speaker doesn't elaborate on what it means.

    Could anyone clarify what that "improved integration" means? Is it something like:
    - Possibility to bake indirect volumetric fog
    - Possibility to light volumetric fog made with the component "Local volumetric fog" without using real-time or mixed lights?
    - Possibility to lit volumetric particles / volumetric shader volume without using real-time or mixed lights?

    Or something entirely different?
     
  17. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    Since APVs can be sampled and interpolated per-pixel on the GPU, volumetric effects can sample from them and be affected by baked lighting.
     
    useraccount1 likes this.
  18. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    APV looks a lot like Call of Duty's light probe technique, but it's missing a crucial component to fight against light leaking: a means of determining visibility information. CoD does it by baking variance shadow maps for each probe and sampling them to determine a probe's visibility from the shaded pixel. It's not perfect, of course, but removes a lot of low-hanging light leaks.
     
    tspk91, shikhrr and (deleted member) like this.
  19. StevenK_Unity3D

    StevenK_Unity3D

    Unity Technologies

    Joined:
    Jun 18, 2021
    Posts:
    17
    This survey is now closed. Thanks all that contributed to providing us with feedback and signing up for user testing APV.
     
    JamesArndt, Ruchir and DevDunk like this.
  20. Stepan_33

    Stepan_33

    Joined:
    Nov 21, 2022
    Posts:
    26
    Can someone tell me how to use the API in a standard unity project, and what kind of rendering pipeline is needed, I have no idea, I installed unity 2023.2.0a17, HOW to enable the API????

    I tried all possible rendering pipelines but I couldn't turn it on API.:(
     
  21. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    761
    Hi, do you mean APV (adaptive probe volume)? It's supported on HDRP (2021.2+) or URP (2023.1+) and you can find more information in this thread.
     
  22. Stepan_33

    Stepan_33

    Joined:
    Nov 21, 2022
    Posts:
    26
    I am interested in (adaptive probe volume)
    URP (2023.1+)
    how to enable?
    is it possible (adaptive probe volume) with a (Built-in ) rendering pipeline?
     
  23. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    761
    I haven't tried it yet, but it should be similar to enabling APV in HDRP. You may refer to this experimental APV thread.

    Built-in RP doesn't support APV and it seems that they don't have any plan to add it. By the way, the Enlighten Real-time GI (which should be replaced by dynamic APV) cannot make use of APV as well.
     
  24. Stepan_33

    Stepan_33

    Joined:
    Nov 21, 2022
    Posts:
    26

    I still have a problem with enabling
    (Probe Volumes are not enabled. Make sure Light Probe System is set to Probe Volumes in the URP asset in use.)


    I have no idea how to enable AV this in (URP(2023.2) the tutorial didn't help

    upload_2023-6-7_22-40-37.png





    2023-06-07_22-38-33.png
     
  25. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,973
    Check the urp asset like it says?
     
  26. Stepan_33

    Stepan_33

    Joined:
    Nov 21, 2022
    Posts:
    26
    I have no idea how to do it
     
  27. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,973
    Go to where your urp assets are, probably a settings folder. Click them.
    Or check the active ones in quality settings
     
  28. Stepan_33

    Stepan_33

    Joined:
    Nov 21, 2022
    Posts:
    26
    Thanks, but I didn't understand anything, maybe some kind of step-by-step guide
     
  29. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,973
    If you can't find the urp assets in your urp project, maybe stick to the basics first before messing with features in the alpha version
     
  30. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    761
    Have you checked show all additional properties in Preferences→Core RP?
     
  31. Stepan_33

    Stepan_33

    Joined:
    Nov 21, 2022
    Posts:
    26
    sorry, but I didn't find anything, maybe there's someone else who can tell me how to turn this thing on((APV (adaptive probe volume)))




    upload_2023-6-10_18-5-5.png
     
  32. echu33

    echu33

    Joined:
    Oct 30, 2020
    Posts:
    62
    Hi, I've answer your question in APV thread.

    The graphics category is locate in Project Settings instead of Preferences. You can find the attached renderpipeline asset in there.

    ===================
    In case you dont know what URP assets is about, here's the official documentation about it.
     
    Last edited: Jun 11, 2023
    StevenK_Unity3D likes this.
  33. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    Is anything actually different though results wise?
     
  34. Pema-Malling

    Pema-Malling

    Unity Technologies

    Joined:
    Jul 3, 2020
    Posts:
    307
    The goal was for nothing to be visually different before and after the new architecture was introduced. There are inevitably going to be some slight discrepancies, for example due to reordered floating point operations causing slightly different rounding error etc. But mostly should look the same
     
  35. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    985
    I have two RTX 3060 GPUs.
    It doesn't seem to detect them. Unity 2023.1.11

    Also its very easy to add in GPU detection with D3D11/12, Vulkan etc. Can we get GPU detection before we start baking a scene?
     
  36. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,973
    Also request that on the roadmap :)
     
  37. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193