Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Massive performance hit with realtime reflection probes on HDRP

Discussion in 'Graphics Experimental Previews' started by customphase, Jan 15, 2019.

  1. customphase

    customphase

    Joined:
    Aug 19, 2012
    Posts:
    245
    Unity 2018.3.1, HDRP 4.6.0

    Without reflection probes i get stable 60+ fps no problem:

    upload_2019-1-15_17-48-23.png

    However adding just one cube reflection probe, cuts that framerate in half:

    upload_2019-1-15_17-49-15.png

    And one more, brings it down to 15-20 frames:

    upload_2019-1-15_17-50-19.png

    Profiler screenshot:

    upload_2019-1-15_17-52-14.png

    Reflection settings screenshot:

    upload_2019-1-15_17-53-51.png

    Lowering the cubemap size/enabling compression/changing cache size yield no improvements at all. Also tried using custom rendering path inside reflection probes, switching off pretty much every feature but opaque rendering, and managed to get only 5-8 fps improvement.
     
    Last edited: Jan 15, 2019
  2. customphase

    customphase

    Joined:
    Aug 19, 2012
    Posts:
    245
    Also, hierarchy profiler shows quite a lot of garbage generation in Player Loop:

    upload_2019-1-15_18-1-48.png
     
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    Cool looking scene.

    Realtime reflection probes and Planar Reflections more or less re-render the scene (which is why you see the batches explode). Maybe something like SSR would be more appropriate?

    It's also worth mentioning that you should be testing in a build, it could behave much differently than the editor.
     
  4. customphase

    customphase

    Joined:
    Aug 19, 2012
    Posts:
    245
    Thanks! Yeah, im aware they re-render the scene, but it still should cut the framerate in half. Also i forgot to mention that non-HDRP version of the same scene with the same amount of realtime reflection probes renders perfectly fine without this much fps drop. So the problem IS somewhere within the HDRP. Also not to mention garbage generation, which is also not helping.
     
    ftejada likes this.
  5. customphase

    customphase

    Joined:
    Aug 19, 2012
    Posts:
    245
    Regarding batches - took some time to optimize the geometry properly, now get ~400 batches with 2 reflection probes on, yet still same 15-20 fps. So it 100% not the source of the problem:

    upload_2019-1-15_18-43-51.png
     
    ftejada likes this.
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,631
    Weird! You've convinced me.

    Does it behave the same in a build?
     
  7. customphase

    customphase

    Joined:
    Aug 19, 2012
    Posts:
    245
    In a build its about 4-8 fps better than in editor. So not an editor specific issue. And im not planning to build this anyway, its for a music video, which i will render directly from the Unity.
     
  8. Danua

    Danua

    Joined:
    Feb 20, 2015
    Posts:
    197
    the only way to solve that issue just to bake
     
  9. customphase

    customphase

    Joined:
    Aug 19, 2012
    Posts:
    245
    If i could bake it, i would. But it needs to be dynamic, to simulate the reflections/lighting from the video screen in the back. Also, as i mentioned, it is not an issue with a regular pipeline, only HD. So there should be a proper solution to this.
     
  10. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    714
    You do realize that it should, right? Render the same scene twice and of course it's going to take twice the time to render.

    One thing you can do to reduce that like in the legacy renderer is to reduce the probe resolution so it doesn't render too many pixels. This is probably why it's more performant in non-HDRP, as the legacy probe had that per-probe resolution setting whereas HDRP has it as a global setting in its settings asset. You may also be able to change that resoltion through code or via inspector debug view.
     
  11. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Hi @alexandre-fiset !!!
    In the first message he says that changing the probe resolution does not fix the problem.

    I personally encounter the same problem. Scenes very loaded in StandardPipeline with a ReflectionProbe in real time and updating in each frame is perfect for me at about 70 ~ 80fps

    The same scene in HDRP but more empty, 25 ~ 30fps. I personally think Unity has a problem there with the ReflectionProbes. So much loss of performance is not normal. It doesn't matter how you put the resolution of the ReflectionProbe because the improvement in performance is almost negligible ...

    Is there something I'm missing?

    Cheers
     
  12. ftejada

    ftejada

    Joined:
    Jul 1, 2015
    Posts:
    695
    Is there anyone who can report this problem ???

    Really, no one from Unity reads this thread to provide information on what is happening, an ETA to improve this or report with anything ???

    I find it very sad that Unity is silent on this matter.
    Cheers
     
    Mad_Banny likes this.
  13. jjejj87

    jjejj87

    Joined:
    Feb 2, 2013
    Posts:
    1,115
    They tend to this and wait until someone files a bug report and prove that this is happening...
     
  14. MrOverloaded

    MrOverloaded

    Joined:
    Oct 27, 2018
    Posts:
    5
    I found a workaround! Changing the radius of the shape isn't enough, you also need to change the clipping planes
     
    rmele09 likes this.
  15. rmele09

    rmele09

    Joined:
    Nov 8, 2010
    Posts:
    712
    Can you elaborate a little more specifically what you did? Is there a way to match the clipping plane with the radius shape exactly?