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.

Feature Request Occlusion probes or a similar feature - Forest/trees comparison inside

Discussion in 'High Definition Render Pipeline' started by PutridEx, Oct 22, 2021.

  1. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,015
    upload_2021-10-22_13-39-11.png
    This is a perfect fit or HDRP and quite literally makes all the difference.
    Left as you can guess is without, bottom right is with. The difference says it all, fidelity shoots up x50. The above image is using Unity HDRP.

    This is also done on CryEngine and makes vegetation look unbelievably good.
    Cryengine uses SVOGI though, not just occlusion probes. so it has nice and fast realtime GI (I believe 2 bounces in kingdom come)
    Kingdom come deliverance using cryEngine 3 (we're at 5 now):
    (has the BEST terrain and vegetation I have seen, check it out)
    \


    Amazing, isn't it. Forests look stark without it. It really makes all the difference.
    Most major games nowadays are open world, with vegetation and a big world.

    I specifically work with big terrains and outdoor scenes and seeing my forests/trees looking like the top left image hurts :(. I know it was suppose to come to the engine some time ago, but it never happened, which was quite disappointing.

    Also, it's not just terrains. Sometimes you can't bake lights in your game, and maybe you don't want to -- but still want your interiors to be lit correctly, with a nice sky light falloff.
    You wouldn't have to bake lights to get nice interiors without sky light everywhere.


    This is a request & discussion thread if anyone would like to chime in, but I will keep hoping :D
     
    Last edited: Nov 21, 2021
  2. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    316
    Totally agreed.
    this feature is important if Unity want to have some place in AAA game titles.
    or nobody will choose Unity when they are working on a good looking game with large forest.
     
    PutridEx likes this.
  3. Gokcan

    Gokcan

    Joined:
    Aug 15, 2013
    Posts:
    287
    I definitelly agree... I was thinking it is already implemented, isnt it?
     
  4. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    446
    On the API level yes.

    And Raytraced Occlusion probes is making some level of appearance.

    Someone is creating the DFAO variety of this on the forums somewhere.

    And paired with SSGI though heavy. Might be useful for 33.33ms target projects.

    Obviously raytraced GI and AO as well, but these usually won't work well at scale for large high density scenes at all.

    It is very much a tough spot for large external scenes and you are left to consider relying on realtime or screenspaced solutions that still lacks in the visual department against it's baked counterpart.
     
  5. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,015
    It really is. Makes the next-gen and old-old gen difference when it comes to vegetation.

    Occlusion probes, and motion vectors for instanced meshes are the two things we really, really need for amazing open world graphics.

    Currently motion vector doesn't support instanced objects, so if you place grass using the terrain detail mesh, or trees, or place them manually through instanced or indirect instanced API, there won't be motion vectors on them. You obviously need instancing for grass or have your FPS drop to 5.
    TAA is important for a nice clean smooth image.
     
    Ruchir likes this.
  6. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    350
    Isn't probe volume the same thing as occlusion probes? Except it's better because it can capture not only sky occlusion information but GI bounces as well. They already working in HDRP quite some time but isn't finished yet so we can expect improvements in workflows and quality.
     
  7. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,015
    I don't think so, although I'm not sure. to be honest I haven't tried it yet, should check it out sometime soon.
     
  8. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    350
  9. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    350
    And pretty screenshot from HDRP 12 What's new page
     
  10. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,015
    from my recent testing APV doesn't really support it.
    It's currently just a light probe replacement. Although it's actively under development so who knows what it'll be in the future. They can be something really nice in the coming updates, if the developer keeps working on the feature. I have high hopes :)

    Really want occlusion probes, really makes the vegetation/forest (open world) look so good.
     
    Last edited: Oct 27, 2021
  11. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    350
    Dunno, i just tested and it works pretty decent to me. Second screenshot - only probe volume, no lightmaps or ambient occlusion
     
  12. Gokcan

    Gokcan

    Joined:
    Aug 15, 2013
    Posts:
    287
    @Onigiri
    Can you please show us how you achieved this? Which hdrp version you used? Or some screenshots?
     
  13. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    350
    sqallpl likes this.
  14. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,015

    without APV:
    Unity_7PsLP0xl7z.png


    with APV: Unity_VVxdSOYYHC.png
    Probes are visible in the APV image, but as you can see it's identical with the exception of darker ground shadows. I don't see any occlusion.
    Activated probes everywhere as mentioned in the doc, trees are static and contribute to GI, set to light probes.


    And this picture is with no ambient sky light:
    upload_2021-10-27_18-41-1.png

    As far as I know, APV is similar to LPV, but better workflow.
     
    Last edited: Oct 27, 2021
  15. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,015
    I don't think APV is meant for this, but it's also better to have probes that just capture occlusion, nothing extra like GI and so on. I don't want any of that in my huge terrain with a ton of vegetation, I just want occlusion.
     
    Last edited: Oct 27, 2021
  16. Gokcan

    Gokcan

    Joined:
    Aug 15, 2013
    Posts:
    287
    Maybe it is because you added those threes like terrain detail?
     
  17. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,015
    they're meshes, there is no terrain
     
  18. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    350
    They are all black? If so i don't think they are working correctly here
     
  19. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    446
    I tried tests as well every time I get assertion errors, however, it still worked in some scenes with primitives others not o_O
     

    Attached Files:

  20. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,015
    https://www.twitch.tv/videos/1194884167?t=02h21m41s
    so much valuable information in that stream. I wish they showed code, but oh well :D

    In this timestamp vod link it shows Outer wilds developers implemented an "occlusion" volume feature, they have 0 baked lights but have occlusion -- so they can have interiors and all that stuff, without needing to bake light to get rid of the ambient light. I honestly would love this, even If i ignore vegetation, I can do things without light baking.
    Some projects (like outer wilds) can't have baked lights. Some don't want to bake lights, etc.


    But if you have an interior that connected with the world outside, you have to bake, otherwise ambient light will ruin the interiors. And you can't change ambient light to 0 since the user can just look at the outside world while inside.
     
    Deleted User and Ruchir like this.
  21. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,699
    Didn't they say that those are negative lights? In BIRP with deferred you can do this by making a new light buffer and set it as multiply blends instead of additive to remove light, or apply it into Ambient Occlussion buffer.
    Well those was in BiRP though, not sure about HDRP. . .
     
  22. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I want light occlusion in URP, not HDRP. Everyone is mostly using URP for higher performance on regular hardware, and I don't see any reason these probes couldn't be SRP-neutral instead of HDRP-only.
     
  23. Deleted User

    Deleted User

    Guest

    A work around for now is to use reflection probes with multiplier set to zero(or close to zero) but than u don't have reflections on your reflective surface(can be fixed if another reflection probe can be used for the reflective objects... Maybe can be achieved with layers) and cannot use SSGI
     
  24. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,015
    Of course, would be great to have it on URP as well.


    Ideally it would be a feature for all SRP.
    HDRP is the AAA focused render-pipeline, so it's more expected for it to provide such a feature (maybe one day :D)
    where URP has been quite slow with any features outside of parity. Part of that is due to the high number of platforms holding them back, and it seems they won't add anything if it doesn't run everywhere.
     
    Last edited: Nov 8, 2021
    Ruchir, hippocoder and Deleted User like this.
  25. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,015
    hmm, I tried it in interiors to get rid of ambient light but it didn't work
     
  26. Deleted User

    Deleted User

    Guest

    Than try enabling ssgi.... Or try using black custom reflection texture
     
  27. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,699
    or you can try using a proxy mesh with decal shader that only affect occlusion output
     
  28. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    396
    not as a nice work flow as adding probes however we made a tool for baking AO by baking into vertex color alpha channel into any mesh and then have the AO setting in shader.. takes a bit longer than perhaps slapping some probes in scene but each model can be set from material just as you need it
    upload_2021-11-8_2-23-12.png

    upload_2021-11-8_2-24-40.png
     
    Ruchir and mgear like this.
  29. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,015
    Nice, bit confused though.
    This effects the sky ambient lighting?
    so interiors would have no sky lighting inside, deep vegetation would occlude sky light to varying degrees, etc.
    or is it just AO?
     
  30. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    316
    The problem of probe volume is that it is just some kind of "voxel based lightmap".
    so once you done it,you can never change the lighting for it.


    MIU)_{)84}SFHW`%LG~]B07.png



    The biggest advantage of splitting "Occlusion Probes" and "Light Probes" is that you could use "Occlusion Probes" as some kind of "Voxel Based Occlusion Maps" and you do not need baking the ambient lighting color in it.

    So you could use it in a fully dynamic lighting scene.

    Actually there should be a system that only bake "Occlusion Maps" for your scene and use lightmap uvs for these baked "Occlusion Maps".

    so we could have dynamic lighting while having better occlusion maps.

    the performance and the lighting details should be much much better than realtime GI from Enlighten.

    I know you will lose the baked ambient color ( but you will have the PBS ambient light which is not bad at all) and some light bounces, but when you are working on outdoor environment those things won't be such important any more. performance and detailed soooooo soft shadow from "Occlusion maps" are more important.

     
    florianBrn and PutridEx like this.
  31. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    316
  32. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,699
  33. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    316
    nope,more like it's dead...
     
  34. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,699
    welp. . . RIP then. . . .

    anyway using APV for canopy occlussion might not the best way currently but it's kinda work i guess. . .

    no APV
    image_006_0000.jpg
    With APV
    image_007_0000.jpg image_005_0000.jpg
     
  35. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Imagine sending PLM to do this job? It'd fall back to CPU faster than a ZX spectrum would melt. I think for the forest case anyway, it would make sense to do this problem in 2 passes:

    1. the self-AO of the leaf/branch shading, this can be baked as a coarse bent normal or just AO in verts
    2. the ground shading... this could be done by approximating the leafy area with huge spheres, which can easily then be tested for distance against the ground = fast planar lightmap which you can blend into the real lightmap on the ground.

    Such an approach would at least be computationally fast.
     
    PutridEx likes this.
  36. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,699
    Per Vertex AO would mean all tree are unique mesh or all tree have the same AO then. . .
     
  37. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Not at all. The AO for vegetation is baked into vert channels so I don't see why you would think that is unique (for just the leafy area, for itself - it's not supposed to be leaf vs leaf on separate objects to begin with).

    You will find you can use any strategy for a local AO like sphere distance for the entire vegetation area of the tree. This is not something that would break batching if done right with a large number of remedial strategies available, depending how little or how much of that you'd need.

    I've read a few papers that approximate this with spheres, it's worth looking into. I don't have any links to hand, but even cryengine does use sphere approximations too if memory serves.
     
  38. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    396

    AO basically is the increasing or decreasing for high or low indirect lighting
    you could bake the range from super dark to a more realistic soft as you need and this is controlled per material inside or out .. in my case in the shaders i have a toggle to switch the source from baked or texture .. each solution has its place for best use .. combine with a post effect for global its very powerful
     
  39. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,015
    HaloInfinite_CTstGn0YO4.jpg HaloInfinite_3jGAQOmmun.jpg

    Halo infinite..
    I still have hope :(
     
    Deleted User and Ruchir like this.
  40. Deleted User

    Deleted User

    Guest

    +1 vote for this... URP also needs this
     
  41. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    316
    Come on,Unity !

    people need this.
     
  42. GenaSG

    GenaSG

    Joined:
    Apr 19, 2014
    Posts:
    111
    I'm trying something similar. I modified(hacked :))) URP to get ambient light from reflection probe. It works ok but there's a catch. Can't rotate reflection probe volume.
     
  43. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,015
    Been testing out a nice forest demo, and in the same time checking out HDRP's SSGI in 2021.2.
    Using SSGI you can get somewhat similar results to occlusion probes, in it that sky light is shadowed and so forests/trees look much nicer.

    Although SSGI is, as the name implies, screen-space, so that in itself is a big limitation.
    Still, this gives you a glimpse at how forests would look with occlusion probes (or something similar).


    I'm also using SSAO, which helps a lot, but struggles with distance AO.


    Trees with no SSAO, and no SSGI:
    upload_2021-12-13_11-55-6.png

    Tree with SSAO enabled (High intensity), but no SSGI:
    upload_2021-12-13_11-55-32.png

    Tree with SSGI, but no SSAO:
    upload_2021-12-13_11-56-20.png

    And tree with both enabled:
    upload_2021-12-13_11-56-36.png
     

    Attached Files:

    Last edited: Dec 13, 2021
  44. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,015
    Forest with both disabled:
    upload_2021-12-13_11-59-28.png

    With SSAO only:
    upload_2021-12-13_11-59-42.png

    with SSGI only:
    upload_2021-12-13_11-59-56.png

    I suggest opening pictures in different browser tabs and jumping between them to easily compare the difference.
    SSGI is actually pretty good in outdoor areas.


    The issue is the performance cost.
    If you disable full resolution, it actually becomes pretty damn fast. Can get around 2.6 milliseconds on a GTX 1070.
    But if that's disabled, there's a good amount of noise on the grass and in general. I assume it uses half res or quarter res, i'm not sure.
     
  45. LumaPxxx

    LumaPxxx

    Joined:
    Oct 3, 2010
    Posts:
    316
    SSGI in hdrp really sucks, the ghost effect is just too heavy.
    and the performance sucks too.

    i don't know why can't they just add the color bleeding effect in ambient occlusion to give us some similar results and much better performance.

    horizon based ambient occlusion done it so well.
     
    PutridEx likes this.
  46. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,015
    Sad thing is HBAO doesn't work correctly in HDRP, it renders over HDRP's volumetric fog. Cause HDRP doesn't have the right injection point for that not to happen.

    https://forum.unity.com/threads/mis...pipeline-cant-do-custom-ssao-in-hdrp.1173797/
     
    LumaPxxx likes this.
  47. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    446
    Though the highly experimental Probe volumes do work well in most cases and is far better performant than SSGI ( cause baked) it's may not be as great for the outdoors, which I honestly thought it was going the become essentially the occlusion probes.

    I do hope this in general makes some great headway though.
     
  48. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,015

    Back when the demo was released, the developer for it planned on releasing it.
    It was so "basic" to implement but life changing for vegetation :(

    Reminds me of this:


    (I realize the dev is not "lying" here, life happens, just a funny reference -- and todd is impossible to dislike)
     

    Attached Files:

    Last edited: Jan 11, 2022
  49. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    891
  50. PutridEx

    PutridEx

    Joined:
    Feb 3, 2021
    Posts:
    1,015
    Oh boy. It's under consideration but it's progress :)

    Vote for it if you can guys.
    Seems like it might work for real-time as well. This will be a big graphical push, especially to vegetation/forests. Although this is will be good in general, not just for vegetation.
    Hopefully we'll hear more about it soon (2022.2 please.. ;))
     
    Last edited: Jan 30, 2022