PDA

View Full Version : decoding DDS float format (a bit OT...)



flamz
11-07-2005, 12:10 PM
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

Humus
11-07-2005, 03:57 PM
I have code for that in my framework.
http://www.humus.ca/index.php?page=3D

ebray99
11-08-2005, 07:23 AM
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 (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp)

- Kevin

Hampel
11-08-2005, 07:54 AM
This specification seems not to handle *float* images? Can DDS images contain *float* values at all?

V-man
11-08-2005, 11:17 AM
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.

Humus
11-08-2005, 07:56 PM
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.