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

Quantifying performance impact of various HDRP settings

Discussion in 'Graphics Experimental Previews' started by dgoyette, Apr 5, 2019.

  1. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    I migrated my game to HDRP 4-5 months ago, and the biggest challenge for me has been in trying to understand the impact of all of the various settings, both in terms of practical effect as well as in terms of performance. I have some general questions. But first, is this the correct place to go for documentation moving forward?

    https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@5.3/manual/index.html

    I understand that documentation is evolving, but in the mean time, does anyone have recommendations on how to better understand the general technical details of the various HDRP settings? For many of the settings, not only does the description not really tell me anything, but toggling it doesn't show any visual change in my project. So I'm left unsure of whether I "need" certain settings, just because I don't understand exactly when that setting will have an impact.

    An example of this is the "Transparent Backface" option in the HDRP asset settings. Per the docs, it just tells me: "Enables support for transparent back-face render passes. If your Unity Project does not need to make a transparent back-face pass, disable this checkbox to reduce build time." Okay. How do I know if my project needs to make a transparent back-face pass? A lot of the settings are in the docs like this, essentially saying, "Disable this property if you understand what it does and you don't need it," but that doesn't help me understand what it does. So, how do you recommend increasing my understanding of what the various settings do?

    The other big thing is that it's hard for me to evaluate the performance impact of different settings. It's not always as simple as whether my game "needs" a graphical feature. I might "want" a feature, as long as it's not too costly. Ideally there would be some simple way to judge CPU/GPU cost of rendering a view, such that I could toggle various settings and see the results in terms of FPS or some other metric. Does anything like that exist? For example, how would you quantify the performance impact of enabling "High quality" volumetrics, versus just using normal volumetrics?

    Thanks.
     
    NotaNaN likes this.
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    Maybe a simpler question is, where do people begin to diagnose framerate issues with HDRP? Running my game, about 1ms per frame is my code, and the rest is all within the HDRP rendering. I'm not getting the framerates I'd expect in my scenes, and I'm trying to understand how to figure out what is responsible for that. Currently, my only approach is turning on/off things, and seeing what that does to framerate, but that feels extremely inaccurate.
     
  3. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    Still hoping to gain some knowledge on how to approach performance tuning in HDRP. I set up a simple test scene containing about 1000 cubes and a dozen spotlights. Profiling a stand-alone build of this room, it just tells me the lights are expensive:

    upload_2019-4-6_17-50-7.png

    But that doesn't really tell me anything actionable. If anyone has suggestions on how to effectively performance tune an HDRP game, I'd love to hear about your process.

    I'm also a little confused about whether I'm CPU or GPU bound in rendering this scene. The standalone game's process is using about 52% of the total CPU, but the GPU isn't maxed out either. Is this normal? I was expecting that whichever one I was "bound" by would be maxed out?

    upload_2019-4-6_17-53-46.png
     
  4. Tartiflette

    Tartiflette

    Joined:
    Apr 10, 2015
    Posts:
    84
    One thing I find somewhat useful is counting the number of frames that were actually rendered per second and compare that to the number displayed in the stats tab of the game window. I believe the value from the stats tab is entirely based on the cpu time taken to render the frame and is often a lot higher than the actual framerate. If the two values are the same, you are cpu limited.
     
  5. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    522
    @dgoyette ,
    where you able to figure out what is performance heavy in the HDRP ?
     
  6. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,195
    Not directly. I have no better ability now than I did four months ago in pinpointing specific issues. Instead, my approach has just been to rely on general graphics efficiency gains, like LOD and occlusion culling to keep the rendering costs down. As long as these general approaches land me in an acceptable FPS range, I'm not pushing too much harder on figuring out the performance cost of specific shader features.
     
    NotaNaN, brainwipe and manutoo like this.
  7. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    522
    @dgoyette ,
    thanks for your answer ; I guess I might take the same road... :)
     
  8. Gasimo

    Gasimo

    Joined:
    Mar 3, 2015
    Posts:
    66
    Profiler should now show some additional details around HDRP, it would be nice to see a graph like this:
    Some of the options are really unclear, I created a new asset and am getting very unstable framerates in a simple scene with 40k tris and 1 spot light (1k shadows) with the default hdrp settings and volumetric fog... ranging from 40-120... mostly around 48.
     
    NotaNaN likes this.
  9. holyfot

    holyfot

    Joined:
    Dec 16, 2016
    Posts:
    42
    So far Shadow Maps (and lowering its resolution), Turning off Reflection Probes and VSync have the biggest impacts that I can see. Also using Baked GI + Baked-Indirect Lighting + Progressive GPU had a big boost on performance.
     
    Last edited: Feb 15, 2020
  10. John_Leorid

    John_Leorid

    Joined:
    Nov 5, 2012
    Posts:
    650
    Profiling Graphics as a Programmer is hard, basically the only thing that works every time is turning things off and checking if the frames are better - categorizing things in the hierarchy helps - for example: I turned off the parent of all rocks in the scene and got half a frame more per second, despite ~1000 rocks in the scene, the impact is basically non existent.
    The same approach works for HDRP Features, such as Volumetric Lightning. Sometimes you can even tell whats costing the most by simply looking around and "spotting" specific objects that cause the framerate to drop, like now, the trees with translucency.
    Some time ago it were the details (rocks, grass, flowers) on the terrain and then it were some insane settings in the HDRP Default Volume.

    I am fixing and breaking the framerate since about two months now, reading throught the entire HDRP documentation but I think, it starts to pay off:

    upload_2020-8-14_7-31-42.png
     
  11. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    522
    @Hannibal_Leo ,
    do not use the Unity FPS counter, it's broken, it just counts the rendering thread on the CPU (ie: the time needed to send commands to the GPU).
    Do your own FPS counter instead.
     
  12. John_Leorid

    John_Leorid

    Joined:
    Nov 5, 2012
    Posts:
    650
  13. manutoo

    manutoo

    Joined:
    Jul 13, 2010
    Posts:
    522
    @Hannibal_Leo ,
    in this case, check you don't have VSync on, because it seems strange your FPS is stable when removing much stuff (you didn't give any really useful numbers, so I'm not sure it's really wrong, but it doesn't hurt to check :p )