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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

A HUGE amount of draw calls from my Unity Terrain grass. What gives?

Discussion in 'General Graphics' started by KnifeMedia, Nov 13, 2016.

  1. KnifeMedia

    KnifeMedia

    Joined:
    Jun 15, 2015
    Posts:
    108
    I've got an issue. Typically Unity Terrain grass batches quite nicely. However, my terrain is producing THOUSANDS of draw calls from a small clump of grass objects. Any ideas? I'm using RTP and the terrain is located inside a gameobject. Shouldn't it be something around the 100 draw call mark? Pics below:


     
  2. KnifeMedia

    KnifeMedia

    Joined:
    Jun 15, 2015
    Posts:
    108
    OK I fixed it! I'm gonna explain how for future reference by others.

    1. I had a more advanced water shader in the environment that was utilising a second camera with a far draw distance. That about halved the calls.

    2. I changed my detail patch resolution to 128 (bigger = less calls) and made the overall detail resolution of the terrain 128. Draw calls are around 100 now :)
     
    fffMalzbier likes this.
  3. JamesArndt

    JamesArndt

    Unity Technologies

    Joined:
    Dec 1, 2009
    Posts:
    2,913
    Good catches! I have found a large performance improvement in terrain overall by using the lowest heightmap resolution I can while still getting the detail I want.

    PS - Those water systems also dynamically spawn those reflection cameras too, so it's not always obvious to find them and troubleshoot!
     
  4. MaxEnders

    MaxEnders

    Joined:
    Apr 9, 2019
    Posts:
    10
    In case someone sees this in the future
     
    wuzhouu3d and c0d3_m0nk3y like this.