XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Tue Dec 11, 2018 2:07 am

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: LittleBigPlanet PlayStation Vita .tex (GXT, PVR?)
PostPosted: Sun Apr 15, 2018 7:49 pm 
Offline
advanced
User avatar

Joined: Sun Sep 07, 2014 10:24 pm
Posts: 40
Has thanked: 6 times
Have thanks: 4 times
Hey, been doing some work on a tool for LBP games and I ran into a brick wall when I looked into the format for its textures. Seems that the console games used variants of DDS (LBP 1 straight up using DDS files compressed with zlib) while LBP 2 and LBP 3 have DDS files without the headers, which are manually loaded in via the header of the compressed file (see below).. Both are easy to figure out, simple DXT1 and DXT5 dds textures which my tool can read no problem.

However, I'm personally unfamiliar with PS Vita texture files, but I believe they're stored as such:
http://www.vitadevwiki.com/index.php?title=GXT

Here's a few samples.

http://puu.sh/A3OUU.tex - doodle_lbp1tree.tex (Would be DXT5 if it were a DDS, 128x128)
http://puu.sh/A3P8h.tex - susan_icon.tex (Equivalent to DXT5, 128x128)
http://puu.sh/A3P2N.tex - tree_bark_diffuse.tex (Equivalent to DXT1, 256x256)
http://puu.sh/A3P57.tex - velvet_cushion_diffuse.tex (Equivalent to DXT1, 256x256)

Here's where I determined the above information..
Image
The format here in the compressed data is exactly the same as LBP 2/3, aside from the magic number, which differs by 1 byte. The above information can be used to extract the raw dds file data (same structure as a dds but without a header), however here it is swizzled when viewed in a program like TextureFinder, which leads me to believe it's some form of GXT.
The compressed data is kept in chunks up to 32KiB each when decompressed, and put in sequential order, labeled by the count of zlib chunks. If there is more than one chunk, it's indexed with repeated entries of the green+yellow labeled bytes in that image.

Adding a GXT header to the raw, uncompressed data (http://puu.sh/A3PC1.gxt) and converting it with this tool: https://github.com/xdanieldzd/GXTConvert results in something like this...
Image

Also, in some of these files, there's extra added information in the header and I have no idea what it is. Files with the extra data have a magic number of "GXTS" rather than "GXTs."
Image
Seems the 10 is referring to the number of bytes that come after that 0x10000000, but I don't think it's relevant to actually extracting the texture (unsure)

Can anyone with maybe a little knowledge of Vita file texture formats help me out with some information on this file format, or GXT stuff in general? I haven't entered the Vita scene beyond this game.

_________________
"O for a Muse of fire, that would ascend the brightest heaven of invention"


Top
 Profile  
 
 Post subject: Re: LittleBigPlanet PlayStation Vita .tex (GXT, PVR?)
PostPosted: Mon Apr 16, 2018 1:53 am 
Offline
VIP member
VIP member
User avatar

Joined: Wed Nov 05, 2008 12:16 pm
Posts: 1118
Has thanked: 2258 times
Have thanks: 637 times
i'm not entirely sure what your questions is because you seem to have this thing figured out. :D
here is susan_icon.tex with a gxt header prepended to the image based on your findings and links


i decompressed the data with offzip and used this header then opened with Noesis :D
Code:
47 58 54 00 03 00 00 10 01 00 00 00 40 00 00 00
80 55 00 00 00 00 00 00 00 00 00 00 00 00 00 00
40 00 00 00 80 55 00 00 FF FF FF FF 00 00 00 00
00 00 00 00 00 00 00 87 80 00 80 00 01 00 00 00


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.


_________________
Noesis
Hex2obj
QuickBMS
Asset Studio
TextureFinder


Top
 Profile  
 
 Post subject: Re: LittleBigPlanet PlayStation Vita .tex (GXT, PVR?)
PostPosted: Mon Apr 16, 2018 2:52 am 
Offline
advanced
User avatar

Joined: Sun Sep 07, 2014 10:24 pm
Posts: 40
Has thanked: 6 times
Have thanks: 4 times
My main issue was figuring out the correct GXT header setup for these textures, as I'm unfamiliar with the format. Thank you!

What about the DXT1 equivalents?

ALSO, for the hell of it is there any way to convert back to GXT, perhaps from DDS? Not a huge priority but it's something I'd like to add to my tool down the line if possible.

_________________
"O for a Muse of fire, that would ascend the brightest heaven of invention"


Top
 Profile  
 
 Post subject: Re: LittleBigPlanet PlayStation Vita .tex (GXT, PVR?)
PostPosted: Mon Apr 16, 2018 3:13 am 
Offline
VIP member
VIP member
User avatar

Joined: Wed Nov 05, 2008 12:16 pm
Posts: 1118
Has thanked: 2258 times
Have thanks: 637 times
tree_bark_diffuse.tex :D

header used
Code:
47 58 54 00 03 00 00 10 01 00 00 00 40 00 00 00
00 AB 00 00 00 00 00 00 00 00 00 00 00 00 00 00
40 00 00 00 00 AB 00 00 FF FF FF FF 00 00 00 00
00 00 00 00 00 00 00 85 00 01 00 01 01 00 00 00


could probably make a bms script to decompress the chunks and build a gxt header for these easily. :D


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.


_________________
Noesis
Hex2obj
QuickBMS
Asset Studio
TextureFinder


Top
 Profile  
 
 Post subject: Re: LittleBigPlanet PlayStation Vita .tex (GXT, PVR?)
PostPosted: Wed Apr 18, 2018 3:32 pm 
Offline
VIP member
VIP member
User avatar

Joined: Wed Nov 05, 2008 12:16 pm
Posts: 1118
Has thanked: 2258 times
Have thanks: 637 times
here is Noesis python script to open your 4 tex samples :D

supports dxt1 and dxt5
the script will decompress the chunks on the fly and build a gxt header.


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.


_________________
Noesis
Hex2obj
QuickBMS
Asset Studio
TextureFinder


Top
 Profile  
 
 Post subject: Re: LittleBigPlanet PlayStation Vita .tex (GXT, PVR?)
PostPosted: Wed Apr 18, 2018 6:43 pm 
Offline
advanced
User avatar

Joined: Sun Sep 07, 2014 10:24 pm
Posts: 40
Has thanked: 6 times
Have thanks: 4 times
Oh I wasn't expecting that at all - thank you so much! I'm trying to learn a bit about writing noesis plugins so this helps me out a ton.

_________________
"O for a Muse of fire, that would ascend the brightest heaven of invention"


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: MasterMRL and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group