decoding DDS float format (a bit OT...)

Sorry if this is a bit off-topic, but I’ve been looking everywhere for source code that shows how to decode a DDS float texture.
nVidia released a lib (dxtlib) that is supposed to help reading them, but it doesn’t.

Did anyone have any success reading DDS floating-point textures?

tx

I have code for that in my framework.
http://www.humus.ca/index.php?page=3D

I do this in my engine actually. The DDS file format is pretty straight forward. You can find the spec for the format here:
http://msdn.microsoft.com/library/defaul…sfileformat.asp

  • Kevin

This specification seems not to handle float images? Can DDS images contain float values at all?

Yes, DDS can store float. 16 bit and 32 bit. Single channel, or 2 or 4. I think you don’t compress them.

DDS is also supported by http://openil.sourceforge.net/

but it probably doesn’t handle float.

Originally posted by Hampel:
This specification seems not to handle float images? Can DDS images contain float values at all?
The DDS format can handle all formats specified by D3D and any format that has a FOURCC code (and thus is easily extended when a new format comes around, like for instance 3Dc). Float images are definitely supported. It’s easy to load too, since it’s stored in a raw format. No compression or anything. In D3D you should be able to just fread() directly into locked surface.