Search Unity

12 small Terrains joined together - What is this incredible CPU usage in Profiler

Discussion in 'World Building' started by jtok4j, Mar 11, 2020.

  1. jtok4j

    jtok4j

    Joined:
    Dec 6, 2013
    Posts:
    322
    Greetings,
    I have 12 small terrains joined together in an open-ended level. It's not that large, but I thought 12 small chunks would somehow be performing better. However after blending and painting the terrains into an interesting area that looks nice, I find my framerate without trees/details is 8-12 fps...
    If i remove the terrain pieces (disable) the frame rate hops up to 80-120fps...
    Note that trees/details are not drawn on these terrains... Here's a sample of the performance when flying around in the level:

    upload_2020-3-11_13-59-40.png

    upload_2020-3-11_13-57-2.png

    Note: The above green/filled area in the profile, which is focused on, underneath is in-game. I see from the performance, it appears to be cpu-bound issues which are causing performance to decline.

    What can I check next to see what exactly is causing the problem? I see that camera.render seems to be very busy, along with culling rendering stuff.

    Any directions on stuff to tweak to change this, would be much appreciated.
    Thanks!
    J.K.
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
    I would use the Frame Debugger to find out what's causing those 4000+ batches and try yo reduce them.
    https://docs.unity3d.com/Manual/FrameDebugger.html

    I also find the Hierarchy view in the Profiler often more helpful than the Timeline view you posted.
     
    jtok4j likes this.
  3. jtok4j

    jtok4j

    Joined:
    Dec 6, 2013
    Posts:
    322

    Thanks for the direction @Peter77 I have found that most of the draw callbatches are the Camera drawing the many parts (4000+) of the 12 terrains...

    Now to search how to not have such high draw calls for simply drawing the terrains...
    Any tips on this?
     
  4. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,609
    I would continue try to figure out what these 4000+ batches represent. If I understand your post correctly, it's really only the terrain without details/trees or anything else in the scene.

    In this case I would deactivate all terrains but one, check Frame Debugger and play with the terrain options of the single remaining terrain. I would do this to find what settings affect the batches to explode.