I am working on a 2D game with sprite sheets. I might be completely overlooking something here, but I can't figure out for the life of me how to use sprite sheets with z-buffer testing.
Here are the conflicting issues as I understand them:
A sprite in a spritesheet will have transparent pixels all around it that define where the sprite doesn't exist (since each frame in the sprite sheet "grid" is a rectangle, but the sprite is contained within that rectangle).
Transparency doesn't work with z-testing.
Therefore, it's impossible to use spritesheets with the z-buffer? I should just use painter's algorithm then?
Are both of those conclusions correct?
texkill
or somesuch) based on arbitrary conditions. As for the "aliasing problems", you're making a 2D sprite-based game; aliasing isn't exactly your biggest concern. And any space between sprites can be marked as transparent. How much space there is between sprites is up to you, since you're building the sprite sheet. – Nicol Bolas Aug 12 '11 at 17:29texkill
. This discards the "pixel". The depth buffer will not be written to. – Nicol Bolas Aug 12 '11 at 20:24