Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Terrain: how to get trees to batch?

Discussion in 'General Graphics' started by laurentlavigne, May 24, 2020.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,225
    I use trees as a cheap and easy way to populate the world with buildings, I use the nature tree creator bark shader on those buildings.
    The frame rate is dreadful.
    frame debugger to the rescue.
    It reveals that each tree is a draw mesh! 7.5k batches total.

    I'm tempted to conclude that the terrain is abandonware or transitionware and should be replaced by some off the shelf voxel terrain, using gameobjects with instance material turned on (it is on all my materials).

    What's the consensus?

    upload_2020-5-24_2-48-18.png
     
  2. Klausbdl

    Klausbdl

    Joined:
    Aug 12, 2013
    Posts:
    64
    Reviving this old thread because I'm having the same issue. I'm making a test scene with spheres as trees and a single red material, but every tree is being batched instead of all of them at once. Even with "GPU Instancing" turned on in the material and setting the sphere prefab as static, it still batches everything separately. Captura de ecrã 2023-06-02 053207.png