Jump to content
  • Advertisement
Sign in to follow this  
EIRIKMEDKOMPIS

2D Character Animation, Texture Memory Issue

This topic is 2699 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello!

Let's say I want to create a game with 2D characters. Up to 10 characters can be active at once, each character having 10 different animations of 50 frames each, with resolution 256x256 RGBA. It doesn't sound undoable, but the memory required to store all that data would be 10 * 10 * 50 * 256^2 * 4 bytes = 1.22 GB (I think), which seems like unreasonably much texture memory to occupy.

I suppose an animation would only have to be located in texture memory when actually being used, but then I'd have to dynamically load new animations on demand and I fear that could cause performance spikes.

I could switch to skeletal animation, but that would make character creation more of a hassle for me, and 2D sprites work well with the visual style of the game (since just about anything can be added to a bitmap image).

Ideally, only the current image for each character would be sent to the graphics card each frame. I want to be able to access the images as textures, and not just draw them on the screen using something like glDrawPixels (or equivalent). The best solution I can think of is continuously calling glTexImage2D/glTexSubImage2D to update each character's texture (or using PBOs where available). Is this fast enough for a low-end consumer PC? Is it fast enough for, say, an average Android phone (using lower resolution textures)? I know I could/should try different approaches myself, but I don't want to find a solution that just happens to work well on my equipment.

Thanks in advance, I'm looking forward to hearing your thoughts.

Share this post


Link to post
Share on other sites
Advertisement
use s3tc compressed texture and you're down to under 200megs




as a side note, it would probably be faster to draw your characters on cpu and send the final image to the gpu, than transfering all the images before each draw command individually. (if s3tc is not a solution for you).

Share this post


Link to post
Share on other sites
You might also like to think about how you're going to author these 5,000 frames. If you can produce each one in just 5 minutes, it's still going to take you over 400 hours to complete them all. Perhaps you could get away with using fewer distinct characters and animations, or a lower frame rate?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!