The VG Resource
help with "swizzled" switch textures? - Printable Version

+- The VG Resource (https://www.vg-resource.com)
+-- Forum: The Resources (https://www.vg-resource.com/forum-109.html)
+--- Forum: The Models Resource (https://www.vg-resource.com/forum-111.html)
+---- Forum: Ripping Help (https://www.vg-resource.com/forum-115.html)
+---- Thread: help with "swizzled" switch textures? (/thread-33929.html)



help with "swizzled" switch textures? - rrrrrraven - 08-28-2018

me and a friend have been trying to rip textures properly from the new boku no hero academia game, ones justice for multiple hours now and we just can't figure it out. we can get the textures properly exported but they have the swizzle encoding thing that i've seen people talk about on them. we've been searching for a long time and we haven't been able to find a solution/way to "un-swizzle" the textures. is there anything out there that can help us? 

here's examples of what i mean:

[Image: UmxIOYg.png] [Image: 4wb4nOY.png]

any help is appreciated greatly! thank you Heart


RE: help with "swizzled" switch textures? - Raccoon Sam - 08-29-2018

Doesn't look terribly complex, but we need more context if we wanna figure it out.
Can you upload the file(s)? How did you get those images you attached? Do you have an idea what they "should" look like?
Thanks.


RE: help with "swizzled" switch textures? - Raccoon Sam - 08-29-2018

How did you convert the UEXP files to those image files?
edit:nevermind i think i understand this now
writing an unswizzler


mmmyeah it needs some work still but it works
[Image: w6c6ID4.png]


RE: help with "swizzled" switch textures? - Raccoon Sam - 08-30-2018

(08-30-2018, 02:31 AM)epikus29 Wrote: Awesome! Can you tell us how you did it? Cute
If you still want to open the uexp file you can do it with Gildor's umodel (set override game detection to unreal 4.18)
Thank you.

I took a good hard look at the swizzled image in Photoshop and made some observations:
• Things appear to be on a 4×4 grid
• Four adjacent tiles can be assembled to a bigger 8×8 tile that looks right, if your order is [1, 2, 3, 4] => [top left, bottom left, top right, bottom right]


I wrote a script to assemble these 4×4 tiles to my 8×8 tiles and exported them to individual PNGs. I then started to assemble them in order and made some observations:
• Things only look right when you assemble the tiles from top to bottom in four tiles per column
So, in essence:
1
2
3
4
5
6
7
8
9
10
...
Looked kinda right, but:
1 5
2 6
3 7
4 8
9 13
...
Looked absolutely right.

So I wrote a script to spit out these 16×256 strips, and they all looked right.

I then started to assemble these strips and made some observations:
• The strips look right when assembled from left to right, but a new row must be started when you reach a width of 1024 (64 strips)

So here we are. Much of the process can be automated, but I only worked with the 1024×1024 image. I'm now trying to write a program that is dimension-agnostic and works on any size image.

you, probably Wrote:man, how did you figure out this shit
Just looking at the image up very close and making observations is enough! I used Python and PIL to program the unswizzler. I highly recommend the Python course in codecademy to get started with Python - it's never too late to learn a programming language.


RE: help with "swizzled" switch textures? - Demonslayerx8 - 09-19-2018

have any plans on releasing the script? doing it all by hand is too time consuming.


RE: help with "swizzled" switch textures? - Makoto - 09-20-2018

https://zenhax.com/viewtopic.php?f=7&t=7099 support nintendo switch swizzled textures


RE: help with "swizzled" switch textures? - Demonslayerx8 - 09-20-2018

(09-20-2018, 06:23 AM)Makoto Wrote: https://zenhax.com/viewtopic.php?f=7&t=7099 support nintendo switch swizzled textures

eh that 1 I've already been using, but still gotta fix the textures by hand since for 1024x1024, u have to export it as 4096x256 and then fix manually in a photo editor, so I'd rather save time by using a script w/o doing the manual work.