kotiq / wt-tools

War Thunder resource extraction tools
29 stars 3 forks source link

DDS unpacker not fully working ? #11

Open OshidaBCF opened 2 years ago

OshidaBCF commented 2 years ago

I am unpacking the textures of the login screens, and a few of the layers seem to have lost their alpha channel.

You are the last person i know that still work on the too Could you look into it ?

Login screen T-72B.zip (layer 6, 8, 9 and 10)

kotiq commented 2 years ago

Unfortunately, I'm not good at it yet :[

OshidaBCF commented 2 years ago

I see, if you by all luck manage to make something that work, it would be fricking perfect.

thanks a lot.

kotiq commented 1 year ago

For WarThunderCDK v. 28 mar 2022. I tried to unpack the textures using the native tools in AsserViewer2. Here are the steps you can follow:

  1. Unpack WarThunder\ui\images.vromfs.bin into WarThunder\WarThunderCDK\develop\assets
  2. Copy file WarThunder\WarThunderCDK\develop\assets\.folder.blk into WarThunder\WarThunderCDK\develop\assets\images.vromfs.bin\bkg
  3. In file WarThunder\WarThunderCDK\develop\assets\images.vromfs.bin\bkg\.folder.blk, change the filter for textures (line15: dds -> ddsx)
    find:t="^(.*)\.ddsx$"
  4. Start AsserViewer2. You will see the textures in the tree at the address \Root\assets\images.vromfs.bin\bkg.

Screenshot_20221030_190341

login_layer_t72b_1_{10,6,8,9} have the alpha channel completely black :[

OshidaBCF commented 1 year ago

WTH? So it's not the dds unpacker that's broken.

but either vromfs. Or gaijin packer itself?

kotiq commented 1 year ago

The flame layer on the animated login screen appears transparent. Perhaps they are somehow combining RGB channels to get the alpha channel dynamically. The later version of the CDK (20 apr 2022, 12 jul 2022) doesn't allow me to pull off the above view trick and closes with an error when trying to open a ddsx texture.

OshidaBCF commented 1 year ago

hmmm, then this is missing in our dds unpacker. i tried to "learn" dds, but it's very confusing.

OshidaBCF commented 1 year ago

I managed to understand DDSs a bit more, and i think that either the vromfs unpacker break "some" layers files, which would be really weird, or Gaijin that "pack" some layer files corrupted.

I managed to fix a problem that's 100% on gaijin side for skins's textures : The "level" is set to 13 which make the texture unusable, forcing the level to be 1 cause no issues and make every skin's texture downloadable.

So frankly i do not know.

kotiq commented 1 year ago

The texture files are stored in an uncompressed .bin container that has a .vromfs image digest. The texture is unpacked as you see it by opening the corresponding .vromfs.bin file in the hex editor.

OshidaBCF commented 1 year ago

so somewhere in the vromfs there is the raw bytes of each dds ?

kotiq commented 1 year ago

Only as a DDSX file. DDS you can probably find somewhere in the game's memory dump. image

OshidaBCF commented 1 year ago

I see....

So it's correctly written in the vromfs So that really mean it's gaijin's "fault" ?

OshidaBCF commented 12 months ago

I FOUND WHY IT WASN'T WORKING

For some reasons, some DDS has the alpha of each pixel = to (R+G+B) / 3 image

The "easy" way to fix it is to just pass though each pixel I used PILLOW for that, but i don't know if it would be possible without the module, as DDS's aren't an easy format