ROM Hack How can i tex to dds&png

maxjunxi

Member
OP
Newcomer
Joined
Nov 19, 2022
Messages
7
Trophies
0
Age
33
XP
108
Country
China
I want to make the NS version of Titan Journey MOD, because the texture TEX.nvn cannot be converted into dds or png, which causes troubles in production.Please do me a favor, thank you very much.:wub:
 

Attachments

  • NScaravanwindow01.zip
    433.8 KB · Views: 33

masagrator

The patches guy
Developer
Joined
Oct 14, 2018
Messages
6,270
Trophies
3
XP
12,037
Country
Poland
Just checked briefly. I don't want to get involved into this, so if anybody wants to help with making converter that will swizzle texture, here you have some informations:

MAGIC = "TEX\x01"
size of file without first 12 bytes - offset 0x8
size of texture - offsets 0xC and 0x30 (my guess is that 0xC stores size of whole texture in case if texture is 3D, and 0x30 only for each 2D texture - since this texture is not 3D, both are the same)

width - 0x18
height - 0x1C

those are dimensions of texture after processing it (unswizzle and cut). Since this is swizzled texture, dimensions must pass equation "x % 16 = 0" and iirc texture cannot be smaller than 64x64, so if provided dimensions are 565x637, the real dimensions are 576x640

type of texture - offset 0x28 (0x25 is RGBA8 - it's using values stored in Nintendo SDK). Some of them you can find here:
https://github.com/KillzXGaming/Swi..._Library/FileFormats/Texture/WTB.cs#L241-L254

Actual raw data is stored at 0x84.

Everything else is a mystery. Somewhere must be stored mipmap count and texture depth (in both cases it will be 1 for provided texture). At 0x78 it may store texturelayout value in log2(x) form - you can confirm that by checking textures with height lower than 256. If it's lower than 128, it should be 2. If it's lower than 256, it should be 3. For anything else it must be 4.

Result:
NScaravanwindow01.png
 
Last edited by masagrator,

maxjunxi

Member
OP
Newcomer
Joined
Nov 19, 2022
Messages
7
Trophies
0
Age
33
XP
108
Country
China
Thank you, great, thank you for your tips, but my ability is limited, and I don't even have a clue, which puts me in a deadlock.:sad:
Post automatically merged:

I tried to turn it, but it didn't seem very good. :sad:
NScaravanwindow01.png

Post automatically merged:

My God, thank you, I succeeded. But now how to switch back to TEX format:wacko:
20221120025759.png
Post automatically merged:

I tried to make a new model, and it was very successful, but there seems to be a problem with the location of the texture?
Post automatically merged:

I succeeded, and it was very smooth, but my operation was quite cumbersome. I still hope to have an EXE script. Finally, thank masagrator for his advice, which has made me so successful. Thank you!
:):):)
 

Attachments

  • 2.png
    2.png
    1.6 MB · Views: 22
  • 1.png
    1.png
    1.5 MB · Views: 22
  • 3.png
    3.png
    30.1 KB · Views: 24
  • QQ图片20221120223923.png
    QQ图片20221120223923.png
    1.4 MB · Views: 19
  • QQ图片20221120224029.png
    QQ图片20221120224029.png
    1.5 MB · Views: 20
Last edited by maxjunxi,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Maximumbeans @ Maximumbeans: butte