Search Unity

Question Really poor performance with latest Hybrid Renderer v2 and URP

Discussion in 'Graphics for ECS' started by JakHussain, Aug 9, 2020.

  1. JakHussain

    JakHussain

    Joined:
    Oct 20, 2016
    Posts:
    318
    Rendering just 3000 primitive spheres with a custom URP shader with hybrid instancing enabled takes 11ms for the rendering system to execute. My setup involves an authoring component on a gameobject in a subscene where the component has a public entity field which is assigned a prefab of my sphere before entering playmode. This means that my entities have all the special components needed to support URP.

    There's nothing else in my subscene and I've enabled hybrid renderer V2 in the scripting defines.

    In a non dots project I can render 15,000 spheres with regular GPU instancing at 60fps so for me, DOTS is 5 times slower at rendering.

    Any ideas?
     
    Nyanpas and charleshendry like this.
  2. Nyanpas

    Nyanpas

    Joined:
    Dec 29, 2016
    Posts:
    406
  3. JakHussain

    JakHussain

    Joined:
    Oct 20, 2016
    Posts:
    318
    That doesn't apply here since this is a pure DOTS project. Like the title says, I'm using the hybrid renderer already. And I've enabled v2 which is supposed to have even better performance and feature support.

    I've made an equivalent set up back when hybrid renderer 0.4.0 was new and I was easily able to render a few hundred thousand entities. Now I can barely render 5000.
     
  4. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    Are your entities static or do they have to recalculate localtoworld every frame? (also what version of URP/unity?)
     
    Last edited: Aug 9, 2020
    Nyanpas likes this.
  5. JakHussain

    JakHussain

    Joined:
    Oct 20, 2016
    Posts:
    318
    My entities are non static though with only 3000 of them I'd be shocked to hear that non static rendering is that poor with hybrid v2.

    My editor version is 2020.1.0 and my URP version is 9.0.0-preview.14. I'm aware that there's a preview 35 available but the shader graph window got a huge update in that version which was missing the option to mark shader fields as hybrid instanced so I downgraded back to preview 14 which matched the hybrid renderer documentation.
     
  6. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    3,356
    HR v2 performs well for the rendering itself, keeping stuff persistent on the gpu. But it has some serious performance issues in other areas. Static stuff it can still do well as long as you aren't using too many LOD levels. Moving renderers I would use another api like DrawMeshInstanced for now.
     
    Nyanpas and JakHussain like this.
  7. Nyanpas

    Nyanpas

    Joined:
    Dec 29, 2016
    Posts:
    406
    It's what I am doing for certain repeated mesh renderers. Then again my project has been going for years now, slowly integrating DOTS-functionality...
     
  8. burningmime

    burningmime

    Joined:
    Jan 25, 2014
    Posts:
    845
    Nyanpas likes this.
  9. Endlesser

    Endlesser

    Joined:
    Nov 11, 2015
    Posts:
    89
    How's your HRV2 performance running nowadays? is it getting better with latest Hybrid render..?
     
  10. SebastianAaltonen

    SebastianAaltonen

    Unity Technologies

    Joined:
    Feb 21, 2020
    Posts:
    112
    We are not aware of any Hybrid Renderer V1 -> V2 regressions. In every test case we have seen a clear improvement. Hybrid Renderer V2 was a very early version in August. There were a lot of bugs back then. 0.11.0 has significantly improved stability, memory usage and performance. If you encounter bad performance, please report a bug ticket with a small repro project.

    It seems that the OP was spawning entities at runtime (from prefabs). There was some bad chunk fragmentation issues in the old hybrid renderer versions, probably leading to one chunk per entity in this case, unless the spawning was done exactly right (add default initialized chunk components, etc). This issue has been solved since.