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

Hybrid Renderer not batching?

Discussion in 'Graphics for ECS' started by Ryetoast, May 31, 2019.

  1. Ryetoast

    Ryetoast

    Joined:
    Mar 8, 2015
    Posts:
    48
    I have 4 game objects in my scene, using Quad and Default-Material. In editor mode, and in play mode when I don't convert them to entities, I get 1 batch, and 3 saved by batching. If I attach the convert to entities script (convert and destroy) I get 4 batches, 0 saved.

    I originally noticed because I was spawning a bunch of prefab entities that had the same sprite-default material on quads and had a batch per spawned prefab. After doing some googling, I'm not actually sure the sprite material can be batched, but the default material at least should be.

    Additional bug: the Frame Debugger didn't have any message why it wasn't able to batch.
     
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,626
    Have you enabled gpu instancing on your materials.
     
  3. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,068
    Default material doesn't have GPU instancing. So use another material and enable it.
     
  4. Ryetoast

    Ryetoast

    Joined:
    Mar 8, 2015
    Posts:
    48
    Checked enable gpu instancing on my Sprite/Default material. The stats look fine (correct number of batches I was expecting) but I don't see them on screen at all.

    Before:


    After: