Search Unity

Bug Batching SpriteRenderer vs Individual Mode Isometric Tilemap

Discussion in '2D' started by Lo-renzo, Dec 13, 2019.

  1. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,511
    Is it possible to get sprites from the same spritesheet and same material (SpritesDefault) to batch together when SpriteA uses a SpriteRenderer and SpriteB uses an Individual Mode Isometric Tilemap? The Frame Debugger reports that the batch breaks due to different "objects have different MaterialPropertyBlock set" but are otherwise identical.

    Is there a way get the SpriteRenderer to match the Tilemap or vice versa? What is different about rendering through SpriteRenderer and TilemapRenderer which causes a different MaterialPropertyBlock?

    If possible, I'd be able to achieve a single batch for walls (Tilemap) and characters (SpriteRenderer), which would be a big gain. sr - Copy.jpg

    tm - Copy.jpg
     
  2. ChuanXin

    ChuanXin

    Unity Technologies

    Joined:
    Apr 7, 2015
    Posts:
    1,068
    Thanks for highlighting this. We will look into this issue!
     
  3. mrm83

    mrm83

    Joined:
    Nov 29, 2014
    Posts:
    345
    Another update on this?
     
  4. Lo-renzo

    Lo-renzo

    Joined:
    Apr 8, 2018
    Posts:
    1,511
    It should work correctly.

    From memory (double check the release notes if very important), I think this was fixed for 2019.4ish or 2020.1. However for the case where secondary textures are also in use, that was fixed in 2020.2ish.

    If that doesn't match what you're experiencing, perhaps there's some other bug.
     
  5. mrm83

    mrm83

    Joined:
    Nov 29, 2014
    Posts:
    345
    It is not batching, still getting property block not the same with individual mode and sprites using the same spritesheets.
    using 2019.4.14

    found it in 2020.1.0
    2D: Allowed the Tilemap Renderer in Individual Mode to batch with other Sprite Renderers with matching batching criteria.

    no fix for 2019, any plans it this getting pushed to 2019 lts?
     
    Last edited: Dec 18, 2020