Search Unity

Question Debugging and Improving HDRP Performance (7.5)

Discussion in 'High Definition Render Pipeline' started by OliverVSmith, Jan 15, 2021.

  1. OliverVSmith

    OliverVSmith

    Joined:
    Nov 7, 2017
    Posts:
    51
    Hello, We’re creating a City Builder on a terrain roughly 4kmx4km.
    At any given time, you can see a maximum map area of around 200x200metres.

    We’ve been using HDRP for quite sometime now, upgrade through multiple versions and settled on 7.5.2 as we intend to launch (soon) on 2019.4LTS.
    Performance has long been an issue, and we’ve improved our own code drastically (now spiking at most at 8ms per frame in a busy scene but usually around 3-4ms).
    However HDRP is taking between 40 and 50ms per frame on the CPU in editor (it is reduced somewhat in build as I know editor has overhead but not to an acceptable level). The GPU frame item is around 14ms in editor. This results in and FPS varying between 10 and 25.

    Initially within the scene (heavily populated with dynamic trees, grass etc) we get FPS fluctuating between 80 and 100 (all grass and trees are GPU instanced and use some plugins to run as fast as we possibly can and we’re happy with the results).

    Problems start occurring when we introduce more meshes into the scene, we load most of our assets from asset bundles, all buildings (70 different meshes/prefabs) are atlassed down to just 4 textures and materials we liberally use Decals for ground splats around buildings. Performance starts to drop drastically once we get to around 30 buildings placed (all Buildings have LOD’s, simplified meshes using simplygon and as I mentioned atlases and share materials).

    Our crowds are animated GPU instancer through a great plugin called GPU Instancing Crowd Animation and again we’re generally happy with the results (disabling crowds doesn’t produce a noticeable benefit to performance).


    Now I know that the batches and saved by batching numbers are not to be trusted according to various threads as SRP Batcher numbers aren’t represented well in 2019.4, we have several thousand batches (and just about a thousand set pass calls) for seemingly no reason, but I have confirmed that SRP batcher is running and working (gives us a small improvement).

    We’ve poured hours and hours of research into this, we THINK we’re doing everything right as best we can tell. We’re a small team with generally limited graphics knowledge but fast learners, but this has reached the point of being completely beyond our understanding.
    I’m looking forward general advice on HDRP improvements as well as if anyone is willing to help out and give the project a cursory glance I’m more than happy to share it with you.
    If there are any Unity HDRP team members out there who see this and can help, this is my impassioned plea for it.

    If nothing else, thanks for hearing out my ramble and I’ll share some more detailed profiler info shortly.