Search Unity

Planar Reflection Probe, "Use Occlusion Culling" objects disappearing / flickering.

Discussion in 'General Graphics' started by koirat, Nov 4, 2021.

  1. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,073
    Unity3d 2021.1.17
    HDRP
    Baked Occlusion Culling.

    When I have Use Occlusion Culling enabled on my Planar Reflection Probe depends on camera position and angle, some objects on reflection disappears.

    When use Occlusion Culling is disabled every object is giving the proper reflection.

    On the picture below as you can see only rock in the center is reflected in the water.



    I have already seen people reporting this issue somewhere, posts where like 5 years old but gave no answers.
    Have this issue been resolved in some way ?
     
    Last edited: Nov 4, 2021
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,342
    The HDRP is only 2~3 years old, so those posts wouldn't have been related to this at all. Your best bet is to report it as a bug using the in-editor menu.
    https://unity3d.com/unity/qa/bug-reporting


    I don't use the HDRP at all, so I can't really say for sure what the problem might be. However I wonder if the problem is the water surface is being treated as an occluder as when rendering reflections the reflection "camera" is rendering the scene from under the water. If the water surface is set to be static, try turning that off and seeing if that helps at all. This is a complete shot in the dark though.
     
  3. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,073
    Unfortunately it is not the case.
    Also the point of view the bug appears is quite random. Little shift in camera angle and object disappears a little more and it shows again.
     
  4. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,741
    If you move your normal camera under the water, are these objects visible, or are they occluded for some reason?
     
  5. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,073
    They are visible from under the water.
     
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,741
    No idea then, but I also don't really use HDRP other from messing around with it, so I don't really know if there's something special in the way they do their planar reflection.

    Maybe do a bug report?

    But you better find a workaround, because even if Unity can recreate it, a fix is months or years away from becoming available to a version of Unity you can use.
     
  7. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,073
    I reported it, we will see how it will go.
    I also found another BUG when the object is out of FOV it's reflection will disappear, this might be mitigated by setting Dynamic Occlusion to false on object to be reflected. But it still looks like a bug to me.

    And some other things that smells like a bugs but I'm not sure yet.
    All this makes me wonder do people really use Planar Reflection Probes.
     
  8. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,342
    Fixed that question for you.

    The answer is: Yes, but not that many, and most are either not attempting to do any optimizations yet because they're early on their projects or early to game dev, or are running in to weird bugs like this all of the time and pulling their hair out trying to figure out how to fix it or work around it while bugs they report seem to sit around without fixes for ages.
     
  9. hugokostic

    hugokostic

    Joined:
    Sep 23, 2017
    Posts:
    84
    I do, but not for all situation/scenes :

    First, Planar reflections have a camera cost, it rewrite object in a camera buffer with different view projection settings (realtime reflection settings tab in HDRP asset), use it wisely, reduce as much as possible the far clip of the planar camera settings, it could handle more objects without looking weird or impact too much performance because of batching. So sometimes it's better to use some well placed Reflection Probes combined with Screen-Space Reflection in PBR Accumulation mode if the surfaces displayed are not so planar and don't need the very clean reflection (unlike water, mirror or perfect marble plane).

    I used Planar Reflection it in two different settings :
    - GameObject with classic occlusion culling system
    => It indeed have occlusion data bug, i did saw object clipping randomly too (maybe because of the multiple view/camera in Unity, not really HDRP related i bet) so I just throw occlusion data to the trash and optimize my level with HLOD area and grouped meshes by materials, more convenient. And GPU instanced objects don't seem to flicker either, so it's a doable solution.
    Unity devs talk about a Burst base solution (compatible with GO) to manage a good (and dynamic) occlusion culling system ( https://forum.unity.com/threads/huge-bottleneck-in-shadows-createumbrashadowculler.1193881/ )

    - DOTS entity's rendered using the hybrid renderer dynamic culling, no flickering so far, not so much memory overhead.
    =>It's a solution, to convert the rendering part only (static meshes) of your level into entity, keeping only the dynamics objects and all the meshes collider under the classic GO world (don't even setup Unity Physics or Havoc), it would be some kind of hybrid approach but used only for render static things, not for gameplay, you would gain a huge performance boost by the way.
     
    Last edited: Dec 7, 2021