Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Resolved Only getting 6 FPS! (HybridRendererV2)

Discussion in 'Graphics for ECS' started by charleshendry, Nov 3, 2020.

  1. charleshendry

    charleshendry

    Joined:
    Jan 7, 2018
    Posts:
    98
    Hi,
    I'm assuming I'm doing something very wrong as I'm currently only getting around 6 FPS and I was hoping to have way more object rendered in the scene than this. The view below consists of maybe only a dozen or so unique meshes and all objects in the scene share the same material using a Texture2DArray with UV offsets, so assume I would get good performance with DOTS instancing. The tri/vert count is very high due to a tree asset I need to replace (unless that's the issue?). I've tested in a build and get identical poor performance.

    GameView.png

    I've attached some profiler snapshots. It shows the bottleneck on StartUpdate within UpdateAllBatches. Does Semaphore.WaitForSignal mean its waiting on something else to complete first? I.e. the problem is elsewhere?
     

    Attached Files:

  2. runner78

    runner78

    Joined:
    Mar 14, 2015
    Posts:
    803
    Checklist:
    • Change Unity to release mode
    • Activate GPU instancing
    • Deactivate safty checks for performance tests
    • Burst active?
     
    charleshendry likes this.
  3. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    868
    if you want to rule out the tree being a problem you could try switching the mesh temporarily with something like the builtin cube mesh, and see what the performance is like after
     
    charleshendry likes this.
  4. charleshendry

    charleshendry

    Joined:
    Jan 7, 2018
    Posts:
    98
    Thanks @runner78. You mean release mode under the build configuration settings? Have changed that to release now. Still get poor performance in build as well.
    The other three items are ok.
     
  5. joelv

    joelv

    Unity Technologies

    Joined:
    Mar 20, 2015
    Posts:
    203
    Would it be possible to get a screenshot of the profiler with more of the render thread and job threads visible? Potentially also a bit more what happens before hybrid starts updating StartUpdate is waiting for some job chain that seems to be running for a long time.

    Also, what version of hybrid/dots is this?

    EDIT: You might actually be fully GPU bound and the uploader in hybrid is waiting for a new set of buffers to become available.
     
    charleshendry likes this.
  6. Nyanpas

    Nyanpas

    Joined:
    Dec 29, 2016
    Posts:
    406
    110 million triangles is more than we get from Azure Remote Rendering, which has at most been 50 million triangles so far.
     
    charleshendry likes this.
  7. charleshendry

    charleshendry

    Joined:
    Jan 7, 2018
    Posts:
    98
    If I get rid of the trees and replace all buildings with simple cubes I'm down to 20M tris @33 FPS. Ok so maybe I need to check the assets and add LOD/Culling to reduce it further.
     
  8. charleshendry

    charleshendry

    Joined:
    Jan 7, 2018
    Posts:
    98
    The profiler initially shows several physics jobs (I have a static trigger box collider on each building) followed by LOD jobs, before the long idle period.
    I'm on Hybrid Renderer 0.10.0, Entities 0.16.0, Unity 2020.2.0b9.

    ProfilerStart.png
     
  9. joelv

    joelv

    Unity Technologies

    Joined:
    Mar 20, 2015
    Posts:
    203
    It does look like you are GPU bound. Hybrid 0.10 has a new frame queuing limit to avoid overwriting live GPU data and that might wait for the GPU to be done with drawing of some previous frames. This is a stopgap measure we will improve on and you can disable it by adding the script define DISABLE_HYBRID_RENDERER_V2_FRAME_LIMIT

    It might or might not improve your situation. If it does improve your framerate something is broken on our side and will need fixing.
    If it does not improve frame rate for you you are probably GPU bound.
     
    charleshendry likes this.
  10. charleshendry

    charleshendry

    Joined:
    Jan 7, 2018
    Posts:
    98
    Adding the script define didn't improve things. Thanks @joelv ! I wasn't paying attention to the GPU as the editor stats were showing the CPU working hard. Definitely some problematic meshes in there I can tidy up and sort it.
     
  11. MartinTilo

    MartinTilo

    Unity Technologies

    Joined:
    Aug 16, 2017
    Posts:
    2,482
    I guess this has been answered by "It's GPU bound" but just to reiterate: Yes. Semaphore.WaitForSognal is a threading sample, i.e. it always implies that the thread it occurs on is waiting on work on a different thread. Looking at where it ended and what else ended around that time mark on a different thread is the way to go, unless there is a flow event registered with the samples. (New in 2020.1, their visualization can be turned on on the Timeline view toolbar via the right most three dot button)
     
  12. joelv

    joelv

    Unity Technologies

    Joined:
    Mar 20, 2015
    Posts:
    203
    I realized the profiling scopes here is not very good, thank you for highlighting that. We have decided to do some minor changes so that time waiting for GPU will not be shown inside hybrid renderer any longer. This will make it more clear to you when you are CPU bound and when you are GPU bound.
     
    MartinTilo, charleshendry and Sarkahn like this.