0
\$\begingroup\$

Good evening. I'm programming an Android Game. To reduce the amount of textures that need to be loaded (OpenGL ES 2.0) I've created several spritesheets of size 1024x1024. Some frames of the same animation are on different spritesheets. Now my question is if that is bad for the performance since I have to bind (OpenGL.bind()) a different texture for each animation frame? Thank you for clarification!

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

The goal of sprite sheets is to reduce the number of texture bindings.

As you probably need to bind different textures (other than your animations) during a single frame you'll always have at least one texture bind to select one of the spritesheets back on the next frame. Whichever texture your bind on the next frame will have the same penalty as the data will likely be evicted from the texture cache by that point and the issue is a little bit moot with mobile GPUs using tile-based rendering.

When in doubt, use or write a profiler and test.

\$\endgroup\$
1
  • \$\begingroup\$ Hey, thank you very much for your informativ answer :)! That makes totally sense! So it probably doesn't really matter right? It would help to draw all the sprites that use the same texture in a row but since this is not the case (using AndEngine, without using a batch) it shouldn't affect performance? Have a nice day! \$\endgroup\$
    – sjkm
    Commented Jan 24, 2015 at 10:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .