Jump to content
  • Advertisement
Sign in to follow this  
marltoro

PNG or DDS?

This topic is 2605 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

I am creating a game with DirectX 9 and I was wondering if I should use .png or .dds for the texture format. I have a background texture that is 0.5 mb in .png format and about 8.5 mb in .dds format.

Share this post


Link to post
Share on other sites
Advertisement
I haven't messed around with texturing yet, but my assumption would be .dds. My only reason why is because a texture tool comes with the directx sdk that uses .dds format.

Share this post


Link to post
Share on other sites
That's bit of a difference, usually DDS is smaller but not always (depends on the format, image, if you've chosen the best compression format for the image, etc).

The big benefit of using DDS is the DXT Compression, which the GPU can work with directly. That means you don't have to decode the color information before you send it to the gpu, and the hardware has to fetch less data, since its using the compressed data (a performance win). Other benefits, compared to using PNG (or similar image formats), I would say is the fact that you can store mipmap level data or store all the faces of a cubemap in a single DDS file.

Although, it depends on your needs. Here's a nice little article on DXT texture compression via Shawn hargreaves. Note the last bit of information in that link, not everything looks great with DXT compression...but usually they do.

Share this post


Link to post
Share on other sites
They accomplish different things, really. PNG stores images in a compressed, lossless format that is optimized for storage on disk. DDS stores textures in formats that are native to the GPU, and hence optimized for GPU consumption. For PNG's to be useable as texture data, they typically need processing to convert to a GPU format, and possibly also create mipmaps. This can take some time if you have a lot of textures to load, particularly if you want to load them as a DXT/BC-compressed format so that they're optimized for GPU memory and bandwidth consumption. They will also need some manual processing if you want to load them as 1D, 3D, or Cube textures. DDS can store all of those formats natively, which means you can load them very quickly with little-to-no processing.

What a lot of bigger, complex games do is have a build pipeline that pre-processes source assets into formats that can be consumed by an engine. If you're doing that, DDS can be a suitable output format for a build pipeline that converts to DXT and/or generates mipmaps.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!