Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  3. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Official Adaptive Probe Volumes (APVs) experimental release for HDRP in 2021.2

Discussion in 'Graphics Experimental Previews' started by Matjio, Feb 11, 2022.

  1. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    304
    This is taking a bit more time than expected cause i put it in the same PR as the one with the public API to override baking. Doc is in review currently but i hope i'll be ready for the end of the week (and publicly available a bit later)
     
  2. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    304
    There are plans to investigate if it's feasible, so if it turns out it's the case it will be done but i can't guarantee.
    Indeed it's a bit involved to have a system of cached shadows working. You could also reduce the shadow map resolution for far away lights to make space in the atlas, but it's very game specific.
     
  3. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    304
    It's the size of the lighting data
     
  4. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    306
    Continuing to test APV. I found out that some models have problems with APV.

    For example this model here
    NVIDIA_Share_dr6c8L1zak.png

    The roof have dark splotch no matter what I tried.

    I tried to replace it with a scaled cube and the dark splotch disappeared. (tried also with double-sided quad with no problem)

    NVIDIA_Share_6cXIeaKbXo.png

    Model from here
    Survival old House | 3D Urban | Unity Asset Store
     
  5. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    304
    It looks like you are doing partial bakes, if you load all the scenes part of the baking set that should work correctly
    But i maanged to repro the issue, i'll fix it.
     
    pbritton likes this.
  6. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    304
    You can use the debug probe sampling tool to view which probes are being sampled.
    It's likely because of an invalid probe somewhere
    upload_2024-3-27_14-22-22.png
     
  7. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    306
    thanks. you're right the probes above the roof are all invalid.
    The fix is to mark the roof material double side.
    I have no idea why...
     
  8. camerondus

    camerondus

    Joined:
    Dec 15, 2018
    Posts:
    55
    no worries, and thank you! the changes you have made have been such a big QOL improvement to my project!
     
    adrien-de-tocqueville likes this.
  9. unity_27NFUoGCKItEVA

    unity_27NFUoGCKItEVA

    Joined:
    Dec 13, 2020
    Posts:
    2
    Unity 6 looks better with apv. After an usuable tech stream(2023.2.), is Unity 6 finally little bit better than 2023.1.20.

    Pros:
    Performance is better.
    It consumes much less GPU memory.
    APV is more precisely.

    Cons:
    Some errors with CPU mesh buffer.
    The baking process is weird. It starts at 50% and then immediately jumps to 99% where it is even baking.
    Still not usable without SSGI(ray marching)

    My interior test in Unity 6

     
  10. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    304
    guycalledfrank and Kabinet13 like this.
  11. camerondus

    camerondus

    Joined:
    Dec 15, 2018
    Posts:
    55
    @adrien-de-tocqueville i just updated to unity 6 beta 13, and no more errors when passing null to SetActiveBakingSet. however, it fails to unload the previous set of probes. also, sceneData.bakingSet still doesnt seem to exist
     
  12. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    304
    It's in the ProbeVolumePerSceneData not the ProbeVolumeSceneData (which is obsolete), see this doc.

    I just tested locally, and switching set with SetActiveBakingSet correctly unloads the previous set of probes, do you have more details on what fails ?
     
  13. camerondus

    camerondus

    Joined:
    Dec 15, 2018
    Posts:
    55
    Nevermind, i was mistaken, it does properly unload the probes when I pass null.

    Ss for grabbing baking set from the ProbeVolumePerSceneData, it does not appear to be working:

    upload_2024-4-6_0-18-20.png
     

    Attached Files:

  14. guycalledfrank

    guycalledfrank

    Joined:
    May 13, 2013
    Posts:
    1,678
  15. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    304
    this one is in beta 15 actually, so it's still a bit of time before it's out sorry about that
     
    camerondus likes this.
  16. Minos321

    Minos321

    Joined:
    Jul 7, 2018
    Posts:
    44
    Hello! I just upgraded to 2023.2 to take advantage of APV on URP. Is there any button to render ONLY the APVs? There used to be one on HDRP 2022. I'm using Bakery to bake my normals and the only way I found to trigger an APV bake is by actually hitting Bake Lighting, which is not an ideal workflow (ideally I bake lightmaps with Bakery and then only the Probes in the lighting Window). Is there a way to bake only the APVs?
    upload_2024-4-18_16-18-36.png
     
  17. Kabinet13

    Kabinet13

    Joined:
    Jun 13, 2019
    Posts:
    151
    There's a way to do that in the Unity 6 beta, but Unity 6 overall isn't the stablest yet. Good news is it'll be there in the LTS.
     
  18. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    304
    There wasn't a button to do that on 2022, but on unity 6 you can click on the arrow to the right of the generate lighting button and click bake apv, this won't bake lightmaps
    There's also a scripting api for it
     
  19. Minos321

    Minos321

    Joined:
    Jul 7, 2018
    Posts:
    44
    There was this one here:
    upload_2024-4-19_11-6-57.png

    On 2023 it's gone:
    upload_2024-4-19_11-7-21.png

    I'd love to switch to Unity 6 but I'm working on a VR project, already have a lot of problems to deal with :D

    I will take a look at the API, in the mean time, if anyone else figured out how to trigger the bake of APVs only, please share with us!
     
  20. Kabinet13

    Kabinet13

    Joined:
    Jun 13, 2019
    Posts:
    151
    I've been doing some testing with Sky Occlusion, but can't get rid of these noisy artifacts. The scene looks fine without sky occlusion turned on in the bake, but for whatever reason, the main SH data for the probes seems to be corrupted somehow, despite them being seemingly unrelated bake steps. upload_2024-4-20_15-16-7.png
    upload_2024-4-20_15-16-41.png
     
    Tigrian likes this.
  21. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    304
    This button used to also bake lightmaps, even if it was not written. There was no way to bake apv without lightmaps before unity 6.
    Note that the options to bake the full set or only the ative scene still exist but they are controlled by the checkboxes in the scene list at the top of the window, which gives more control on exactly what is baked
     
    Minos321 likes this.
  22. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    304
    When sky occlusion is on, sky lighting isn't included in the probes, so it's expected that they change value. It's still weird though, can you check the debug view when setting the probe shading mode to sky occlusion ? maybe the noise comes from there (the sample count for sky occlusion is a separate one in the apv tab)
    Also is your sun light set to mixed or baked ?
     
  23. Kabinet13

    Kabinet13

    Joined:
    Jun 13, 2019
    Posts:
    151
    I tried baking with both Realtime and Mixed for the directional light, but got identical results, the Sky Occlusion debug view also seems pretty stable. I attached another screenshot with the sky occlusion intensity multiplier set to 0, it seems the noisy areas just aren't affected whatsoever, and remain bright. (The first screenshot has the standard intensity multiplier)
    upload_2024-4-21_22-35-15.png
    upload_2024-4-21_22-35-37.png
     
  24. Kabinet13

    Kabinet13

    Joined:
    Jun 13, 2019
    Posts:
    151
    To illustrate the problem better, sky occlusion seems fine in the non noisy probes, and dims as I rotate the light appropriately, but the bright patches (I'm not sure what to call them, fireflies maybe?) are completely unaffected.
    upload_2024-4-21_22-41-3.png
     
  25. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    304
    I tried a bunch of setups but couldn't reproduce the issue locally.
    Last check, can you make sure the sample counts in the scene tab of the lighting window are high enough ? If yes then i would assume it's a bug so if you could report it with a repro project that would be awesome
     
  26. joshrs926

    joshrs926

    Joined:
    Jan 31, 2021
    Posts:
    116
    I'm trying to test APV but my Probe Volume component keeps saying "No profile information is set for the scene that owns this probe volume so no subdivision information can be retrieved." I'm new to HDRP. I'm sure this is something simple but I just can't find what setting I'm missing. I'm in Unity 2022.3.11 and HDRP 14.0.9. Any ideas?
     
  27. Kabinet13

    Kabinet13

    Joined:
    Jun 13, 2019
    Posts:
    151
    I checked with a variety of sample counts which didn't resolve the issue. The project has a bunch of unrelated stuff in it so I'll try to make a proper repro sometime soon.
     
  28. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    152
    Could you check 'Environment' tab? Your PBS should be ticked on and your global volume too.
     
  29. Kabinet13

    Kabinet13

    Joined:
    Jun 13, 2019
    Posts:
    151
    I've made a bug report with a small repro project, though it isn't through QA yet. Noise can be best seen in the SH constants of the probe volume debugger.

    You should be able to find the report under IN-75569
     
  30. wilgieseler

    wilgieseler

    Joined:
    Oct 17, 2013
    Posts:
    85
    FWIW I have the same problem as Kabinet13 with sky occlusion enabled.
     
  31. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    936
    lilacsky824 likes this.
  32. Kabinet13

    Kabinet13

    Joined:
    Jun 13, 2019
    Posts:
    151
    I honestly think it has to be a bug that APV works without the lightmapper enabled in the first place. That is some pretty crazy UX if it's intended.

    The checkbox is for Baked Global Illumination, which APV is, and it makes sense to have to enable it to access baked light specific settings, I feel like this could be improved by instead having a separate checkbox to enable lightmaps independently from baked GI in general. Under that system you would have the same amount of control as now (APV only lighting), while intuitively forcing you to enable baked GI. (I'm still shocked it works at all without that being enabled)
     
    lilacsky824 and sacb0y like this.
  33. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    936
    I think my problem comes down to they expect you to hit a sub menu to bake just APV lighting, when the natural inclination is to just hit the bake button.

    These things should be easily separated for the simplest operation. And turning off the Baked Lighting is how to get that.

    But I do also agree it doesn't make a lot of sense.
     
  34. madpolydev

    madpolydev

    Joined:
    Nov 23, 2016
    Posts:
    95
    anyone has any clue why the results are so poor despite 'high' settings and weird artifacting.



    fully static scene with emissive planes as shadow caster.
     
  35. camerondus

    camerondus

    Joined:
    Dec 15, 2018
    Posts:
    55
    try to increase your probe sample multiplier under the lightmapping settings
     
  36. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    936
    Use a probe adjustment volume and increase the samples.
     
    PaulMDev likes this.
  37. madpolydev

    madpolydev

    Joined:
    Nov 23, 2016
    Posts:
    95
    upload_2024-5-11_23-42-19.png

    adjusted the probe samples to 256 and it still looks like this. By the way, before I used beta and now preview and changing the probe sampling to 0.1 or 0.25 bakes to 99% and then jumps back to 50% (loops very long). Is nobody testing these? This is far from a proper lightmapping GI alternative... there are all these grid-y artifacts all around. Shadows look poor. There is absolutely no contact bounces grounding abolutely nothing.

    I havent figured out how to use probe adjustment volumes. Also, these bakes have alot of weird artifacts again (see pillar and wall)...
     
    Last edited: May 11, 2024
  38. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    936
    Setting the probe distance lower might be creating an insane amount of probes. It's hard to say what would cause the problem there could be unity or some kind of memory issue.

    There's gonna be some limits from light mapping due to probes, the main benefit is dynamic objects and easier blending. If you need that degree of detail and don't have a need for scenario blending it might make more sense for you to use both APV and lightmapping.

    That said it looks a bit more off than I would think, you'd need to experiment with adjustment volumes. I've fixed some issues like this but I haven't used APV enough just yet to diagnose issues from a distance.
     
  39. Kabinet13

    Kabinet13

    Joined:
    Jun 13, 2019
    Posts:
    151
    Try using the progressive GPU lightmapper, that banding on the wall feels wrong. Also try messing with view and normal biases if the indirect shadowing proves to be a problem.
     
  40. madpolydev

    madpolydev

    Joined:
    Nov 23, 2016
    Posts:
    95
    i will try to mess around when I get home. Really want to emphazie for unity to do a proper start to finish + potential trouble shooting guides. Its frustrating trying to navigate all around this, shooting in the dark. If you make a cool new system, have some of your artists showcase it.
     
  41. madpolydev

    madpolydev

    Joined:
    Nov 23, 2016
    Posts:
    95
    lightmapping would probably fix all of this but requires better Uvs etc. I hoped this would be a good alternative but again, if thats the output quality for fully baked shadows etc, then I think lightmaps are still better. Not expecting 1:1 lightmap results but fairly close would ve been good enough. All shadow bakes ive attempted so far have been quite a miss. Im sure mixed lights may look better but even they sometimes have those grid-y artifacts.
     
  42. madpolydev

    madpolydev

    Joined:
    Nov 23, 2016
    Posts:
    95
    upload_2024-5-12_19-58-1.png
    upload_2024-5-12_19-58-49.png
    used the probe adjustment volume so it only had probes within the room and not in between, then played around with bias etc. Using probe adjustment volumes produces these ugly grid result artifacts.

    By the way, I am using my laptop with 3050ti as a gpu. Not sure if that matters.
     
  43. Kabinet13

    Kabinet13

    Joined:
    Jun 13, 2019
    Posts:
    151
    Your lightmapper is still set to Progressive CPU, and those grid artifacts look like bugs, try it with the progressive GPU lightmapper, if that doesn't change anything try reporting a bug.
     
  44. madpolydev

    madpolydev

    Joined:
    Nov 23, 2016
    Posts:
    95
    thats officially the probe adjustment volume creating these artifacts.

    this is when i bake probe adjustment volumes:
    upload_2024-5-12_20-55-6.png
    this is without:
    upload_2024-5-12_20-56-1.png
    better but still alot of artifacts if you look at the wall etc, looks like ultra low light bake. samples were 128.

    I am kind of tired trying to fix it, this is a very simple test scene yet I am struggling to get any decent shippable results.

    Also, GPU was used for baking (progressive GPU) as suggested above.
     
  45. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    936
    Light maps are more detailed, but won't light dynamic objects as effectively.

    The reason you would want to use APV only is to ensure all your lighting is unified plus the other benefits. But it's unlikely to be as detailed as a lightmap.

    Don't just look at the baked scene, but also dynamic objects in that scene. It really comes down to needs. What kind of behavior are you looking for?

    Hm, what mode are you using with the adjustment volume? It seems like you might be using invalidation?
     
  46. madpolydev

    madpolydev

    Joined:
    Nov 23, 2016
    Posts:
    95
    i didnt change the setting of the adjustment volume. The most disappointing part to me in any case is that even with such a simple scene and using default settings, the scene is a buggy mess all over. I am using unity after switching from UE4 and so far anything I try from unity ends up being buggy or straight up not working and I spend hours looking for solutions. Honestly this should work straight out of the box without having these artifacts as shown above. I dont think thats too much to ask for. If I use the default settings, they should work and not put me in a troubleshooting spree. Its not like I am using complicated geo or anything.

    I see great value for open world scenes for this. I can imagine it properly darkening caves and other indoor areas. However, it would be great if it actually worked out of the box.

    https://forum.unity.com/threads/how-to-correctly-use-apv.1557113/
    this was asked by me month ago, and needless to say, the results look really bad. A version prior, it was straight up broken in URP and had a noisy cell like artifacting all over. So I am trying for months to get it to look good but no luck.
    Lighting is one of the most important part in games, so it would be great if we could get more detailed guides on these systems-
     
    Last edited: May 13, 2024
  47. sacb0y

    sacb0y

    Joined:
    May 9, 2016
    Posts:
    936
    I got some solid results with default settings recently; the problem is defaults don't work for all scenarios just initially intended scenarios.

    Much like light mapping, there's a learning curve. You're going to need to fiddle with those corrective volumes, the default settings won't do what you want i'm pretty sure.
     
    madpolydev likes this.
  48. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    306
  49. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    304
    I was planning to write about that today now that everything has landed !

    Based on your feedback here and in the surveys, we have been working on solutions to reduce light leakings in unity 6 (available starting 6000.0.4f1).
    These will get presented in more details during the webinar that will be live streamed on zoom on may 29, but here's a quick summary:
    • First change is to the leak reduction modes. Previous validity based leak reduction is unchanged but renamed to Performance in the UI. This mode is efficient but doesn't work well in all scenarios and very often invalid probes are still sampled resulting in leaking. Dilation can be used to mitigate the effects but it's not a general solution.
      A new 'quality' mode is added that keeps the same cost as performance mode in cases where it would work well, but can fallback on additional samples otherwise to ensure invalid probes are never sampled. On games were memory bandwith is a bottleneck, this will perform slower but on our measurements on PS4 on a 'regular' scene, we observed only a minor increase (between 0 and 0.1ms)
    • Second, we added support for storing a rendering layer mask per probe allowing renderers to only sample lighting from probes that share at least one common layer. A typical use case would be to use an interior and exterior layer. This proved very efficient when baking the tent in URP oasis sample scene and fixed most of the leaking issues while keeping a fairly low probe density. This relies on the leak reduction mode to exclude probes on other layers. Assignment is done automatically based on rendering layers assigned to renderers surrounding a probe, but can be modified locally by using adjustment volumes.
      This increases the memory usage validity from 1bit per probe to 4bit per probe both on disk and in GPU memory and requires light layers to be enabled in the SRP asset.
    • Additionally, we have implemented an automatic seam removal step between bricks of different subdivision levels to reduce the need to rely on sampling noise and TAA.
    • Last thing, we substantially improved loading times of APV when using a high amount of subdivision levels which will greatly help games with large worlds.
    Based on our internal testing, we are quite happy with the quality increase these new settings give while keeping the runtime cost under control. If you have any feedback please share them here as always :)
     
    Last edited: May 24, 2024 at 9:19 AM
    Onigiri, echu33, jiraphatK and 9 others like this.
  50. PaulMDev

    PaulMDev

    Joined:
    Feb 19, 2019
    Posts:
    73
    That's amazing, I can't wait to try it out!

    Small question, I'm getting a lot of noise when baking probe in dark environments, even at insane sample counts.
    Do you plan to improve this or is this just a limitation of APV?
    Either way, what you and your team have been doing is great. APV is becoming my go-to for baked lighting and it's cool to see it evolve like that.
     
    adrien-de-tocqueville likes this.