Sign in to follow this  
riruilo

What is the best texture format for a 2D game (non.resolution dependent)?

Recommended Posts

riruilo    218
Hi friends! I would like to hear your suggestions about this... I´m doing a 2D game using ogre, and my sprites are just polygons, so actually is using 3D acceleration. As I map/paint all textures on polygons (from 0.0 to 1.1 ) I would like that my game was not resolution screen dependant (the same using 800x600 or 1600x1200). BTW I use alpha channel (I like aliased borders, so not just color key) So, What is the best texture format for a 2D game? PNG which takes a lot from hard disk to gpu, and big size? S3TC or DXT3 (is quality too bad? I know this is efficient. BMP, worst than PNG JPG, bad image quality (dirty bordes) Well, What do you think about this question? Thank you.

Share this post


Link to post
Share on other sites
jpetrie    13161
To get resolution independence with texture data, you use more (multiple) texture data. No on-disc format will provide magical scaling abilities. So it comes down to the quality of the source image data.

I usually use PNG, TGA, and/or DDS in various flavors, depending on what I need from the image. They all get converted by my asset pipeline into a custom format anyways.

Either way, you should select the format that meets the needs you have for a specific image. There's nothing wrong with using multiple formats. DDS or PNG is probably a good default -- there's no need to worry about content or load-time optimization until it becomes an issue.

Share this post


Link to post
Share on other sites
swiftcoder    18437
You may want to take a stab at implementing this technique, which would give you spectacular resolution independence (also see here).

As you already pointed out, BMP (huge file sizes, no alpha) and JPEG (lossy compression, no alpha) are pretty much the worst formats you could use. The best would probably be DDS, which lets you use S3TC/DXT3 if you want, and can also store mipmaps and cubemaps.

Share this post


Link to post
Share on other sites
MJP    19790
I generally store my sprites as PNGs, so that the game has access to full-quality images and can decide whether or not to compress them based on the hardware or user preferences. The DXT variants are generally fine for most things, but personally I prefer uncompressed. Also keep in mind that DXT requires that the dimensions are multiples of 4 (I think), and certain DXT variants have limited alpha capabilities.

Also keep in mind that the size of PNG on the hard disk is proportional to the complexity of the images. You can have some huge sprites that take only a few KB when saved as PNG if they're relatively simple. In fact in my game that I'm almost finished with the PNG's make up about 1% of the game's overall disk space usage, with the mp3 music files taking up he lion's share of space.

Share this post


Link to post
Share on other sites
riruilo    218
Wow! ultrafast replies.
Thanks.

I think I will use a mix between DXT3 and PNG, some of my sprites will have big zooms (I dont know how to explain this in English) so DXT mipmaps are perfect. But not all of them. Does DxT3 always build a mipmap or is just an option?

My main worry is if use DXT3, will gamers notice bad texture quality? (my textures are similar to vector graphics, more or less like flash games, so I cannot use JPG because borders are dirty, I dont know if I will have this problem while I use DXT3). What do u think?

Last question :)
Is DX3T suitable for sprite animations? (I guess so)

Thanks in advance.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this