Users browsing this thread: 1 Guest(s)
Switch BNTX research
#12
(07-26-2017, 03:23 PM)aboood40091 Wrote: I made a BNTX extractor (in which the swizzling is based on your algorithm, but with slight improvements) and every texture I tried works fine.
Nice one! I took a look on the repo, and the readme says "format used in Wii U games" but I guess you meant "Switch games", just a note.

Also, the swizzling issue only affected a few textures. But well, good news is that I (think) that I managed to fix it. At least it's working on all samples I have here, yay! What I discovered using trial and error, was that the wrong textures was always on the same height range. Basically, if we have for example, a texture with height 68. We will need to round it up to calculate the number of bits for each coord value (X and Y), so we get 128. If we subtract 128 - 68 we get the wasted space height, so basically 60. Looks like that it uses some threshold to decide whenever to round up or down based on that. If the wasted height is greater than 2/3 of the rounded down height (in this case 64), it seems to round down, otherwise it rounds up. Now tbh, this seems a bit weird, but all the tests I did so far indicates that this is the right thing to do. With this code in place, all the swizzle issues I knew of are now gone. The code on github is already updated, and if anyone find any swizzle issues just let me know.

I will try to fix the issues pointed by KillzXGaming tomorrow.
Reply
Thanked by:


Messages In This Thread
Switch BNTX research - by gdkchan - 07-21-2017, 09:59 PM
RE: Switch BNTX research - by Random Talking Bush - 07-22-2017, 09:41 AM
RE: Switch BNTX research - by gdkchan - 07-22-2017, 08:28 PM
RE: Switch BNTX research - by Random Talking Bush - 07-23-2017, 09:06 AM
RE: Switch BNTX research - by gdkchan - 07-23-2017, 11:57 PM
RE: Switch BNTX research - by aboood40091 - 08-18-2017, 12:23 PM
RE: Switch BNTX research - by gdkchan - 08-19-2017, 02:09 PM
RE: Switch BNTX research - by aboood40091 - 09-21-2017, 09:03 PM
RE: Switch BNTX research - by gdkchan - 07-24-2017, 10:22 PM
RE: Switch BNTX research - by KillzXGaming - 07-26-2017, 11:15 AM
RE: Switch BNTX research - by Random Talking Bush - 07-26-2017, 11:39 AM
RE: Switch BNTX research - by KillzXGaming - 07-26-2017, 12:15 PM
RE: Switch BNTX research - by gdkchan - 07-26-2017, 01:10 PM
RE: Switch BNTX research - by gdkchan - 07-27-2017, 10:50 AM
RE: Switch BNTX research - by aboood40091 - 07-26-2017, 03:23 PM
RE: Switch BNTX research - by gdkchan - 07-26-2017, 10:37 PM
RE: Switch BNTX research - by Random Talking Bush - 08-05-2017, 01:48 AM
RE: Switch BNTX research - by gdkchan - 08-05-2017, 08:20 AM
RE: Switch BNTX research - by Rich - 09-19-2017, 09:33 AM

Forum Jump: