elbereth/DragonUnPACKer

Dragon Unpacker crashes when converting .dds files from .xtc

boldc opened this issue · 1 comments

boldc commented

DRAGON UNPACKER CRASHES WHILE CONVERTING .DDS FILES FROM .XTC

STEPS TO REPRODUCE:

  • Using Dragon UnPacker open an .xtc texture file (Chronicles of Riddick, Dark Athena/Escape from Butcher's Bay): for example, W02.xtc
  • Select a file: for example W02_001.dds
  • Choose Extract File to -> (BMP, PNG, or TGA format)
  • Convert file to a location

RESULT:
Dragon UnPacker freezes, must be restarted
The converted file is unviewable/unusable

EXPECTED:
Program does not crash
Converted textures are usable

=======================================================================
DRAGON UNPACKER CORRUPTS .DDS FILES EXTRACTED FROM .XTC

STEPS TO REPRODUCE:

  • Using Dragon UnPacker open an .xtc texture file (Chronicles of Riddick, Dark Athena/Escape from Butcher's Bay): for example, W02.xtc
  • Select a file: for example W02_001.dds
  • Choose Extract File to -> Without conversion ->
  • Extract file to a location

RESULT:
The extracted graphics file contains corruption/artifacts, rendering it unusable
This happens with SOME diffuse textures
Corruption/artifacts appears to happen with ALL extracted normal map textures
Results are the same whether viewed in InfranView or Photoshop

W02_0001_N

EXPECTED:
Extracted textures do not have artifacts/graphical corruption

(Note: Operating System Windows 10 Professional, 64-bit)

boldc commented

I read on the [Xentax forum](url=737026 that the .dds header can be edited with a hex editor, changing the normal map .dds files from DXT1 to DXT5 and then they become usable.

I took an extracted normal map (xxxx_n.dds), opened it with a hex editor and changed the first value I saw "dxt1" and changed it to "dxt5". The first thing that happened is that the thumbnail of the image in WIndows Exploerer suddenly displayed properly.

Unfortunately the file still didn't work (I couldn't open it with photoshop), I suspect because I don't know anything about hex editing and maybe missed a step.

EDIT: I also found this information which may be useful https://github.com/EternalYoshi/ThreeWorkTool
"DXT1 and DXT5 have differing compression formulas meaning you can't interchange them or you will get corrupted pixels in game or just straight up crashing."

Which probably explains the issue I'm encountering.

It would seem a possible solution is to have Dragon UnPacker export all normals maps as DXT5 instead of DXT1

(all Riddick normal map textures end in the suffix _n.dds)