Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Need Suggestions on Optimizing Render CPU Usage Caused by Terrain

Discussion in 'Editor & General Support' started by ironfiftynine, Aug 24, 2023.

  1. ironfiftynine

    ironfiftynine

    Joined:
    Jan 22, 2013
    Posts:
    69
    Good day. I'm working on a game that currently has low framerate. When I checked the Profiler, most of the CPU Usage are consumed by rendering. See my proifiler screenshot here

    I tried to pinpoint which objects are taking up a significant amount of resource load and the one I found is the main terrain that we used in the scene. Here's a video recording of how the FPS changes when the terrain is removed:



    Things that I have tried:
    • The video above already involves occlusion culling baked in the scene. The Occluders and Occludee include the terrain that I mentioned. I checked the Visualization of tne Occlussion Culling and I can confirm that part of the terrain gets culled. However, the FPS is still low.
    • I also tried to max out the Pixel Error of the terrain settings but even though the Tris have decreased by about ~100k, the FPS is still low.
    • I considered changing the Occlussion Culling bake settings but the default settings seem to yield the most proper output
    I would like to ask for suggestions on any possible approaches to improve the performance of our scene. Thanks in advance!
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
    There is also a frame analyzer which helps to see what gets drawn and in what order. This helps to see whether culling actually works.

    It‘s notable that there is a lot of CPU overhead for rendering. Perhaps culling isn‘t doing enough to improve fps and simply taxes the CPU trying to figure out what to cull and what not. It would also help to know how many draw calls there are. You seem to have a lot of static geometry in that scene - is it flagged as static? This would help to move more geometry to the static batch, which speeds up rendering.
     
    ironfiftynine likes this.
  3. ironfiftynine

    ironfiftynine

    Joined:
    Jan 22, 2013
    Posts:
    69
    The trees, rocks, and grounds among other things are part of one large terrain. You can see them disappear when I removed the terrain.

    I marked the static objects at least as Occluder Static and Occludee Static. From what I understand, that's all I need. As for the culling being an overhead, I had the impression that if it adds significant execution time, I should be able to see that in the Profiler Hierarchy. Not sure there is one based on my screenshot.

    I will try the frame analyzer. Thank you for your feedback and suggestions. :)