Will Start Working On Sprites, But...


mduffor said:
You would separate eye, mouth, hair stand animation, etc. and overlay it because it saves a ton of memory.
A metric ton or an imperial ton? Or just, like, 1 kiB?
mduffor said:
And you don't have an image the same size as the face with just the eyes on it, you have a rectangle just slightly larger than the eyes themselves.
Yeah, of course. You sitll aren't gaining that much memory, however.
mduffor said:
And there won't be a lot of alpha tests if the sprites are RLE encoded; you'll just draw the pixels of the eye sprite that have information in them. Also if you have sprites broken up like face, eyes, and mouth, then you can combine different mouth animation with different eye animation, without having to store every possible combination as a full face sprite.
Is it actually possible to RLE encode OpenGL textures? Really? And why would that reduce alpha tests, especially without the fixed function pipeline? Note that GLSL's "discard" should not be used on the Pandora's SGX (because of performance) or necessarily elsewhere for that matter (because of other issues I've had with that command), and discard isn't used automatically somehow just because you happen to load your texture from a GIF file... All images are stored essentially the same way in OpenGL afaik (GL_RGB, GL_RGBA etc).

mduffor said:
All of this is assuming of course that you are dealing with larger sprites, like portrait sprites.
Ah, right. I was thinking of small sprites for 2D top-down RPGs.
 
Last edited by a moderator:
Ah, yeah for OpenGL you can't RLE textures, but you can do smaller overlays. So if you had a 128x256 sized portrait, you'd probably create a 256x256 sized texture, with your blank face on the left of the texture, and all your mouth and eye animations on the right. Then you would blit the face, and then blit which of the facial features you wanted on top of it from the same texture (and thus the same texture setup). This would save memory over having say 8-10+ different full faces with features already on them.

I was assuming a 2D blitting engine rather than an OpenGL based one, since that's what I'm working with right now. My bad.

But if you are just assembling a bunch of 32x32 layers for a single avatar (like the sprites of the half-kaiser project), then trying to break it up into parts probably isn't worth the memory savings or the hassle (which sounds like the case you're working with). I guess it also depends on how many sprites you have, and how much texture memory you have (being able to keep all sprite pages in texture memory would definitely help with speed).

The OP didn't really specify what his sprites were to be used for (type of game, size on screen, amount of animation, 2D SDL or OpenGL engine, etc.), so my response was a bit general.

And since I'm posting from the US, it would be an imperial ton. Used of course for measuring the weight of the electrons storing the images. :)

Cheers,
Michael
 
Back
Top