Skip to main content
GameDev.net gamedev.net
🔒 Locked

PNG or DDS?

Started by marltoro May 1, 2011 at 9:47 PM 2 replies 22.3k views
Original Post
marltoro
marltoro
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.
LevyDee
LevyDee
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.
Starnick
Starnick
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.
MJP
MJP
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.