01-16-2021, 03:42 PM
Got it solved! 4-bpp texture is multi-level swizzling. It also didn't help most of these images are in grayscale.
Instead of using a math formula to do everything, I decided to waste some memory and CPU power to unswizzle them by logic. Now, not only I can get 4-bpp at any size to unswizzle correctly, I also figured out how to handle landscape and portrait textures as well!
In short, for landscape texture 512x256 , you pad it to become a square 512x512 , and then unswizzle normally:
[attachment=11483]
For portrait texture 256x512 , you split them into two square 256x256 and unswizzle them independently. You join them back after that.
[attachment=11484]
I have everything on both GrimGrimoire and Odin Sphere on PS2 now. I can work on those too.
Until next update, take care!
- Rufas
Instead of using a math formula to do everything, I decided to waste some memory and CPU power to unswizzle them by logic. Now, not only I can get 4-bpp at any size to unswizzle correctly, I also figured out how to handle landscape and portrait textures as well!
In short, for landscape texture 512x256 , you pad it to become a square 512x512 , and then unswizzle normally:
[attachment=11483]
For portrait texture 256x512 , you split them into two square 256x256 and unswizzle them independently. You join them back after that.
[attachment=11484]
I have everything on both GrimGrimoire and Odin Sphere on PS2 now. I can work on those too.
Until next update, take care!
- Rufas