What is the DDS format used by NWN1?
Many tools have been made by community members or 3ds plug-ins made available on the net. Reference to those can be found here and how to use them.

Moderators: Winterhawk99, Mermut, Bannor Bloodfist

CWebb
Posts: 38
Joined: Sat Jul 29, 2006 10:18 pm

What is the DDS format used by NWN1?

Post by CWebb »

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)

Estelindis
Posts: 291
Joined: Sun Sep 24, 2006 12:05 pm
ctp: Yes
dla: No
TBotR: No
nwnihof: Yes

Post by Estelindis »

Sorry, I don't know any way of editing Bioware DDS directly. I just convert everything, work in TGA, and convert back when I'm finished. :o

User avatar
Bannor Bloodfist
Posts: 1244
Joined: Fri Oct 09, 2009 11:45 pm
ctp: Yes
dla: Yes
TBotR: Yes
nwnihof: Yes

Post by Bannor Bloodfist »

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.

OldMansBeard
Posts: 363
Joined: Sat Dec 17, 2005 7:11 pm

Post by OldMansBeard »

From a rather dim memory, I think that only the header is different from standard DDS.

Try converting a NWN1 DDS file to tga then back to standard DDS and opening them side-by-side in a hex editor. See if you can work out what's different in the headers.

CWebb
Posts: 38
Joined: Sat Jul 29, 2006 10:18 pm

Post by CWebb »

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

User avatar
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:

Post by Michael DarkAngel »

Thanks OMB.

A brilliant idea that just made about five other things come to mind right after I read it.
Image
MDA
TBotR
"I intend to leave a memory of myself in the minds of others."
Leonardo da Vinci,
disciple of experience

User avatar
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:

Post by Michael DarkAngel »

And after doing a bit of research on the bioboards regarding this I came across this little tidbit of info.

Hopefully we'll never lose it.
Image
MDA
TBotR
"I intend to leave a memory of myself in the minds of others."
Leonardo da Vinci,
disciple of experience

CWebb
Posts: 38
Joined: Sat Jul 29, 2006 10:18 pm

Post by CWebb »

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

User avatar
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:

Post by Michael DarkAngel »

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.
Image
MDA
TBotR
"I intend to leave a memory of myself in the minds of others."
Leonardo da Vinci,
disciple of experience

User avatar
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:

Post by Michael DarkAngel »

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
Any chance this could be some form of the DDS flags?
Image
MDA
TBotR
"I intend to leave a memory of myself in the minds of others."
Leonardo da Vinci,
disciple of experience

Post Reply