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. Kreshi

    Kreshi

    Joined:
    Jan 12, 2015
    Posts:
    432
    I had this issue recently too - your workaround works - thanks! You should file a bug report :).
     
  2. Stepan_33

    Stepan_33

    Joined:
    Nov 21, 2022
    Posts:
    26
    Hello, I have small artifacts in the system (Adaptive Probe Volumes), could you advise a quick solution.
    The artifacts are that the object is strangely darkened, there are some spots
    unity URP 2023.2.0b1

    On Scene 2 Mixed light sources and Baked light


    upload_2023-7-22_0-21-22.png upload_2023-7-22_0-19-46.png upload_2023-7-22_0-20-50.png


    upload_2023-7-22_0-23-0.png
     
  3. Kabinet13

    Kabinet13

    Joined:
    Jun 13, 2019
    Posts:
    53
  4. Kreshi

    Kreshi

    Joined:
    Jan 12, 2015
    Posts:
    432
    I did some more testing and I believe this issue may be related to a corrupted scene. When creating a new scene with the same assets I was not able to reproduce the bug anymore somehow..
     
  5. Stepan_33

    Stepan_33

    Joined:
    Nov 21, 2022
    Posts:
    26

    Thank you, everything works fine, this parameter is about 100 and everything is fine
     
  6. Brindelmold

    Brindelmold

    Joined:
    Apr 28, 2018
    Posts:
    8
    Hot diggity, thanks Kreshi, I'll give it a look.
     
  7. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    383
    Is there a way to easily compare scenes with APV and with no APV without clearing baked data? I would like to see how it affects the environment and characters.
     
  8. Kreshi

    Kreshi

    Joined:
    Jan 12, 2015
    Posts:
    432
    Project Settings -> Graphics -> HDRP Global Settings -> Lighting -> enable/disable Probe Volumes
     
  9. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    383
    Thanks! Is there a way to do it on an object basis?
    On legacy light probes it just worked by setting Probes -> Light Probes to: Off (instead of default Blend Probes) on a (skinned)mesh renderer, but now it doesn't seem to work with APV.
     
  10. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    154
    You can control it per material if you enable this checkbox on a shadergraph, but control per object is not possible upload_2023-7-26_16-17-18.png
     
  11. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    383
    Thanks, but I must admit that it is awfully counterintuitive, especially with the option related to probes exists in the mesh renderer.

    Will you be unifying/cleaning it in the future or do you plan to introduce more ambiguity as it is happening right now?
     
  12. Kreshi

    Kreshi

    Joined:
    Jan 12, 2015
    Posts:
    432
    the option related to probes inside the mesh renderer let's you choose if the respective object contributes to probes or lightmaps when baking lighting.
     
  13. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    383
    Are you sure? According to the documentation here: https://docs.unity3d.com/Manual/LightProbes-MeshRenderer.html the off option disables the effect on the object and it did that for me with the legacy light probes.

     
  14. Kreshi

    Kreshi

    Joined:
    Jan 12, 2015
    Posts:
    432
    Oops! Sorry I meant the receive global illumination "light probe" option :D.
     
  15. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    154
    This is for baking, but once an object is baked you can't turn probe volume off for this object.
    Legacy light probes were computed on CPU so it was possible to have per object settings and but is not available on GPU for APV
     
  16. JoergHofmann74

    JoergHofmann74

    Joined:
    Oct 31, 2017
    Posts:
    13
    Hi
    please consider a runtime version to place, edit and calculate the probes & volumes.
    It is not for games, but there are way more use cases to Unity than "just" games.

    Best Joerg
     
    newguy123 likes this.
  17. Genebris

    Genebris

    Joined:
    Mar 18, 2013
    Posts:
    93
    I wish we could set scene lighting settings to disable lightmaps and only use light probes. Right now it looks like to do this I have to set every mesh renderer in a scene to use light probes, right?
     
  18. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    117
    Wondering if URP will ever get full functionality, or if it will be the usual Unity move where it is given bare minimum support, gets broken in future updates, then remains there indefinitely. But unity marks it complete in the roadmap so all is considered good. It is seriously getting old.
     
  19. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,232
    if you have thousands of meshes, this could easily become a huge problem to set 1 by 1
    how would I go about setting everything in scene to use light probes in 1 go?
     
    Genebris likes this.
  20. jiraphatK

    jiraphatK

    Joined:
    Sep 29, 2018
    Posts:
    245
    There should be a menu for that in the
    Edit > Renderering >....

    Although there is not one that handle setting to lightprobe to lightmap which is pretty weird.

    You could also use the search menu, select all the mesh renderers and change them all at once. but select thousands of meshrenderers is SLOW. So it's better to write the utility script to handle this for you.
     
  21. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    117
    You can select all or multiple at once and change it in the inspector.
     
  22. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,232
    and how does that work with 10 imported fbx files, each with thousands of objects, prefabs, and trying to select it all?
    You cant then get to the mesh renderer when selected everything in scene.
    Fact is its a bad design
     
  23. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,232
    yes this is something Unity should just have as default and not expect users to code every little simple thing that should just be part of the package as default in the 1st place
     
  24. GTA_6

    GTA_6

    Joined:
    Jun 19, 2023
    Posts:
    8
    Is denoising for APV possible? I need to set the samples multiplier to a very high value (above 100-200 sometimes in low light scenarios) to mitigate the noise it produces!
     
  25. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    117
    This is true. It is one of the usability gripes that comes with Untiy.
     
  26. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    117
    Yes I also have very noisy results, particularly black specks throughout in a very consistent pattern.
     
  27. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    154
    No, denoising is only available for lightmaps
     
    GTA_6 likes this.
  28. The64thGamer_

    The64thGamer_

    Joined:
    Aug 4, 2019
    Posts:
    14
    Was this fix ever pushed? I've still had zero changes to the node's functionality even on 2023.0.2b1. I'm assuming fixes like these are pushed through packages in the package manager but none of the relevant packages have had any updates pushed since June 8th.
     
  29. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    154
    The fix has landed in 2023.1.2f1 and 2022.3.5f1
     
  30. Minos321

    Minos321

    Joined:
    Jul 7, 2018
    Posts:
    13
    Hey! Just wanted to say that I absolutely love this workflow and how cheap it is to render. This is a great alternative to lightmaps and realtime GI, at af reaction of the cost, and very easy workflow. My only gripe is that you have to switch the objects invidiually to use lightprobes instead of lightmaps, would be nice if there was an override somewhere so you don't have to do this manually (especially since you can't edit the original model prefab).



     
    ontrigger, Genebris, pbritton and 4 others like this.
  31. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    1,232
    "My only gripe is that you have to switch the objects invidiually to use lightprobes instead of lightmaps, would be nice if there was an override somewhere so you don't have to do this manually (especially since you can't edit the original model prefab)"

    Quoted for agreement +1000!
     
    pbritton, Lymdun and PaulMDev like this.
  32. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    117
    Just wanted to note that having "some" parts of the code available doesn't help much with editor and player support.
     
  33. nehvaleem

    nehvaleem

    Joined:
    Dec 13, 2012
    Posts:
    383
    In the meantime I can suggest some small editor script that will help you with that.

    Code (CSharp):
    1. [MenuItem("GameObject/Rendering/Switch Renderers to Light Probes", false, 20)]
    2.         private static void SwitchRenderersToLightProbes(MenuCommand command)
    3.         {
    4.             SwitchGlobalIlluminationMode((GameObject) command.context, ReceiveGI.LightProbes);
    5.         }
    6.        
    7.         [MenuItem("GameObject/Rendering/Switch Renderers to Lightmaps", false, 20)]
    8.         private static void SwitchRenderersToLightmaps(MenuCommand command)
    9.         {
    10.             SwitchGlobalIlluminationMode((GameObject) command.context, ReceiveGI.Lightmaps);
    11.         }
    12.  
    13.         private static void SwitchGlobalIlluminationMode(GameObject targetGameObject, ReceiveGI globalIlluminationMode)
    14.         {
    15.             var option = EditorUtility.DisplayDialogComplex("Switching to Light Probes",
    16.                 $"Do you want to switch renderers to use {(globalIlluminationMode == ReceiveGI.Lightmaps ? "Lightmaps" : "Light Probes")}?",
    17.                 "Yes, with children",
    18.                 "Cancel",
    19.                 "Yes, this object only");
    20.  
    21.             switch (option)
    22.             {
    23.                 // yes with children
    24.                 case 0:
    25.                     var allRenderers = targetGameObject.GetComponentsInChildren<MeshRenderer>(true);
    26.                     foreach (var target in allRenderers)
    27.                     {
    28.                         target.receiveGI = globalIlluminationMode;
    29.                         EditorUtility.SetDirty(target);
    30.                     }
    31.                    
    32.                     break;
    33.                
    34.                 // cancel
    35.                 case 1:
    36.                     Debug.Log("User Cancelled");
    37.                     break;
    38.                
    39.                 // yes, this object only
    40.                 case 2:
    41.                     var objectRenderer = targetGameObject.GetComponent<MeshRenderer>();
    42.                     if (objectRenderer)
    43.                     {
    44.                         objectRenderer.receiveGI = globalIlluminationMode;
    45.                         EditorUtility.SetDirty(objectRenderer);
    46.                     }
    47.                     break;
    48.             }
    49.         }
     
  34. redspike474

    redspike474

    Joined:
    Oct 4, 2015
    Posts:
    7
    I think I read that Unity has no plans to backport APV to older versions, but is there anything actually that would stop somone porting APV support to an older version of URP?
    Anything under the hood that just would stop it from being possible?
     
  35. Kreshi

    Kreshi

    Joined:
    Jan 12, 2015
    Posts:
    432
    Probably time, human resources and money :D
     
  36. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    154
    The main reason is that we don't backport features on LTS versions.

    But you should be able to do it yourself, although it's not gonna be an easy task :).
    Unfortunately i cannot point you to the PR doing the changes for URP because they were agrgregated with other PRs when merged, but i can give you some starting point

    This commit contains a refactor of APV to move some code to core
    https://github.com/Unity-Technologies/Graphics/commit/6cfdd0834f85982bdabe0b38a58f50aa6e964ac2

    And this one contains the actual implementation in URP
    https://github.com/Unity-Technologies/Graphics/commit/08a6a72236afbe88ea4444626aafb3fa4edd1301
     
  37. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    117
    Wouldn't this need support on the closed sourced editor and player side too though?
     
  38. redspike474

    redspike474

    Joined:
    Oct 4, 2015
    Posts:
    7

    Thanks for the detailed reply, I plan to look into this over the weekend.

    This is what I initially thought too, which Is why I asked "Anything under the hood that just would stop it from being possible?"
     
  39. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    154
    It shouldn't require any closed source change, APV is completely implemented in SRP code.
    If APV is supported on HDRP for a given unity version, then it's possible to make it work on URP too.
     
  40. bnmguy

    bnmguy

    Joined:
    Oct 31, 2020
    Posts:
    117
    So the answer is yes, it requires support, but it already has the needed support if it works with HDRP APV?
     
  41. Genebris

    Genebris

    Joined:
    Mar 18, 2013
    Posts:
    93
    Is this still not fixed in 2022.3? Whenever I enter play mode, MOST of my objects stop getting lit by probes, but not all of them. Anything else that could cause this?
    Also probes stop working if press undo. Despite rendering debugger showing them correctly.

    EDIT: I think it was Bakery ruining link to probes. Deleted it from project and seems fine now.
     
    Last edited: Aug 18, 2023
  42. timgreenberg

    timgreenberg

    Joined:
    Feb 8, 2021
    Posts:
    13
    How do I deal with artifacts on objects that are not grid-aligned? Here's a sloped roof, it has brights spots under it because it's trying to sample from the bright probe on top. Decreasing the probe spacing doesn't solve the problem, unless it's a ridiculously small value
     

    Attached Files:

  43. timgreenberg

    timgreenberg

    Joined:
    Feb 8, 2021
    Posts:
    13
    solved with view bias
     
  44. Kabinet13

    Kabinet13

    Joined:
    Jun 13, 2019
    Posts:
    53
    No idea when they added this , but there is an option to convert either all selected, or all loaded MeshRenderers to use light probes. If I remember correctly it should be under Edit>Rendering. I just stumbled upon it when trying out the latest 2023.2.
     
  45. Genebris

    Genebris

    Joined:
    Mar 18, 2013
    Posts:
    93
    The problem is not in clicking on meshes, it's the fact that you have to make on scene edits to prefabs to choose between workflows. And you might want different workflows depending on scene, hence why I think there should be a scene wide option.
     
    Kabinet13 likes this.
  46. RevC2

    RevC2

    Joined:
    May 2, 2021
    Posts:
    48
    Hi, I'm having lot of issues with APV and looking for some feedback.

    1) I've seen examples of big maps using APV, but right now with both 2022.3 LTS and 2023.2 beta I can't bake my APV in CPU nor GPU mode, no matter of the settings. My terrain is huge (30km x 30km in 15 by 15 tiles) but even setting a Probe every 4000 meters results in a error and RAM saturation (64 GB of RAM). As I said, both in CPU and GPU which it's strange as I believe CPU should be more stable.

    Terrain:
    2023-09-02 18_03_44-Gaea - OutdoorsScene - Windows, Mac, Linux - Unity 2022.3.4f1 _DX11_.png

    RAM gets full:
    Screenshot 2023-09-02 180155.png

    Error:
    2023-09-02 18_48_40-Gaea - OutdoorsScene - Windows, Mac, Linux - Unity 2022.3.4f1 _DX11_.png


    2) I still have a lot of confusion about how to reduce noise with APV. As far as I understand most of the settings in GI tab relating to lightmaps don't relate to APV (Lightmap size, resolution, Denoising etc. which is confusing) and what drives APV quality it's just the samples controls. Am I right? Then no matter the settings I can't produce clean results in dark areas, as walls continue to have splotches. Any tip is well accepted.

    Any ideas? Thanks in advance
     
    Last edited: Sep 2, 2023
  47. Genebris

    Genebris

    Joined:
    Mar 18, 2013
    Posts:
    93
    Does anybody else get lighting contribution from invalid probes? My table is lit from beneath the floor even though these probes are invalidated by touch up volume. I guess this is a bug? 2022.3.5
    upload_2023-9-6_18-38-59.png

    upload_2023-9-6_18-39-8.png
     
    PutridEx likes this.
  48. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    154
    Hello, this is likely due to the noise added to the sampling position. You can try to disable it just to make sure (it's in the additional properties of the probe volume options in the volume system)
    In general it's a good idea to lower that value in interiors to avoid leaking, but if you can't do that you have two solutions.
    - Either you enable dilation so that the invalid probes get valid data from nearby probes
    - Either you use virtual offset to push the probes above the floor so they get valid data when baking. You can do that by using an adjustment volume to specify the virtual offset manually on some probes. If you don't want virtual offset in the rest of the scene you can set the search distance multiplier in the lighting tab to 0 (i don't remember if those settings are available on 22.3 but i think they are)
     
  49. Genebris

    Genebris

    Joined:
    Mar 18, 2013
    Posts:
    93
    Hi. Those screenshots were actually with 0 sampling noise and with dilation.
    upload_2023-9-6_22-31-47.png
    upload_2023-9-6_22-31-33.png

    But disabling dilation actually helped me work around this issue. I wish we could just destroy probes in touch up volume. I don't want to sample GI outside the building, I already know it's wrong data for me.
     
    PutridEx likes this.
  50. adrien-de-tocqueville

    adrien-de-tocqueville

    Unity Technologies

    Joined:
    Mar 16, 2020
    Posts:
    154
    Yes we have plans to improve sampling when there is invalid probes but no ETA yet
     
    Kabinet13 and PaulMDev like this.