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

Low terrain tree FPS but wierdly Low CPU and Low GPU usage?

Discussion in '2020.1 Beta' started by Arowx, Jul 14, 2020.

  1. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Working on a large terrain project (8 km^2 ) and getting some very strange benchmarks early on.

    I'm getting low < 20 fps but also very low CPU and GPU utilisation (build and in editor)

    Digging into the profiler in editor mode and the rendering systems is definitely the slowdown:

    Camera Render Taking 67 ms

    PerpareSceneCullingParameters taking 17 ms but even in deep profile it looks like none of the sub methods it calls can account for more than 2% of this.
    Then WaitForJobGroupID which is called in two places seems to take about > 3 ms each, which seems excessive.

    Note: Using the Standard Rendering Pipeline.

    Wondering why this has not been addressed especially with super powered consoles around the corner and gamers expecting more open world games combined with Unities drive for performance by default?
     
    Last edited: Jul 14, 2020
  2. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    Just a reminder that Unity was able to make this demo...



    Then why can't we make large tree filled terrains easily out of the box, what is the point of spending all that money making amazing demos when the basic engine technology does not get improved?

    PS Judging from the blog post it seems that dedicated high end mesh rendering and shader technology was used for the demo and not the default terrain and speed tree technology.
     
  3. Hyp-X

    Hyp-X

    Joined:
    Jun 24, 2015
    Posts:
    438
    Well, SpeedTree...

    <rant>
    We made a compute shader to
    - Cull trees
    - Compute LOD's
    Then we draw everything with DrawMeshInstancedIndirect calls.

    Guess what?

    We are still CPU bottlenecked, because DrawMeshInstancedIndirect is so much slower in Unity than other draw calls that it compensates for all the CPU optimization we did by moving stuff to the GPU...

    It spends CPU time
    - When you submit the call
    - When it processes the command buffer (on the Main thread!)
    - When it processes the command buffer again (on the Render thread - graphics jobs do not apply here)

    Graphics Jobs, SRP batching none of the optimizations apply when you use DrawMeshInstancedIndirect.

    So good luck with SpeedTree vs Unity
    </rant>
     
  4. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
    I was amazed at how long this has been an issue that has not been resolved, especially with the new DOTS/Multi-threading/Burst 'performance by default' approach taking over.
     
    ImpossibleRobert likes this.
  5. Arowx

    Arowx

    Joined:
    Nov 12, 2009
    Posts:
    8,194
  6. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    Are you using billboards + DrawMeshInstancedIndirect (just let GPUInstancer do it for you)?

    You shouldn't have an issue getting something like 10k trees running fine. Overdraw will be the unsolvable issue at higher numbers, depending on the tree shape.