Gildor's Forums

Author Topic: PS4 texture decoding bugfix  (Read 123 times)
Posts: 1

View Profile
PS4 texture decoding bugfix
« on: August 20, 2023, 01:21 »


First of all thanks for your tool and the source code, this has really helped me figure out how to read package content.
I was working on decoding PS4 textures and found this problem with your current algorithm, with some of the textures:

The texture resolution is 692x152 and that's what's causing the issue, in UntileCompressedPS4Texture:

// PS4 image is encoded as 8x8 block min
int blockWidth2 = max(blockWidth, 8);
int blockHeight2 = max(blockHeight, 8);

From what I found out, both blockWidth2 and blockHeight2 need to be rounded up to the nearest multiple of 8 instead. Doing so gives you the correct un-tiled result:

Just thought i would post the solution here in case you found it useful.

Again, thank you for all your work
« Last Edit: August 20, 2023, 01:35 by FCH823 » Logged
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS