Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

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

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

  1. valarnur

    valarnur

    Joined:
    Apr 7, 2019
    Posts:
    443
    For the future APV, would it be possible to create realtime, no baking probe-based lighting specifically for games targeting high performance and quality?
     
    ftejada and florianBrn like this.
  2. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,281
    Will Enemies, and Lion, ever come to community as demo projects, or they're just in a long list of things the community will never get to play with?
     
  3. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    Can we get a glimpse at the APV features and improvements planned for 2023? I'm hoping I can use APV and replace light probes (and some small static objects) in 2023.

    I tried to use APV in 2022, unfortunately there's a lot of sample noise/artifacts, also noticeable on dynamic objects, movement and transitioning between probes. And I can't realistically use SSGI to clean up the noise by default due to performance concerns.
     
    Last edited: Aug 10, 2022
    florianBrn likes this.
  4. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    The feature are available in github, not the demo though, but enough to import your own asset and try to reproduce the demo.
     
  5. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    Part of the noise can be reduced in volume settings if that is the issue you are seeing. Alternatively it sounds like you would need to crank up the sample count in the lighting window.

    Not sure what you mean by issues while moving given that there is nothing temporal in the system.
    For the transitions problem, you mean between different resolution, it might be that you need to make areas filled with higher resolution probes, you can do that easily by adding a probe volume and override parameters including the fill empty spaces if needed
     
    valarnur and PutridEx like this.
  6. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    But when will the Siggraph video land ...
     
  7. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    APV really pushes volumetric fog quality, ends up looking so much better with APV.
     
    KRGraphics likes this.
  8. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,489
    Good evening. So I've taken APV for a spin and it's quite easily to set up my scene but I'm having some difficulty having the probe volume take the sky into account (I'm using a sky volume and it's set to HDRI sky.)

    How do I get the sky working with the APV? Thank you
     
  9. MaxWitsch

    MaxWitsch

    Joined:
    Jul 6, 2015
    Posts:
    114
    It does work as usual Lightmapping.
    Have you checked the Environment tab in the lighting settings?
     
  10. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,489
    Yes. I had my Volume set to an HDR of a cathedral and the probes would only cover half my character. I'm using a simple LookDev scene with a plane and a character model, and wanted to make sure it would play nice before I did anything else.

    @francescoc_unity as this is my first time using APVs, I also think that they should generate lighting if I also hit generate in the usual lighting tab. I was getting issues where only half if my character (he is a dynamic object) was getting hit with probes. And also the probes DID NOT stay within the bounds of the volume. I'll do a render in a bit
     
    Last edited: Aug 21, 2022
  11. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,489
    Here is a test render of APV in my current LookDev scene, and notice while the scene baked correctly, the sky was NOT taken into account. Look at where the probes are too, it's not filling the volume as I am expecting it to. How can I ensure that this will take the full environment into account? Since I will be using Enviro in a lot of my scenes and most of my levels will be outdoors, this is very important.

    The floor plane is set as Static and to receive global illumination as a lightmap (old habits die hard) unless I can just use the probes, but I am using the Lightmapping for irregular shapes. I'll have to build an actual level to really test this upload_2022-8-21_8-53-47.png upload_2022-8-21_8-54-2.png

    And here is shot of APV using a character that has Subsurface scattering on him. Man this looks incredible, but I want the probes to stay IN THE VOLUME. Remember the Original Light Probe Volume? Exactly like this
     
  12. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,489
    upload_2022-8-21_10-21-3.png

    I'm starting to like this APV feature. It even plays nice with Subsurface Scattering too. There are NO ACTIVE LIGHTS in the scene, just the sky.
     
  13. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    Yeah workflow is bound to change and will mostly move to the generate lighting tab.

    Re: your placement issues, note that probes are placed around static geometry - so areas without geometry won't have probes inside. Newer versions of the engine than yours (am in vacation so cannot check exactly which one :) ) have an option to also fill empty space with probes.

    The plane doesn't receive placement in your example from bugs we fixed since with infinitely thin objects. Again apologies can't tell you exactly what version fixed it yet.
     
    Last edited: Aug 22, 2022
  14. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,489
    No problem. I'll have to test this further with a note complex scene with more geometry and more sky details. I actually did hit the generate tab in the lighting panel and the probes work very well. Also did a test with no sky and emission and it looked really good. Even with subsurface scattering
     
  15. impheris

    impheris

    Joined:
    Dec 30, 2009
    Posts:
    1,747
    thanks i had the same problem
     
  16. Chris_Webb

    Chris_Webb

    Joined:
    Mar 18, 2014
    Posts:
    129
    Hello,

    Is there a recommended way to programmatically add a scene to a baking set? As part of our build process, we generate scenes and I would like to automatically get those in the correct baking set. It seems like a lot of the things required to do this are marked as internal unless I am missing something.

    We also seem to be having an issue when baking in batch mode from our build machines. We get the exception:

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2.   at UnityEngine.Experimental.Rendering.ProbeGIBaking.FindWorldBounds (System.Boolean& hasFoundInvalidSetup) [0x0008a] in D:\Jenkins\workspace\SkyFights_Bake\SkyFightsUnity\Library\PackageCache\com.unity.render-pipelines.core@13.1.8\Editor\Lighting\ProbeVolume\ProbeGIBaking.cs:135
    3.   at UnityEngine.Experimental.Rendering.ProbeGIBaking.OnBakeStarted () [0x00016] in D:\Jenkins\workspace\SkyFights_Bake\SkyFightsUnity\Library\PackageCache\com.unity.render-pipelines.core@13.1.8\Editor\Lighting\ProbeVolume\ProbeGIBaking.cs:198
    4.   at (wrapper delegate-invoke) <Module>.invoke_void()
    5.   at UnityEditor.Lightmapping.Internal_CallBakeStartedFunctions () [0x0000d] in <bccfc7dedc604845b69da832e24281ea>:0
    6. UnityEditor.Experimental.Lightmapping:Bake_Injected(Scene&)
    7. UnityEditor.Experimental.Lightmapping:Bake(Scene)
    As a result, no probe assets are created.

    This doesnt seem to happen when running the same script from the editor.

    To bake the scenes, we are simple iterating over all of the desired ones and baking them in this manner


    Code (CSharp):
    1.                 Scene sceneToProcess = EditorSceneManager.OpenScene(AssetDatabase.GUIDToAssetPath(assetReference.AssetGUID),
    2.                                                                     OpenSceneMode.Single);
    3.  
    4.                 SceneManager.SetActiveScene(sceneToProcess);
    5.                 Lightmapping.Bake(sceneToProcess);
    6.                 EditorSceneManager.SaveScene(sceneToProcess);
    7.                 EditorSceneManager.CloseScene(sceneToProcess, true);

    We are using 2022.1.11f1

    Thanks :)
    Chris
     
    Last edited: Aug 26, 2022
  17. Chris_Webb

    Chris_Webb

    Joined:
    Mar 18, 2014
    Posts:
    129
    Hello,

    While debugging some of our struggles with getting probes to bake programmatically, we encountered an issue where the ProbeVolume UI was always saying the volume had changed all the time.

    Upon stepping through, it appears that ProbeVolume.GetHashCode is not stable through Unity restarts, and specifically objectLayerMask.GetHashCode() is the issue.

    This doesn't seem to be doing what is desired as there is no LayerMask implementation, so it ends up doing a Object GetHashCode which is scary, and changes each unity run. Perhaps LayerMask needs a hash implementation, or LayerMask.value.GetHashCode is desired here.

    Thanks,
    Chris
     
  18. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    Hey Chris! I am coming back from vacation later today and I'll schedule looking at what the current state as soon as I am done catching up :)

    Will look at this too, thank you for the report!
     
  19. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,489
    I've also been testing out the APV and I wish that any probe volume added to the hierarchy in the current scene is added to the baking sets of the currently open scene, which should make life so much easier.

    Also, it would be nice if there was a button to add the currently loaded scene because if you have a lot of scenes in your project, that list gets very long
     
  20. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    isn't that how it currently works? as long as the scene are included in baking sets any probe volume in scene hierarchy are automatically added into the baking sets.

    i second this, also drag and drop scene file/s into the baking sets scene list
     
  21. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,489
    I'm not entirely sure about the auto appending of the APV, but I don't like how they don't stay within the bounds I set, especially for characters.
     
  22. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    what do you mean by the probe not stay within the bounds? character? can you show screenshot?
     
  23. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,489

    upload_2022-8-31_12-4-41.png
    Like this.
     
  24. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    937
    this is somehow related to the subdivision. if you increase the lowest subdivision level, it would start filling in the blank area. The placing algorithm in 2021.x does not seem to be very advanced yet. I read somewhere in this thread that there are lots of improvements in later versions.
     
    KRGraphics likes this.
  25. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,489
    I'll be keeping an eye out. I love how it cuts down the time that would usually be reserved for placing probes
     
  26. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    ah @francescoc_unity already explained above about that one.
    also it kinda remind me of Forza probe placement

    i think Need for speed GI Probe also using similar placement, not uniform grid probe
     
    AntonioModer likes this.
  27. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,489
    This was a very interesting video and a neat way to optimize their usage. For example, if I were doing a fighting game level, a majority of the probes would be in the fight area and I would have a sparse volume for props and buildings.

    I would use this for the terrain and foliage
     
  28. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    397
    Last edited: Sep 5, 2022
    PutridEx likes this.
  29. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    No, APV won't use it for now due to the significant additional cost. We don't exclude in the longer run that we'll make use of it, but is not in the immediate plans.

    Also there are some issues with the data coming from it that the lightmapping team should be aware of.
     
    Kolyasisan likes this.
  30. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    Can you actually please file a bug? It'll help tracking the issue properly instead of my reminders on slack :D
     
  31. Chris_Webb

    Chris_Webb

    Joined:
    Mar 18, 2014
    Posts:
    129
  32. adslitw

    adslitw

    Joined:
    Aug 23, 2012
    Posts:
    276
    PutridEx likes this.
  33. DragonmoN

    DragonmoN

    Joined:
    Nov 27, 2016
    Posts:
    26
    Is there a Changelog on APV Iterations and/or Info on which APV Version can be found in which Unity Editor Version?
     
    Qleenie likes this.
  34. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    No precise timeline I can give you, but work is in progress as we speak.

    APV changes are in the SRP Core changelog alongside other changes
     
    PaulMDev, valarnur and adslitw like this.
  35. DragonmoN

    DragonmoN

    Joined:
    Nov 27, 2016
    Posts:
    26
  36. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
  37. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    6,493
    Oh I was wrong apv don't place probe at surface only lol. There is probably something to investigate here.
     
  38. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    937
    Are we able to access APV data from within Shader Graph? Is this integrated into any of existing nodes, like Baked GI?
     
    impheris, MaxWitsch and PutridEx like this.
  39. Chris_Webb

    Chris_Webb

    Joined:
    Mar 18, 2014
    Posts:
    129
    Hello,

    We have been having an intermittent issue with APV where the scene ambience flickers based on the camera direction (neither of the flicker states are actually correct, either). It seems that probe based lighting works fine for us as soon as it is baked, but after reloading the scene, APV never seem to work again.

    I have attached an image of the correct (straight after bake) lighting, and the two bad lighting states (obtained by wiggling the camera)

    In this test scene, the house and grass use probes.

    Unity 2022.1.11f1
     

    Attached Files:

  40. Chris_Webb

    Chris_Webb

    Joined:
    Mar 18, 2014
    Posts:
    129
    I have also noticed sometimes we get long streaks of broken probes.

    upload_2022-9-20_17-0-58.png

    upload_2022-9-20_16-59-31.png
     
  41. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
    Unfortunately no

    Uhm definitively not seen this behaviour any time recently, but 22.1 is fairly far back w.r.t. APV development so it might be something that we fixed later on?
    If you could cook a small repro and open it'd be nice and we can double check if it happens on latest or not and see if we could backport if the fix is trivial, unfortunately given that APV is experimental in 22.1 we are not doing backports (a lot of substantial architectural changes have been made since)


    Are you using GPU lightmapper by any chance? We noticed bad behaviour with that in the past.
     
  42. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    It seems that GI dimmer option in volumetric fog is not working when using APV, 2023.1, haven't tested previous versions
    It was an old project I upgraded to 2023, not sure if that has something to do with it

    edit: seems to work on a different project, so maybe false positive
     
    Last edited: Sep 20, 2022
  43. Qleenie

    Qleenie

    Joined:
    Jan 27, 2019
    Posts:
    937
    Does this mean it's also not planned? I guess it would make sense to integrate this.
     
  44. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,281
    APV has changed so much in 2023, that the initial instructions in post 1 of this thread is totally useless.

    I figured out how to enable it in HDRP settings/asset and add it to the scene, but then to actually generate and use it, I can't figure that out...

    I'm also using raytracing in my scene by the way and I have a large sttic building only in scene with a single ligth saource, namely the sun (directional light)
     
  45. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193

    It shouldn't be too dissimilar yet; what are the steps you are taking? Are you sure your light is tagged as mixed or baked?
     
  46. francescoc_unity

    francescoc_unity

    Unity Technologies

    Joined:
    Sep 19, 2018
    Posts:
    193
  47. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,281
    Frankly I dont know what is going on after I placed the APV
    I deleted it since I could not get it to work.

    Now I placed it back in again to screesnhot my settings to you, however now its even worse as my sy sun is stuck on realtime and I cant switch it to mix for unknown reasons.

    My sun (stuck on realtime)
    upload_2022-9-28_10-37-43.png

    My probe volume (no matter what I do, that baked message does not go away)
    upload_2022-9-28_10-39-6.png

    Lighting settings:
    upload_2022-9-28_10-40-47.png
     
  48. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,281
    if I press bake, it has some data, although it says 0 B:
    upload_2022-9-28_10-41-34.png

    show probes, but I dont see any:
    upload_2022-9-28_10-42-39.png
     
  49. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,136
    tick baked global illumination in settings
     
  50. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,281
    ok, but then it will just bake regular light maps isnt it?