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

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

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

  1. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    Very unlikely, unfortunately as APV is still an experimental feature we are not doing backports.
     
  2. Oniros88

    Oniros88

    Joined:
    Nov 15, 2014
    Posts:
    150
    Does this work for realtime enlighten GI? As I saw lights must be set to "mixed".
     
  3. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    No, enlighten remains a completely different system.
     
  4. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    @francescoc_unity Any chance we can get somekind of probe placement preview before baking, either automated or on demand/manual update somekind of update probe placement button on Probe Volume component? having to bake the lighting just to see the probe placement kinda not intuitive
     
  5. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    You can already do that!

    upload_2022-3-31_18-17-33.png

    Some times we observed that a bake never ever happened than the checkbox doesn't work, but we couldn't repro said behaviour. If you baked at least once (even after you clear or change things radically) it should always work.
     
  6. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Oooh i thought that only work with baked data. Thanks for the info!!! i'll test it out
     
  7. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Just test the alpha build, the blend function are nice. What is the best practice for day-night transition though?
    Might gonna need a small example for that
     
    Last edited: Apr 6, 2022
  8. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    339
    It's amazing!
    does terrain support using APVs as indirect lighting in the alpha version?
     
  9. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    We might produce samples later on, what the best practices are really depend on your content (how many keyframe you need/can afford for example).
    Nice results btw!


    Not landed yet, I will notify the thread when the PR lands in our system.
     
    Last edited: Apr 6, 2022
  10. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Thanks. Also having a small example could help i think.
    It might be just my setup, but i find it hard to get a smooth transition from sunset > night time > sunrise.
    Also i find if we keep calling this line everyframe it eating the fps a lot.
    Code (CSharp):
    1. ProbeReferenceVolume.instance.BlendLightingScenario(TargetScenario, blendTime);
    Might want to add this into the docs if it's not exist yet, to remind people to call it on demand not everyframe.
     
  11. florianBrn

    florianBrn

    Joined:
    Jul 31, 2019
    Posts:
    53
    Wow, that's surprisingly good! How's the process? Do you need to bake every lighting conditions and APV just blends between those?
     
  12. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Yeah you need to bake each of the Light Condition (in the APV term it called LightingScenario), then from script you need to define the current active scenario and which scenario to blend.
    I'm using this script for my test, heavily modified of course since i'm using more than 2 scenario.
    https://github.com/Unity-Technologi...s/Assets/Scenes/007-BasicAPV/LightScenario.cs
     
    florianBrn likes this.
  13. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    Note that being in alpha we don't consider the feature done :) There is a bunch of improvement we already know that are about to land soon-ish.

    But yes, we'll need a section in the docs for this too.
     
    Reanimate_L likes this.
  14. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    Are the light leaking pulls in the latest public alpha?
    from my testing I can get pretty nice results with APV + SSGI. Would be a nice and welcome replacement for the regular lightmapping.

    I had to mess with the bias quite a bit to get a correct look, which in itself leads to some slight issues, but all in all it's looking promising :D

    for me SSGI was a must for good visuals in alpha9, it helps a ton with noise/weird artifacts and better lighting.
    The final issue I'd like to mention is SSGI cost is quite high even at the lowest settings so I can't treat it as a universal solution for public projects. (APV+SSGI that is)
     
  15. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    There should be a field in the Probe Volume options called Leak Reduction Mode, by default it is off (we are turning that On soon). I am not 100% sure it is in the latest alpha, but probably it is.

    There should be also a Touchup volume, but before we write documentation I'd steer away from those as they are double edged swords.

    Note again that while said option + touchup volumes + biases can get you a fairly good result in some situations, there might be cases where leaking will still be visible -- In such conditions either keep lightmaps (hopefully on less objects than before) or increase locally the density of probes and hopefully reduce organically the issue.

    The usual recommendation stand (e.g. don't have paper thin walls, favour high density where you thing where leaking might occur, etc)
     
    Last edited: Apr 6, 2022
    PutridEx likes this.
  16. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    While APV can greatly help SSGI, SSGI itself (not the APV fallback) is maintained by different developer, I suggest writing SSGI feedback on the main HDRP forum so it can end up to the right eyes :)
     
    PutridEx likes this.
  17. valarnur

    valarnur

    Joined:
    Apr 7, 2019
    Posts:
    440
    Could you put that on by default? I mean there isn't any practice where you would want meshes to leak light.
     
  18. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    As I wrote in parenthesis it will be on by default in the released version.

    Keep in mind while it helps it doesn't fix all the issues (and is super rare cases might lead to undesired effects, tho that we observed rarely)
     
    valarnur likes this.
  19. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    In 2022.2.0a9 and HDRP, I have a typical exterior architectural scene with only 2 buildings and some hard surface floors, paving, parking etc. (about 600m X 600m). No plants yet. 1 grey material applied to everything for now.

    I set everything to static, however in each object, I DID NOT manually set it each object's "Receive Global Illumination" setting to Light Probes, instead, left it on Lightmaps. There are too many objects to manually switch this 1 by 1
    We need a different mechanism to switch this setting, or some kind of editor script to change all selected objects (even if those objects are inside a hierachy)

    Anyway, I thought the baking was suppose to be quick?!? In my Ryzen 9 5950X and RTX 3090, its estimating the scene will take 1 hour to bake on default settings. However, it keeps fluctuating between 40 min and 55 min, and the time doesnt get less, but seems more like increasing...

    Is this APV, meant to eventually be similar to Unreal's Lumen system?

    EDIT1: Now its already sitting on an estimated 3.5 hours!

    EDIT2: It briefly jumped to 16 hours, now its on 4 hours

    EDIT3: OK I geuss this is still way too experimental to even be attempted in an actual project sized test. Fine in a scene with 3 cubes, but any real project and seems dont bother for now.

    EDIT4: Actually let me hide most obejcts and switch that receive gi setting to probe volume on a handfull of objects and see
     
    Last edited: Apr 7, 2022
    Deleted User likes this.
  20. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,735
    You’re probably just regular light mapping.
    No.
     
  21. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Nope, its using the APV bake:
    upload_2022-4-7_13-18-49.png

    I had 5 objects visible, and that seems to go in few seconds. Now swiched on my other objects, and its just sitting there

    EDIT: It kicked in and telling me 12 hours!
    upload_2022-4-7_13-20-53.png
     
  22. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    you probably still are baking all light maps in scene. I think the AVP baking button still triggers this.
     
  23. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,735
    If you have set the meshes to receive global illumination via light maps you are baking both light maps and APV. And light mapping is probably the one taking forever.
     
  24. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    I only have 1 directional light in the scene, the sun
    upload_2022-4-7_13-24-1.png

    So what are you guys saying? I'm doing somethign wrong. or AVP automatically triggers regular light mapping also?
     
  25. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    All my meshes are set to this now:
    upload_2022-4-7_13-25-31.png

    I have no light probes in my scene or setup as far I know
    Only the AVP. Am I still doing something wrong?
     
  26. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,735
    No this seems correct. Does it still take forever?
     
  27. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    yes :-(
     
  28. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    what's your lighting mode in lighting window? maybe you are baking the shadowmaps?
     
  29. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    My sun settings:
    upload_2022-4-7_13-41-51.png


    My AVP setting:
    upload_2022-4-7_13-42-14.png

    Lighting:
    upload_2022-4-7_13-42-31.png
     
  30. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    I'm trying the latest 512.15 NVidia studio driver and see if anything changes...

    I have SSGI on. Can I use that together with AVP or I'm suppose to switch it off?
     
    Last edited: Apr 7, 2022
  31. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    339
    turn on "Override subdivision levels" in your probe volume.
    then set the "Highest Subdivision Level" a lower value, that will greatly decrease the baking time.
    in my experience 2 or 1 is good enough, for testing purpose you could use "0".
    make sure everything in your scene are set to "Receive Globe Illumination" with "Light Probes"
     
  32. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    That seems to have done something. It took about 7 seconds this time. Will see the probes visually and switch on/off to see if it actually did anything. Back soon...
     
  33. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    Getting somewhere now it seems.

    I set the override subs to:
    highest = 3
    lowest = 0
    probe distance between 1m and 27m

    however, I'm getting some nasty artefacts looking from the interior of one of my buildings:
    upload_2022-4-7_14-29-38.png

    Temp switching off the APV and just having SSGI:
    upload_2022-4-7_14-30-34.png

    Is there any settings I can adjust to adjust light leaks or get rid of those nasty black artefacts?
     
  34. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,248
    upload_2022-4-7_14-32-18.png

    What does this "Normalize Reflection Probes" do in the Probe Volumes? I'm not using ANY reflection probes, only SSReflection
     
  35. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    867
    I was only able to get rid of artifacts in interior by setting the probe distance really low (like 0.1), but this will very likely increase your baking time again drastically.
     
    newguy123 likes this.
  36. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    Instead of changing those setting if it is for a global override you should change the settings in the Baking Setting page

    That allows for much finer control rather than changing the whole subdivision level (which is going to move in steps of power of 3)

    Step3 here


    Also @newguy123 make sure to tune the biases (see step 4) and that you have dilation and virtual offset enabled.

    Also if you have a very recent alpha, make sure to enable the Leak Reduction mode (in the volume settings referenced still in step 4)
     
    LumaPxxx and newguy123 like this.
  37. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    What is the touchup volumes for? or what it do actually?
     
  38. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    Leak reduction doesn't seem to be in the latest alpha from my testing. I found no option for it anywhere. I believe it's meant to show in the volume options.
     
    newguy123 likes this.
  39. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    As I mentioned it is tricky before we write docs for them :)

    Essentially the crude anti leaking we have there is using validity information to assume occlusion, the touchup volume allow to forcefully invalidate some probes for the sake of the leaking prevention (e.g. probes that are very very close to a wall, but not actually inside so they are considered valid).

    Similarly in more future versions, we will allow to scale the intensity of probes falling within said volumes; though this latter should be used extremely carefully as abusing said feature will introduce a lot of inconsistency in the lighting.

    Note that all of the actions that touchup volumes do are still at probe level and not per pixel.
     
  40. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    it's a volume you place to manually invalidates probes that are causing light leaking.
    In a way it's manual light leak prevention. Pretty nice compromise.
     
  41. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    It should, so I guess is not in yet; should be there soon if it is not there.

    Note that is in advanced features, have you made sure to see if you have additional properties enabled?
     
  42. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    Yup, additional properties are enabled. I've also seen screenshots of it in the pull showing the settings for it so I think I was in the right place.
     
  43. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    and i'm getting this, where probe volume are already enabled in the project?
    upload_2022-4-8_0-2-52.png
     
  44. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    Do you have it enabled in all the places? We had a bug similar in the past that got already fixed, but likely not in the shipped alpha yet.
     
  45. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Turning the editor on and off fixed it apparently :|
    Oh neat, using touch up volumes can fixed the leaking (in my test scene)
    upload_2022-4-8_1-6-37.png
     
    Last edited: Apr 7, 2022
  46. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    Nice! :)

    Touchups are a bit of a blunt instruments, they can help a lot, but can also be dangerous, be mindful when using them :)
     
    Last edited: Apr 7, 2022
  47. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    I see so it's invalidate any probe inside of it, i thought it was somekind of Clip Shape GI Volume like Treyarch GI tech
     
  48. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    Yes, to keep the cost entirely at baking time and have no impact on the runtime cost.
     
    hippocoder likes this.
  49. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    @francescoc_unity I forgot if i ask this question already or not. Will APV have a sky occlussion to occlude skylight and sky reflection?
     
  50. almkaz

    almkaz

    Joined:
    May 30, 2019
    Posts:
    3
    I'm running into an interesting situation using the Probe Volumes. I am using 2021.2.18f and on the scenes where APVs are used, I bake lighting and my dynamic objects look great. However, on a few of my scenes I'm using all realtime lights, do not enable APVs on the camera, nor have any volumes in the scene. In the editor (play mode or not) my dynamic objects look great. When I make a build, the dynamic objects look too dark. The thing is, if I disable APVs at the settings level and rebuild, these scenes look good - so it's almost like the APV-aware Lit shaders are acting differently even though I'm not using them in these scenes. Any ideas on what I could try, is this an actual issue with the current alpha implementation?

    capture.png
     
    OBiwer likes this.