Search Unity

Static Batching is making things slow

Discussion in 'General Graphics' started by romelianism, Apr 17, 2022.

  1. romelianism

    romelianism

    Joined:
    Feb 18, 2022
    Posts:
    1
    Hello,

    I am using Unity 2020.3.33f1.

    I created a test project with thousands of Spheres with just renderers and noticed turning on Batching Static lowers the framerate. I want to know why this is happening.

    With no Batching Static: (56.4 FPS)
    with-no-static.PNG

    With Batching Static enabled: (31.4 FPS)
    with-static.PNG
     
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Static batching is designed for different medium to large objects that can be batched, not lots of the same thing.

    Otherwise it could end up slower/consume more ram. For lots of the same thing you're best off with drawmeshinstanced style calls or DOTS with hybrid renderer.

    Basically static batching is for: a low resolution town or level where the independent parts of the statically batched mesh can still be culled (it keeps these around with some indexing so they can still be culled). So it suits lowering draw calls for objects that might have different meshes but can still be batched together.

    For grass, spheres and other evil repetitive things, it's the worst choice.
     
    zalogic and romelianism like this.