THPS PS2 texture files (.tex.ps2) - help me convert it to tm2

Textures, recreate headers, conversions, algorithms and parsing of image files
BloodRaynare
Posts: 367
Joined: Fri Mar 10, 2017 7:23 am

THPS PS2 texture files (.tex.ps2) - help me convert it to tm2

Post by BloodRaynare »

Is it compressed or encrypted? Because when I try to view the textures via Console Texture Explorer none of them looks right.
BloodRaynare
Posts: 367
Joined: Fri Mar 10, 2017 7:23 am

Re: THPS PS2 texture files (.tex.ps2) - help me convert it to tm2

Post by BloodRaynare »

Bump.
Has anybody figured it out?
Acewell
Posts: 706
Joined: Fri Aug 08, 2014 1:06 am

Re: THPS PS2 texture files (.tex.ps2) - help me convert it to tm2

Post by Acewell »

i took a look but could not get anything decent from the image data,
looks like the sample contains 7 paletted images though. :(
episoder
Posts: 123
Joined: Fri Oct 27, 2017 7:36 pm

Re: THPS PS2 texture files (.tex.ps2) - help me convert it to tm2

Post by episoder »

yep. looks like ps2 block shuffle or swizzle. and 16 color (?) textures. i have no decoder for that. one of the weirdest formats this box has.
BloodRaynare
Posts: 367
Joined: Fri Mar 10, 2017 7:23 am

Re: THPS PS2 texture files (.tex.ps2) - help me convert it to tm2

Post by BloodRaynare »

Ok, some update after a quite long time. Turns out those .tex.ps2 files are using 7bpp (128 color palletes) format with 16-bit CLUT (2-bytes per color). I could just take one of the textures data and it's pallete then set the headers value accordingly to create a new TIM2 data out of it, but still need some help for unswizzle it correctly though.
Allen
Posts: 156
Joined: Tue Sep 01, 2015 9:44 am

Re: THPS PS2 texture files (.tex.ps2) - help me convert it to tm2

Post by Allen »

The sample files are 8BPP palette format, 256 colors, and palette format 16BPP RGBA5551.
Pixel data is swizzled.

Put plugin to Noesis\plugins\python folder.

Edit: Updated support levels textures.
Edit 2: Updated support *.img.tex file.
Last edited by Allen on Mon Apr 06, 2020 10:30 am, edited 2 times in total.
BloodRaynare
Posts: 367
Joined: Fri Mar 10, 2017 7:23 am

Re: THPS PS2 texture files (.tex.ps2) - help me convert it to tm2

Post by BloodRaynare »

I just noticed a reply to this thread after few months but thanks a bunch @Allen.

However, can you edit the scripts for extracting the levels textures as well?
Here's the samples
bo.tex.rar

ca.tex.rar
Allen
Posts: 156
Joined: Tue Sep 01, 2015 9:44 am

Re: THPS PS2 texture files (.tex.ps2) - help me convert it to tm2

Post by Allen »

BloodRaynare wrote:I just noticed a reply to this thread after few months but thanks a bunch @Allen.

However, can you edit the scripts for extracting the levels textures as well?
Here's the samples
bo.tex.rar
ca.tex.rar

Support for them has been updated. viewtopic.php?f=7&t=11052&p=55573#p53330
BloodRaynare
Posts: 367
Joined: Fri Mar 10, 2017 7:23 am

Re: THPS PS2 texture files (.tex.ps2) - help me convert it to tm2

Post by BloodRaynare »

Allen wrote:
BloodRaynare wrote:I just noticed a reply to this thread after few months but thanks a bunch @Allen.

However, can you edit the scripts for extracting the levels textures as well?
Here's the samples
bo.tex.rar
ca.tex.rar

Support for them has been updated. viewtopic.php?f=7&t=11052&p=55573#p53330


Thanks a bunch now the levels texture packs are extractable, though some texture still unswizzled incorrectly but maybe because some of the texture using unorthodox swizzle pattern. Like this single .img.ps2 texture files i put here as a example:
movie_icon.img.zip

As you can see from the attachment files above, the swizzle pattern is kinda weird.
JackTheRipper
Posts: 51
Joined: Mon Jan 10, 2022 12:12 am

Re: THPS PS2 texture files (.tex.ps2) - help me convert it to tm2

Post by JackTheRipper »

One from some other neversoft titles don't work as expected.
BloodRaynare
Posts: 367
Joined: Fri Mar 10, 2017 7:23 am

Re: THPS PS2 texture files (.tex.ps2) - help me convert it to tm2

Post by BloodRaynare »

JackTheRipper wrote:One from some other neversoft titles don't work as expected.


These are the newer variants of the PS2 IMG format, first used in American Wasteland or Guitar Hero III i think. You can try using GH3 img tools for this one (if you managed to find it), though I can't say about reinserting the edited textures back.

EDIT: I forgot that the tools was in a really preliminary state, so some of the img will have incorrect colors when converted. Your best bet is using some raw texture viewer tools (like Kuriimu2), however you can only extract the textures (so no reinsert/reimport).

EDIT 2: Well, even the Kuriimu2 fails to display the palettes correctly (Already tried all the possible format), so IDK what this is.

EDIT 3: I tried it with TiledGGD, and it manages to display the textures correctly. Turns out the palettes were in "Tiled" mode, and currently Kuriimu2 lacks a feature to display the pallete in that mode. Though to be fair, TiledGGD also lacks the "unswizzling" feature to handle some swizzled PS2 textures, but luckily your example files uses none of that.
Allen
Posts: 156
Joined: Tue Sep 01, 2015 9:44 am

Re: THPS PS2 texture files (.tex.ps2) - help me convert it to tm2

Post by Allen »

JackTheRipper wrote:One from some other neversoft titles don't work as expected.

Here is a noesis python script.