Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gust_g1t: Support for type 0x60 and 0x62 (WiiU) #52

Open
VitaSmith opened this issue Nov 16, 2021 · 5 comments
Open

gust_g1t: Support for type 0x60 and 0x62 (WiiU) #52

VitaSmith opened this issue Nov 16, 2021 · 5 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@VitaSmith
Copy link
Owner

Originally submitted by @horxd33:

Can you try to support this type of g1t texture format?
https://mega.nz/folder/R083VAQQ#EsLbWXrQ80bEe34ugGURUA
The following error message will appear when unpacking, and the wrong texture
ERROR

@VitaSmith
Copy link
Owner Author

VitaSmith commented Nov 16, 2021

I have a look at it, and these textures are weird. For one thing, when you have mipmaps, most of them appear to have more data than they should include, and even when assuming that the WiiU platform might have a minimum default size for mipmaps (e.g. 0x100 or 0x200 bytes, regardless of the mipmap dimensions), I can't quite just manage to account for all the extra data.

And I also have no clue how swizzling works on these textures. Best I can tell is that we might need a width factor adjustment of 2, which I added in the latest version of gust_g1t, but, even after fiddling with the with, height and Morton order factors, I still can't get to produce a texture that looks correct.

Best I can do at this stage is wait for someone to figure out how the extracted texture is supposed to look like when converted to DDS, especially in terms of mipmap dimensions, so that we can get a clue as to how swizzling should apply.

I will therefore keep this issue open, but with a help wanted status.

@VitaSmith VitaSmith self-assigned this Nov 16, 2021
@VitaSmith VitaSmith added the help wanted Extra attention is needed label Nov 16, 2021
@shizukachan
Copy link

Is that ASTC texture compression?

@VitaSmith
Copy link
Owner Author

I don't believe it's ASTC (NB: nVidia has a good overview of ASTC here), as I'd expect the colors/pixel blocks to be completely off, and that's not what we're observing here:
000

In other words, the individual pixel elements seem to be okay. It's just the swizzling that's off. And of course I've tried all the swizzling alterations I could think off without any success.

Plus, we know that type 0x60 is DDS_FORMAT_DXT1 + swizzling, and I'm pretty sure that Koei/Gust are always grouping DXT1/DXT3/DXT5 sequentially, so type 0x62 has to be DDS_FORMAT_DXT5 + swizzling.

On the other hand, it is possible that the new 0x72 type that we've seen in mainfont00_hd1080_0.g1t from #50 could be some form of ASTC...

@Joschuka
Copy link

WiiU Swizzle is unfortunately a mess, since the only interesting games (Fatal Frame 5 and HW) from Koei are now released on other platforms I didn't have the motivation to deal with these. It is actually funny that while they use tiling for WiiU, Vita, PS4, X360 they didn't bother with the Switch, really wonder why....

Anyways if you feel brave enough I'm pretty sure that the Switch Toolbox can grab WiiU textures from Hyrule Warriors WiiU so if you really feel motivated to add support for these I'd recommend to check out the code there https://github.com/KillzXGaming/Switch-Toolbox/blob/master/File_Format_Library/FileFormats/HyruleWarriors/G1T/G1TFile.cs#L251-L276

@HoJo215
Copy link

HoJo215 commented Jan 18, 2022

You might want to look at this.
I can get the PC GMPK loaded up on PS4 without crashing by switching the PC G1T's
header at offset 0x14 to 0B but textures load up messed up with black garble..

WiiU japanese bikini mod on ps4
ff-mod-ps4

NSFW site: Conversation starts after this post

https://www.loverslab.com/topic/178718-fatal-frame-maiden-of-the-black-water-nude-mods/?do=findComment&comment=3643124

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants