DDS format questions

Blitz3D Forums/Blitz3D Programming/DDS format questions

Adam Novagen(Posted 2012) [#1]
I've put this off long enough - another two or three months without any significant work on my project - so it's time to boot my rear in gear.

Now, when I last dealt with textures, I was introduced to the DDS format, and found it to my liking a bit. However, as I understand it, DDS is a format that compresses the textures even in video memory, saving a decent amount of space. If this is the case, though, does this mean extra work for the video processor to DE-compress the textures before rendering? Basically, I'm curious to know how DDS compares to PNG for performance and space usage.


Krischan(Posted 2012) [#2]
I used DDS textures in some of my projects before and as far as I understood the concept this is why I prefer DDS over JPG (oder BMP):

- no lossy compression but still compressed (like PNG favours over JPG)
- included mipmap support (see here)
- can be transparent

I never checked the benchmarks in detail but BlitzTiles ran a little bit faster with DDS textures on my old 9600M laptop video card. But in Blitz3D you have the disadvantage that you can't write to the texturebuffer if a DDS is loaded. And I didn't manage to get them running in minib3d, yet.

Last edited 2012


Rroff(Posted 2012) [#3]
Usually with DDS you put a bit more load on one part of the GPU but take a lot more pressure off another part so overall you get better performance - usually.

As its a fairly simple form of lossless compression (typically 4:1 ratio) the actual processing load isn't that high for decryption unlike other image compression systems that can get 20:1 or higher ratios via multipasses, etc. which would tie up a lot more processing time.


Adam Novagen(Posted 2012) [#4]
Good info, guys, thanks. Looks like I'll be using DDS textures after all, since the only textures that I'm drawing on are created at runtime. The mipmap capabilities don't matter to me since this game is entirely fixed-distance and flat, but the memory savings and performance gains will be nice.

Last edited 2012


Rroff(Posted 2012) [#5]
IIRC you can get mipmapping working with them (think you have to export to a specific version of the format using a tool that supports it) - IIRC theres also the feature with one version of the format where you can use interpolated alpha which means things like wire mesh fences, etc. can have smooth edges instead of jaggies.


Ross C(Posted 2012) [#6]
On another note, I remember jfk posting here that you get a nicer edge around masked textures, then you do with the other standard format. I don't know if he did anything special though.


Adam Novagen(Posted 2012) [#7]
Fortunately that's of little consequence to me, as I either use alpha or non-alpha textures; I have yet to use or need any masked textures.


Ross C(Posted 2012) [#8]
Ah no bother. Masking is good for single surface systems, where you don't want alphaed quads to get drawn out of order (they get drawn by creation order when using the alpha flag).