Sprite sheets still a good idea?

Problems with Canvas, OpenGL, etc...

Sprite sheets still a good idea?

Postby RedToasty » Sun Jun 27, 2010 3:19 pm

I'm part way into making my game and have mapped all the level/enemy textures onto tilemaps. I have 1x 256x256 for game level specific tiles (these vary on diff levels) and 2x 256x128 maps for other bits (character animations, enemies, projectiles). In code it does:

bind 1,
render everything that uses that one,
bind 2
render everything that uses that one,
bind 3

Is there a potential downside to going this way? I noticed replica island has a lot of small standalone sprites, I guess this is due to the fact you rarely see numerous of each on screen at the same time?

3 binds with big uploads vs ~20 binds with small ones?

Any feedback appreciated! I'm working on a meaty Galaxy S, bit paranoid the 3d hardware might mask any potential chokepoints on other phones.

Posts: 9
Joined: Thu Jun 17, 2010 7:27 pm


Re: Sprite sheets still a good idea?

Postby impi » Sun Jun 27, 2010 5:45 pm

It can be faster to draw enemies with small textures, if you draw only one or two, since enemies have many animation frames, and you just need to bind the actual frame, and not the complete atlas. For an game like Replica Island this is faster, than binding the whole animation atlas.

If you want to make an Tower Defense like game - so many enemies are on the screen, binding an big atlas with your enemies and then draw the bunch of enemies is the faster way.

So it depends of what you want todo. It also depends on the GPU cache and driver optimizations for texture binding, if its faster or slower.

If you draw many objects with the same texture you can batch them in one buffer, so this is much faster.
Posts: 29
Joined: Wed Apr 28, 2010 11:17 pm


Return to Android 2D/3D Graphics - OpenGL Problems

Who is online

Users browsing this forum: No registered users and 3 guests