Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. 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. Skokon

    Skokon

    Joined:
    Jul 23, 2017
    Posts:
    74
    Yeah it does, I have some questions regarding APV

    1- Will Someday APV be considered replacement for lightmap baking? and when? (expected time like this year or after this year)
    2- Is there some kind of detailed unity documentation to fix the light leaks of APV? I've seen the video but it doesn't explain it very well
    3- Is there preferred settings for APV to get the best result and avoid light leaks?
    4- Does these settings affect apv? (Direct samples, Indirect samples, Env samples, Max bounces, Lightmap resolution, Lightmap Padding, Max lightmap size, Albedo boost and indirect intensity)

    And thank you!
     
  2. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    117
    Thank you so much! This would be a great thing for optimizing the performance on low end and mobile devices. I will say, I like the mixed (L0, L1 ver pixel and L2 per vertex) option. It offers a nice tradeoff.

    On UE5 their equivalent of APV only does per object (like the old probe system) for all mobile devices. I'm glad Unity is more configurable, since it seems like a bit of a waste to have a new probe volumes-like system under the hood and not utilize any of its improvements.

    Good work so far!
     
    Last edited: Jun 8, 2023
  3. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    117
    I believe Light mapping will be around for a long time. This can replace it in some situations, but there will always be cases and scenarios that are better fitted to lightmaps. I don't think it is meant to be a lightmap replacement, but it seems designed to be a viable alternative in many cases, and in others to work together with lightmaps.
     
  4. Stepan_33

    Stepan_33

    Joined:
    Nov 21, 2022
    Posts:
    26
    I still have a problem with enabling (APV)
    (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.1) the tutorial didn't help



     
  5. echu33

    echu33

    Joined:
    Oct 30, 2020
    Posts:
    58
    For Anyone Want To Test APV in URP

    To enable APV in URP, go to the univsesal renderpipeline asset your project currently use.
    (can be found via Project settings->Graphics->Default render pipeline).
    upload_2023-6-11_8-43-20.png

    Once inspect the URP asset. Under Lighting category,
    Switch the Light Probe System From Light Probe Groups to Probe Volume.

    upload_2023-6-11_8-39-55.png

    Then yoo are good to go.:)

    upload_2023-6-11_8-45-16.png

    ===========================
    Feedback to Unity :

    1. The UX workflow definetly has space to improve though. I'm using URP for years and it still took me quite a time to find it lol.

    2. I really enjoy the result and process of using APV. It require much less time/memory to light the scene with per-pixel probe lighting (WOW!). Looking forward to it.

    Another complain :
    I've ask somthing like HDRP setup wizard(cuz I love it) for URP in a blitz day post and the URP staff ask me why I'm not create a urp project directly through Unity Hub (I have no words).This is one of the case that a setup wizard can be really helpful.
    ===========================
     

    Attached Files:

    Last edited: Jun 11, 2023
  6. Stepan_33

    Stepan_33

    Joined:
    Nov 21, 2022
    Posts:
    26
    Thanks a lot this guide helped me to enable (APV)
     
  7. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    153
    1. Hey, i just made a change to add an open button on the message to find the setting quickly, hope that helps.
    2. Additionally, with recent versions clicking generate lighting will create a baking set if none exists and show a popup asking to place a probe volume game object if none have been created, so most of the setup should already be automatic. Do you have suggestions on what could be put in the wizard ?

    upload_2023-6-12_10-49-19.png
     
    newguy123 and echu33 like this.
  8. echu33

    echu33

    Joined:
    Oct 30, 2020
    Posts:
    58
    Hey Adrien.Thanks for the quick adjust that was quick! I think the button along will be enough here.

    ====================
    Speaking of wizard. I'm more about the wizard for URP, which does not exist(I think) at the moment. However, since URP and HDRP are moving towards a more unified/coexistent direction, a setup wizard for URP could help people quickly set up and navigate through the required SRP assets. It's just a small suggestion:) I don't meant to derail this thread from APV topic too much.
    ====================
     
    adrien-de-tocqueville likes this.
  9. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    153
    1- As already said above, they are meant to coexist as generally APV is easier to use, but lightmaps can provide higher quality results than probes, even at very high probe density
    2- There is a page in the doc explaing how to fix common issues
    3- Unfortunately no, it depends a lot on your content
    4- They all do except Lightmap resolution, Lightmap Padding and Max lightmap size
     
  10. The64thGamer_

    The64thGamer_

    Joined:
    Aug 4, 2019
    Posts:
    14
    Any ideas on this still? As far as I can tell the URP version of APV doesn't pass through any APV data through the Baked GI node.
     
  11. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    153
    Sorry for the late answer, the changes to the node haven't been ported to URP indeed, it's HDRP only. I'll fix that now
     
  12. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    117
    One thing I will stress for anyone reading this who is curious, if your scene is fairly dark (ie space themed/moody/shadowy) without much light, you will NOT be happy with using APV on most of your game objects. For this, Lightmapping is going to be the best way to go. For anything that receives even moderate lighting though, you should give this a try. With some other modifications to the scene you can get this working quite nicely.
     
  13. pbritton

    pbritton

    Joined:
    Nov 14, 2016
    Posts:
    150
    Can anyone confirm that APVs are attached to the first loaded scene with the APV? To give some context, I am loading scenes additively and removing them as they are out of range. However, if the first scene is unloaded the APV is also unloaded for all the scenes despite being part of the same set. Is this intended? Hopefully, I am making sense.
     
  14. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    153
    Hello, which version are you using ? This is not expected, the baking set should stay loaded as long as at least one scene of the set is loaded.
    I just tested what you are describing on latest 23.2 and it's working correctly, unloading a scene only unloads cells that are not needed anymore.
     
  15. pbritton

    pbritton

    Joined:
    Nov 14, 2016
    Posts:
    150
    I am using 2023.1. My current solution is to keep a dummy scene actively loaded with a Probe Volume. If I allow the scene to unload, the APV disappear from the scenes that are loaded.
     
  16. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    153
    So indeed there is something like that happening but it's expected.
    When you unload a probe volume, you unload cells that were baked at that location (unless there is another probe volume overlapping). So if you have a single big probe volume, you should always have this one loaded i guess, but if you have a probe volumes for each scene for example, unloading a scene will only unload the cells associated with it
     
  17. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    117
    Using this with Lightmapping as well on URP with Entities package. However, it seems the lightmaps are not converting correctly, but APV is. So probe lit objects look great and lightmapped object are both extremely bright and extremely dark.
     
  18. Kabinet13

    Kabinet13

    Joined:
    Jun 13, 2019
    Posts:
    51
    That's really interesting, what do you mean by "converting"? It's probably a bug from the sounds of it. Do you have a screenshot? Just to help out any unity staff who might be able to investigate the problem for you.
     
  19. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    117
    I mean Subscene conversion to ECS. The Entities Graphics package seems to have it, but somehow it is not rendering with the lightmaps correctly.

    Edit:
    FYI, I have narrowed it down to the Entities.Graphics package.
     
    Last edited: Jul 1, 2023
  20. pbritton

    pbritton

    Joined:
    Nov 14, 2016
    Posts:
    150
    I reverted fix and now it works as expected.o_O
     
  21. Misaki_eKU

    Misaki_eKU

    Joined:
    May 3, 2018
    Posts:
    48
    Will the team continue to improve the light leaking issue?
     
  22. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    153
    We have improvements planned for virtual offset.
     
  23. pbritton

    pbritton

    Joined:
    Nov 14, 2016
    Posts:
    150
    Well APV turning off when certain scenes are unloaded has returned despite all the active and loaded scenes are part ot the same bake set.
     
  24. Misaki_eKU

    Misaki_eKU

    Joined:
    May 3, 2018
    Posts:
    48
    Will this fix the light leaking problem from thin wall?
     
  25. cakeslice

    cakeslice

    Joined:
    Oct 18, 2014
    Posts:
    197
    Is there a way to change the contribution type for MeshRenderer in a editor script?

    upload_2023-6-27_12-0-33.png
     
    echu33 likes this.
  26. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    153
    yes you can do that
    Code (CSharp):
    1.                         meshrenderer.receiveGI = ReceiveGI.LightProbes;
     
    cakeslice likes this.
  27. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    153
    Is the Probe Volume gameobject part of the scene that you unload ?
     
  28. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    153
    Maybe not, did you try the suggestions from the doc to fix your light leaks ?
     
    Kreshi likes this.
  29. pbritton

    pbritton

    Joined:
    Nov 14, 2016
    Posts:
    150
    Yes! I am using the Probe Volume gamebobject for each of my scenes.
     
  30. Misaki_eKU

    Misaki_eKU

    Joined:
    May 3, 2018
    Posts:
    48
    It's still impossible to fix some light leaking issue if I use probe volume only. Is it possible to implement visibility check? Which store depth data of each probe in another texture.
     
    Kreshi likes this.
  31. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    153
    Unfortunately this is prohibitively expensive performance wise.
    We actually have a small improvement for normal bias that helps in some cases with dynamic objects, but that's not a magic fix either.
    Can you share more details on the leaking you are talking about ? or is it that for a large scale world manually fixing them requires too much work ?
     
  32. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    153
    I would think there's a setup issue but without more details it's hard to say. Maybe you can try to file a bug report so that i can see more clearly what's happening
     
  33. BRGames_

    BRGames_

    Joined:
    Jun 24, 2021
    Posts:
    18
    I'm using Unity 2022.3.0. From the "Probe Volume Settings" I see that I can create different Lighting Scenario and this is fantastic (I need a scenario for day and another for night), how can I switch from one to another from code? (event without blending... just set the "Active Scenario" from code.
     
    Last edited: Jun 29, 2023
  34. Misaki_eKU

    Misaki_eKU

    Joined:
    May 3, 2018
    Posts:
    48
    Is there any other way to improve the light leaking? For example is it possible to have a system similar to light layer? What problem I have now is if I push the probe on the wall in, the foliages on other side will be very dark; if I push it out, the wall and objects inside will be very bright.
     
  35. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    153
    link to an older post where i list all the API for scenario from script
    https://forum.unity.com/threads/ada...r-hdrp-in-2021-2.1238824/page-10#post-8945400
     
    tmonestudio likes this.
  36. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    153
    That's the kind of issue that should be fixable by using normal bias, so that inside walls will bias their sampling position towards the interior of the room
     
  37. BRGames_

    BRGames_

    Joined:
    Jun 24, 2021
    Posts:
    18
    Thank you for sharing!

    I've just one last doubt. It seems that the BlendLightingScenario is not smoothly blending between the two scene, I actually experience an sudden change from scenario 1 to scenario 2.

    I'm also trying to animate the scenarioBlendingFactor variable... but without any success:

    Code (CSharp):
    1.        
    2.         // The active scenario is "Scenario_1"
    3.         ProbeReferenceVolume.instance.scenarioBlendingFactor = 0;
    4.         ProbeReferenceVolume.instance.lightingScenario = "Scenario_2";
    5.         DOVirtual.Float(0, 1, 2, (fl) =>
    6.         {
    7.             ProbeReferenceVolume.instance.scenarioBlendingFactor = fl;
    8.         });
    9.  
    Is there anything wrong with my understanding of the API? please note I'm on Unity 2022.3.0.

    Thank you
     
  38. Bitwak

    Bitwak

    Joined:
    May 10, 2014
    Posts:
    21
    I'm currently working on a single scene where I dynamically enable and disable GameObjects at runtime. The scene follows a specific architecture with World_A and World_B, which can be activated or deactivated as needed.

    Scene Structure:

    Code (JavaScript):
    1.  
    2. Scene
    3. |
    4. |___Shared_items (active)
    5. |       |___Various items
    6. |
    7. |___World_A (active)
    8. |       |___Cubes
    9. |
    10. |___World B (not active)
    11.        |___ Spheres  
    To properly bake lighting probes, I manually toggle the activation of World_A and World_B and perform the necessary baking for each scenario, resulting in two different lighting scenarios: "lights_A" and "lights_B." However, I've encountered a challenge where baking probes for World_B marks the previously baked lighting scenario for World_A as "out of date," and vice versa when baking probes for World_A with World_B already baked. This has led me to consider the best approach for handling multiple lighting scenarios in a similar context.

    One potential solution I'm contemplating is splitting the scene into separate scenes, each with its own dedicated probe volume. This way, I could maintain the Main Scene and dynamically load the desired subscenes (World_A or World_B) during runtime. In this approach, it would be advisable to utilize different Bake Sets for each "world" scene, ensuring proper isolation and updating of lighting data for each specific scenario... is this the right way to go or can I keep all the "worlds" in the same scene and some how bake the 2 lighting scenario?
     
    Last edited: Jun 29, 2023
  39. Bitwak

    Bitwak

    Joined:
    May 10, 2014
    Posts:
    21
    If anyone else requires the aforementioned architecture, it functions flawlessly when working with additive scenes. It is crucial to maintain a separate "Baking Set" for each additive scene or group of scenes.

    The mistake I made initally was attempting to use a single "Baking Set" for different scenes, corresponding to distinct scene structures (World_A and World_B). That being said, instead of a single Baking Set with World_A and World_B and all the lighting scenarios... just split the lighting scenario in 2 Baking Set, one for World_A and one for World_B.

    I'm impressed by the fact that you can easily switch between different lighting scenarios and Unity automatically knows which is the current Baking Set to get the scenario from, depending on the scene currently loaded (I hope I'm doing the right thing since it seems all too automatic :p).
    So at the moment I can have 1 "Day" and 1 "Night" scenario for each World, and Unity automatically picks the scenario from the current Baking Set.

    Code (CSharp):
    1.  
    2. // Change lighting scenario
    3. ProbeReferenceVolume.instance.lightingScenario = "Day";
    4.  
     
  40. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    153
    Assuming the DOVirtual thing works, maybe you have blending disabled in your HDRP asset ?

    Also you should call BlendLightingScenario at some point to specify the target scenario. Changing lightingScenario updates the currently active one, you should have something like that

    ProbeReferenceVolume.instance.lightingScenario = "Scenario_1"; ProbeReferenceVolume.instance.BlendLightingScenario("Scenario_2", 0);
    DOVirtual.Float(0, 1, 2, (fl) =>
    {
    ProbeReferenceVolume.instance.scenarioBlendingFactor = fl;
    });
     
    BRGames_ likes this.
  41. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    153
    So splitting in two scenarios is possible, altough your Shared_times scene can only be part of one baking set, so you may have to duplicate this one if you want to add it to the baking set. If you don't need it to be part of the set then it's all good.
    To make it work using lighting scenarios, you have to set the probe placement dropdown to 'don't recaculate' to make sure probe subdivision is the same for both scenarios, otherwise we cannot swap/blend the lighting data
     
  42. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    153
    We are able to know which set to use because of the restriction we impose that a scene can only be part of a single baking set :)
     
  43. cakeslice

    cakeslice

    Joined:
    Oct 18, 2014
    Posts:
    197
    I'm trying to use a Probe Adjustment Volume to invalidate probes but it doesn't seem to do anything.

    In this case we have a room with a ceiling that is bleeding light from the outside. The probes on top of the ceiling were invalidated but the ceiling brightness doesn't change even though we can see the probes are invalid in the debug view:

    upload_2023-7-1_23-12-45.png

    I'm using 2023.1.2f1
     
    PutridEx likes this.
  44. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,118
    I faced this issue as well. Ideally I can add fake thickness to walls/floors etc with invalidate adjustment volumes, but it doesn't seem to work. Maybe because the invalidated probes simply replace their lighting with nearby probes which are outside the room and thus still cause leaking, but it's a big issue. Light leaking in APV is the biggest issue for me.

    Virtual offset adjustment volumes help, but I would need to place an unbelievable number of them, especially in slightly more complex rooms.

    Virtual offset by itself (the global bake setting) seems to miss many probes inside of geometry, not triggered at all. Posted a thread about it in the HDRP section.
     
  45. cakeslice

    cakeslice

    Joined:
    Oct 18, 2014
    Posts:
    197
    Thanks, virtual offset does indeed work and kinda does the same thing if you push them into invalid geometry but it is strange how probe invalidation does not work.

    It would be better since you can do it without rebaking.

    As for the leaking, it is the biggest issue of APV and I think everyone agrees. APV is amazing but this issue is tough to work around.
     
    PutridEx likes this.
  46. Wolfos

    Wolfos

    Joined:
    Mar 17, 2011
    Posts:
    928
    The presentation said "designed for large worlds" but I'm seeing "15 hours left" next to the progress bar. Is there any way to get that down to a reasonable 10 minutes? Because obviously I can't just sit and wait 15 hours (per lighting scenario) after every scene change.

    I can increase the minimum probe spacing but at that point I might as well not be using GI.

    Don't really see the point of this system. It doesn't seem to solve any use cases Enlighten doesn't. Certainly doesn't fill the need to have a dynamic GI system like every other engine has. Players are already pointing out the bad lighting in Unity games. It's really holding HDRP back.
     
    Last edited: Jul 3, 2023
  47. SomethingElse12

    SomethingElse12

    Joined:
    Apr 4, 2022
    Posts:
    31
    it also completely fails to bake with large worlds. progress completely stops even when left for days. cpu usage goes to 0. and ram usage by unity drops to less than a gigabyte. I assume it hangs internally and never completes. The only solution I found to this, is to bake scenes individually, which leads to some lightning inconsistancies inbetween connecting scenes.
     
    bnmguy and PutridEx like this.
  48. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    117
    Yes, I have noticed this as well. Seems like something that needs fixed asap.
     
  49. Brindelmold

    Brindelmold

    Joined:
    Apr 28, 2018
    Posts:
    8
    I've been having a very strange error.

    I'm trying to bake a point light or an area light using APVs to make the room look all nice.

    When baking with a direct light, the colours all come out great. In the past, I thought this was the case with points, but it's possible i was being deceived by mixed lighting.

    I was trying to bake a darker scene, lit only by point and area lights, and the light came out as red.

    This, as you might imagine, was unexpected. upload_2023-7-12_17-24-12.png

    upload_2023-7-12_17-23-46.png

    In the spirit of experimentation, I've played around with various settings. Above is the settings I used for test 2 - also red, where i cranked up the lumens to 40,000 to see if it was because the scene was too dark. In the initial picture it was at 1500. When baked in mixed mode, there is no apparent red, but that seems to be because there's nothing on the light probes at all. upload_2023-7-12_17-28-47.png

    The directional light sun still bakes properly.

    I tried reselecting the filter and temperature, changing colour mode. Most exciting was making the filter blue, at which point the light comes out as green.

    I'm sure I'm missing something basic, but i can't for the life of me work out what it is.
    upload_2023-7-12_17-30-40.png

    Although with this setting and lighting turned on the scene view I see nothing at all.

    I'm using 2023.1.0.b18, HDRP 15.0.5. Has anybody else experienced this, or anything similar? I am very confused.
     

    Attached Files:

  50. Brindelmold

    Brindelmold

    Joined:
    Apr 28, 2018
    Posts:
    8
    I have 'fixed' this problem.
    upload_2023-7-13_13-37-52.png
    The solution is rotating the light 90 degrees on the x axis.

    This also worked with my area lights - the further from 180 degrees they were, the less orange the light. upload_2023-7-13_13-38-50.png
     

    Attached Files:

    Kabinet13 and Kreshi like this.