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

Started by
4 comments, last by MJP 15 years, 12 months ago
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.
I've seen things you people wouldn't believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhauser gate. All those moments will be lost in time, like tears in rain. Time to die.
Advertisement
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.
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.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

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.
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.
I've seen things you people wouldn't believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhauser gate. All those moments will be lost in time, like tears in rain. Time to die.
If you've got Photoshop, I'd recommend getting Nvidia's DDS plugin. It can generate mipmaps for you upon saving, and will also let you preview the different DXT variants before you save.

This topic is closed to new replies.

Advertisement