Search Unity

Do Unity texture atlases cause performance drop in unity if the batching fails

Discussion in 'General Graphics' started by Ykondev, Apr 4, 2022.

  1. Ykondev

    Ykondev

    Joined:
    Mar 31, 2022
    Posts:
    2
    Edit : I am posting this twice now. the old post I sent last week is removed without any explanation.

    I am trying to make sense of batch rendering with sprite atlases in unity.

    I got most of the bits cleared. but one thing I'm not sure of is how do the texture atlases are sent to the render pipeline during batching by Unity?

    The reason I'm asking this is that I want to know if the following scenario causes a performance drop rather than a performance gain?

    Imagine that we have two sprites with different textures. each sprite is using a 512 by 512 texture.

    The sprite atlas contains two textures of both sprites. so the sprite atlas is 1024 by 1024 (lets ignore the padding for simplicity)

    So during the batch draw call, at this point, I PRESUME Unity would be sending the texture atlas along with the other information such as position UV cords etc about each sprite in a batch to the rendering pipeline.

    My question is let's assume that the unity couldn't batch them together. what happens then? Would unity now would be sending sprite Atlas which is 1024 by 1024 in size to the rendering pipeline twice? one for sprite A and another one for sprite B draw calls?

    One last question - I've been informed that sprite atlases can DECREASE startup time slightly. I haven't found more information about this online and I want to make sure I'm not chasing some myth. is this correct?
     
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,022
    Yes.
    Right. But there's a difference between telling it "Hey, here's a new 1024x1024 texture" (this part happens just once) and "Hey, render sprite A using texture X. Now render sprite B using texture X"
     
    BrandyStarbrite and Ykondev like this.