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. Let us know your feedback about the Global Illumination changes in the 2023.2 beta.
    Dismiss Notice
  3. 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. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    76
    Any ETA when Dynamic APV comes? And is it comes to 2023.3?
     
  2. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    154
    Unfortunately no, it's very unlikely that it will come for 23.3
     
  3. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,781
    wait, is APV going to be dynamic? as in dynamic realtime re-lighting?
     
  4. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    154
    This is something that we showcased at GDC this year during the APV talk at the very end
    It's support GI from dynamic lighting in static environments, so it's not full GI
     
    DragonmoN likes this.
  5. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    76
    Sadge. But if it can interact with dynamic models (such as character), it will solve so many headaches with various GI solutions
     
  6. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,781
    Ah. . . you mean the automatic lighting scenario blending part? i thought it going to be full dynamic GI
     
  7. Genebris

    Genebris

    Joined:
    Mar 18, 2013
    Posts:
    93
    Where does it say "automatic scenario blending"? It is dynamic GI where light can move but environment can not.
     
  8. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,781
    Not sure where, either in this thread or in twitter. It was a day after the talk, Someone from the HDRP team explain that it's basically the scenario blending can be automatically connected to Sun Light Direction, it still a precomputed GI but we don't have to deal with scenario blending manually.
     
  9. Jack_Martison

    Jack_Martison

    Joined:
    Jun 24, 2018
    Posts:
    76
    I don't see any others solutions than storing lightmap data and blend it in runtime, it's even more convenient with light probes and with native Unity UI it will make it even better
     
  10. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    535
  11. eduroam

    eduroam

    Joined:
    Jul 2, 2015
    Posts:
    48
    Is this a bug right?.

    upload_2023-9-14_17-0-21.png

    My shadow Max Distance is short 15, using one cascade count.

    I'm using Lighting Mode = Shadow Mask.

    So dynamic objects follow this rule: "Baked shadows from static GameObjects using Light Probes, beyond the Shadow Distance."

    With classic light probes, everything is right, but using AVP the direct lighting is hitting directly, not taking into account the light probes.

    Regards
    Eduardo
     
  12. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    117
    It depends on your settings. What is the geometry bias you have set? Are you using view bias? Please provide us with your setup.
     
  13. muzaffermertaksu

    muzaffermertaksu

    Joined:
    Oct 26, 2018
    Posts:
    2
    Hi. I am unable to bake any scenes with probe volumes. I tried with 22lts-23lts-23.1 versions. I checked all tutorials available. Tried many scenarios. It says it's baking but nothing happens afterwards. What i am missing?
     
  14. eduroam

    eduroam

    Joined:
    Jul 2, 2015
    Posts:
    48
    Be sure that you turn on the effect in the HDRP Global Settings

    upload_2023-9-15_8-2-38.png
     
  15. eduroam

    eduroam

    Joined:
    Jul 2, 2015
    Posts:
    48
    Check different values and nothing. I think that it's not a parameters issue.


    upload_2023-9-15_8-3-8.png
     
  16. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    154
    Shadow mask is not supported with APV. It is not the right solution to the problem as you need to have pretty high res data for shadows mask to work correctly
    Instead the recommended way is to use a long range for the last cascade of the shadow map.
    Using cached shadow maps may help regarding the performance, especially because you can set different update frequency for each cascade (eg. close cascades are every frame, far cascades are every few frames).

    More info in the doc: https://docs.unity3d.com/Packages/c...anual/Shadows-in-HDRP.html#shadow-update-mode
     
  17. eduroam

    eduroam

    Joined:
    Jul 2, 2015
    Posts:
    48
    Thanks for the reply. I will test what you mentioned.

    But actually, the Shadow Masks with short distance shadow + lightmaps have been working very well even in low-end hardware devices.

    Regards.
     
  18. idontcareforunity

    idontcareforunity

    Joined:
    Feb 21, 2019
    Posts:
    3
    I want some meshes not to be lit by probe volumes or reduce the effect of probe volumes.
    Is there any way to change the effect of probe volumes depending on the layers or meshes?
     
  19. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    154
  20. rsklnkv

    rsklnkv

    Joined:
    Sep 8, 2012
    Posts:
    61
    Hey,
    Is there a way to avoid APVs in UNITY_SERVER builds? Currently, it's built and deployed to all our servers and also loaded at runtime. We're on 2022 LTS
    Thanks.
     
  21. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    154
    If you have a custom hdrp asset for your server build, you can disable apv so that data is not included in the build
     
  22. idontcareforunity

    idontcareforunity

    Joined:
    Feb 21, 2019
    Posts:
    3
  23. Kabinet13

    Kabinet13

    Joined:
    Jun 13, 2019
    Posts:
    53
    Shadowmask support seems like a UI issue, since I assume it relies on the lighmap settings from meshrenderers, which are only enabled for lightmapped objects. Is there any other reason shadowmasks aren't compatible?
     
  24. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    535
    Probably because Shadow masks baked static marked gameobjects and realtime for unmarked. The system may conflict with APV
     
  25. AlejandroDaJ

    AlejandroDaJ

    Joined:
    May 30, 2014
    Posts:
    5
    I'm also really curious about his point 1. I'm getting similar errors with a much smaller and more modest terrain, 4km x 4km. I've found I can mitigate it somewhat by strategically lowering the number of, say, trees that have Contribute GI/Light Probes turned on... but if I have to do that, then APV's don't actually decouple light complexity from scene complexity, do they?
     
  26. Kabinet13

    Kabinet13

    Joined:
    Jun 13, 2019
    Posts:
    53
    They do decouple the lighting from scene complexity, but there's no real way to decouple the baking process from scene complexity unfortunately. One of the biggest things APV is in need of right now is a proper incremental bake system. The workaround for now is to split your terrain into many smaller terrain pieces in many different scenes, and then bake each scene one by one in a baking set. This setup does let your iterate while only baking part of the scene, but way better tooling for this is needed.

    (Ideally a bake by cell system)
     
  27. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    154
    Hello, first a good news: improvements to virtual offset have landed in 23.2.0b11 (available very soon i guess)
    Previously the system was using physics raycast on colliders to detect intersections, while it's now relying on raytracing which is both more precise and faster (and it doesn't need raytracing compatible hardware).
    I hope it's gonna help with some of the problems you encountered, please share feedback if you have any!

    Regarding issues with large terrain. Indeed as Kabinet13 said the decoupling is at runtime, baking currently requires all scene to be loaded.
    I am currently working on making a bake by cell system, i'll update here once it's done :)
     
  28. bossa_quick

    bossa_quick

    Joined:
    Feb 5, 2020
    Posts:
    3
    Surely the actual baking part of APV has to have some knowledge of the format and is written into editor source code somewhere? Else would this imply you could build a runtime lightmapper?
     
  29. teutonicus

    teutonicus

    Joined:
    Jul 4, 2012
    Posts:
    67
    Thank you for sharing!
     
  30. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    154
    APV uses
    UnityEditor.Experimental.Lightmapping.SetAdditionalBakedProbes
    , but this API dates from before APV, so technically APV doesn't require any editor source code change
    But the new baking system i talked about in the previous message will not use this API anymore, so there may be some possibilities for runtime fun
     
    Kabinet13 likes this.
  31. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,119
    Great stuff, I look forward to testing it. Been a while since I opened unity, gonna be fun testing again.
    Hopefully it makes a noticeable difference in reducing light leaks and detecting things correctly.
     
    HIBIKI_entertainment likes this.
  32. Oblord

    Oblord

    Joined:
    May 7, 2015
    Posts:
    4
    Is there a code reference for APV blending to mimic real-time GI?
     
    wilgieseler and Jack_Martison like this.
  33. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,781
    Oblord likes this.
  34. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,781
    I still don't understand why Sky Occlusion still not implemented and still under consideration, it should fix this kind of issue isn't
     
    ontrigger likes this.
  35. GTA_6

    GTA_6

    Joined:
    Jun 19, 2023
    Posts:
    8
    Hey! Will this feature "HDRP Streaming Data from Disk", make it possible to bake very large scenes? My graphics card always runs out of memory and unity would crash, does this directly store baked data onto disk?
     
    rsklnkv likes this.
  36. rsklnkv

    rsklnkv

    Joined:
    Sep 8, 2012
    Posts:
    61
    Hey,

    We're on 2022.3.5 and I just found that this 2 lines takes 5ms:
    m_ToBeLoadedCells.QuickSort();
    m_LoadedCells.QuickSort();

    If I comment them out, I'm getting 5ms back and everything seems to work fine.
    Why those arrays need to be sorted?
    Is it fine to disable sorting?
    Is there a chance that you'll add option to disable sorting in an upcoming 2022 lts patch release?
     
    Last edited: Oct 9, 2023 at 3:14 PM