What is the DDS format used by NWN1?
Moderators: Winterhawk99, Mermut, Bannor Bloodfist
What is the DDS format used by NWN1?
Hey, all. Glad to see you're still here and alive
I've been tinkering with my own "facelift" of Neverwinter Nights, working on a modernized game engine that can use NWN assets (since they're mostly well-documented and easy to verify against a known-good renderer), but I'd like to be able to read the NWN DDS format without having to use an external tool to convert it. Does anyone here know what the header format is on NWN1 DDS files? I haven't found anything yet on the 'net.
-Christopher (Webb - not the web manager)
I've been tinkering with my own "facelift" of Neverwinter Nights, working on a modernized game engine that can use NWN assets (since they're mostly well-documented and easy to verify against a known-good renderer), but I'd like to be able to read the NWN DDS format without having to use an external tool to convert it. Does anyone here know what the header format is on NWN1 DDS files? I haven't found anything yet on the 'net.
-Christopher (Webb - not the web manager)
-
- Posts: 291
- Joined: Sun Sep 24, 2006 12:05 pm
- ctp: Yes
- dla: No
- TBotR: No
- nwnihof: Yes
- Bannor Bloodfist
- Posts: 1244
- Joined: Fri Oct 09, 2009 11:45 pm
- ctp: Yes
- dla: Yes
- TBotR: Yes
- nwnihof: Yes
It is a completely NON-Standard DDS file. IE, nothing but Bioware's own internal tool will read it correctly and/or create one correctly.
However, having said that... the person that created nwexplorer might be able to help as he was somehow able to read the header info and export to tga. he doesn't go backwards though, export only.
So, you would probably still need Bioware's dds converter to get back from TGA.
Also note, exporting from dds to tga, and then re-converting back, degrades the original image each time you reconvert. Sorta like a jpg that is over compressed. the dds converter is NOT a lossless program. Meaning that during conversion from tga, it LOSES bits as it compresses it down.
However, having said that... the person that created nwexplorer might be able to help as he was somehow able to read the header info and export to tga. he doesn't go backwards though, export only.
So, you would probably still need Bioware's dds converter to get back from TGA.
Also note, exporting from dds to tga, and then re-converting back, degrades the original image each time you reconvert. Sorta like a jpg that is over compressed. the dds converter is NOT a lossless program. Meaning that during conversion from tga, it LOSES bits as it compresses it down.
-
- Posts: 363
- Joined: Sat Dec 17, 2005 7:11 pm
Bannor - yep, I know it's a lossy algorithm. I had the "pleasure" of having to learn the algorithm some time ago for work, and I've experimented with writing RGB to DXTn optimization algorithms (minimum loss conversions, that sort of thing). I'm not interested in converting back-and-forth, fortunately - I just need to get it loaded so I can display it.
OMB - Yeah, I figured I'd have to just reverse engineer the header. The actual DXTn data looks to be straightforward DXT5, but the header wasn't completely obvious at first glance, other than not matching MS's DDS specification.
-C
OMB - Yeah, I figured I'd have to just reverse engineer the header. The actual DXTn data looks to be straightforward DXT5, but the header wasn't completely obvious at first glance, other than not matching MS's DDS specification.
-C
- Michael DarkAngel
- Posts: 129
- Joined: Thu Jan 13, 2011 6:30 pm
- ctp: No
- dla: Yes
- TBotR: Yes
- nwnihof: Yes
- Location: Somewhere, out there... But, not quite here...
- Contact:
Thanks OMB.
A brilliant idea that just made about five other things come to mind right after I read it.
A brilliant idea that just made about five other things come to mind right after I read it.
MDA
TBotR
"I intend to leave a memory of myself in the minds of others."
Leonardo da Vinci,
disciple of experience
- Michael DarkAngel
- Posts: 129
- Joined: Thu Jan 13, 2011 6:30 pm
- ctp: No
- dla: Yes
- TBotR: Yes
- nwnihof: Yes
- Location: Somewhere, out there... But, not quite here...
- Contact:
Thanks, MDA!
I decrypted the first two dwords (those were obvious), and the 3rd makes sense (3 == 3 bpp RGB, and 4 for RGBA), as does the forth.
However, the 5th word is 3f800000, not 0000803f (gotta swap bytes due to Intel endianness) - which is the floating point value 1.0 encoded in IEEE 32 bit floating point format. And I see another image I looked at has 3ef1a321, which looks to be another floating point value somewhat less than 1.0.
I'll hafta see what SmokeSerpent's pixel-data comment means when I get around to loading the DDS data natively.
-C
I decrypted the first two dwords (those were obvious), and the 3rd makes sense (3 == 3 bpp RGB, and 4 for RGBA), as does the forth.
However, the 5th word is 3f800000, not 0000803f (gotta swap bytes due to Intel endianness) - which is the floating point value 1.0 encoded in IEEE 32 bit floating point format. And I see another image I looked at has 3ef1a321, which looks to be another floating point value somewhat less than 1.0.
I'll hafta see what SmokeSerpent's pixel-data comment means when I get around to loading the DDS data natively.
-C
- Michael DarkAngel
- Posts: 129
- Joined: Thu Jan 13, 2011 6:30 pm
- ctp: No
- dla: Yes
- TBotR: Yes
- nwnihof: Yes
- Location: Somewhere, out there... But, not quite here...
- Contact:
No problem Christopher, and thanks to you as well. If it wasn't for your post I wouldn't have gone hunting for and found the information that has now allowed my RPG Explorer program to view Bioware DDS files.
MDA
TBotR
"I intend to leave a memory of myself in the minds of others."
Leonardo da Vinci,
disciple of experience
- Michael DarkAngel
- Posts: 129
- Joined: Thu Jan 13, 2011 6:30 pm
- ctp: No
- dla: Yes
- TBotR: Yes
- nwnihof: Yes
- Location: Somewhere, out there... But, not quite here...
- Contact:
Any chance this could be some form of the DDS flags?CWebb wrote:Thanks, MDA!
I decrypted the first two dwords (those were obvious), and the 3rd makes sense (3 == 3 bpp RGB, and 4 for RGBA), as does the forth.
However, the 5th word is 3f800000, not 0000803f (gotta swap bytes due to Intel endianness) - which is the floating point value 1.0 encoded in IEEE 32 bit floating point format. And I see another image I looked at has 3ef1a321, which looks to be another floating point value somewhat less than 1.0.
I'll hafta see what SmokeSerpent's pixel-data comment means when I get around to loading the DDS data natively.
-C
MDA
TBotR
"I intend to leave a memory of myself in the minds of others."
Leonardo da Vinci,
disciple of experience