READ THE RULES: Click here

Follow us on Facebook: https://www.facebook.com/xentax/ :)

Extracting .tex textures from the legend of spyro a new beginning (ps2)

Get your graphics formats figures out here! Got details for others? Post here!
episoder
veteran
Posts: 138
Joined: Fri Oct 16, 2015 8:05 pm
Has thanked: 3 times
Been thanked: 66 times

Re: Extracting .tex textures from the legend of spyro a new beginning (ps2)

Post by episoder » Fri Aug 30, 2019 1:05 pm

reimport with this method is not possible. to reimport the data gotta be extracted into palette tga images and they gotta be edited in indexed mode that allows the palette transparency. or they gotta convert back into indexed mode and keep the correct transparency across the palette. i'm unsure if the ps2 blending unit needs alpha 0x80 to work correct, but i'd assume so. and gimp for example doesn't do that. i could write the exporter in bms but i can't get valid data to pack back into it. i'm not gonna get photoshop to try this. I'm lost here.

Voxelated
n00b
Posts: 16
Joined: Mon Aug 26, 2019 6:45 pm
Has thanked: 2 times
Been thanked: 1 time

Re: Extracting .tex textures from the legend of spyro a new beginning (ps2)

Post by Voxelated » Fri Aug 30, 2019 2:38 pm

Well that's too bad. And yea pretty much all image editors are practically useless when it comes to this. I guess it's back to roaming the internet for a solution. Thanks for everything thus far, it has been very useful.

Voxelated
n00b
Posts: 16
Joined: Mon Aug 26, 2019 6:45 pm
Has thanked: 2 times
Been thanked: 1 time

Re: Extracting .tex textures from the legend of spyro a new beginning (ps2)

Post by Voxelated » Tue Sep 03, 2019 11:59 am

Okay, I am back.
So I found this:
viewtopic.php?t=17583

What I can gather from the last post it seems like TjVatio managed to pull it off (convert edited data back into .tex). So I followed suit and downloaded all the programs mentioned, but I can't quite replicate the results. Here are the steps as I understood them:
1. Use Noesis to convert .tex to some editable format.
2. Use OPTPiX iMageStudio to convert the data into .tm2.
3. Use Console Texture Explorer to convert .tm2 to .tex.

The problem I am having is I can't get Console Texture Explorer to import anything into .tex, or to display anything sensible for that matter. I am aware that there is a connection between .tex and .tm2, am I doing something wrong there? I can't figure out the graphics offset nor the palette offset for example. OPTPiX .tm2 saving screen looks like this:
OPTPiX iMageStudio for PS2.png
You do not have the required permissions to view the files attached to this post.

episoder
veteran
Posts: 138
Joined: Fri Oct 16, 2015 8:05 pm
Has thanked: 3 times
Been thanked: 66 times

Re: Extracting .tex textures from the legend of spyro a new beginning (ps2)

Post by episoder » Wed Sep 04, 2019 11:57 am

well. that's not gonna work. if you wanted to export valid data for reimport you's need the 8-bit and 4-bit indexed image type with 32-bit clut. i don't even know what the difference of CSM1 or CSM2 is. that means you'd need to convert to indexed before you export the tim2 and then still gotta create a script to generate the tex file header from the tim2 file. even more complicated then natively exporting to tex directly. ugh.

Voxelated
n00b
Posts: 16
Joined: Mon Aug 26, 2019 6:45 pm
Has thanked: 2 times
Been thanked: 1 time

Re: Extracting .tex textures from the legend of spyro a new beginning (ps2)

Post by Voxelated » Fri Sep 06, 2019 11:30 am

I've been experimenting with the "to reimport the data gotta be extracted into palette tga images and they gotta be edited in indexed mode that allows the palette transparency" with GIMP a little. And so far so good it seems. My .png edits translate flawlessly to .tga and GIMP applies the alpha of some kind by default. After that just index the image and save. What I don't get is how the actual reimportation is supposed to be done. I presume that if the reimportation is successful the noesis script should be able preview it.

Voxelated
n00b
Posts: 16
Joined: Mon Aug 26, 2019 6:45 pm
Has thanked: 2 times
Been thanked: 1 time

Re: Extracting .tex textures from the legend of spyro a new beginning (ps2)

Post by Voxelated » Sat Sep 14, 2019 9:49 am

Is this thread done for?
How do you perform the actual reimportation after having the .tga images indexed?

episoder
veteran
Posts: 138
Joined: Fri Oct 16, 2015 8:05 pm
Has thanked: 3 times
Been thanked: 66 times

Re: Extracting .tex textures from the legend of spyro a new beginning (ps2)

Post by episoder » Sat Sep 14, 2019 6:08 pm

well. is it? i was bored enough to try and into it enough to get something done.

it exports native indexed tga. supports all sample formats. i dunnno about rgba linear mem. it 'only' supports 24 bit palettes with 16 or 256 indices. the 16 color index had to be extended. gimp didn't wanna open nor saves anything else but 8-bit index. it will 'crunch' on reimport tho, if you have a image setup with 16 colors.

you can edit the path in the batch to whereever your quickbms is. the folder structure should not be changed for wip edits. it is drag and drop setup. to reimport you drag the original on the reimport batch file. it needs the original header for testing and will assemble the file from the edited folder and move the result into reimported. i'm not sure if it could batch. wasn't a priority to get tested.

nvm me editing. forgot to do the rgb images. kinda odd it needs the bgr swap for the tga display but not for reimporting. just reconstructing. :?
You do not have the required permissions to view the files attached to this post.

Voxelated
n00b
Posts: 16
Joined: Mon Aug 26, 2019 6:45 pm
Has thanked: 2 times
Been thanked: 1 time

Re: Extracting .tex textures from the legend of spyro a new beginning (ps2)

Post by Voxelated » Sun Sep 15, 2019 11:55 am

Thanks for the edit. I couldn't get the v2 working no matter what I did, but v3 seems to be my friend.
Can this reimportation method somehow bypass or circumvent the measurements of the image. When attempting the reimportation guickbms states that the lengths don't match or something. Truth to be told the edit is quite a bit larger than the original .tex image. So can this deal with that or would the size difference make significant changes to the header thus making it incompatible?
It's fine even if I can't use larger images, I just thought it would be nice if it was feasible.

episoder
veteran
Posts: 138
Joined: Fri Oct 16, 2015 8:05 pm
Has thanked: 3 times
Been thanked: 66 times

Re: Extracting .tex textures from the legend of spyro a new beginning (ps2)

Post by episoder » Sun Sep 15, 2019 2:53 pm

i could do that, but that would potentially breach the technical limitations of the hardware and render engine design and texture cache. think about that 4 MB of video memory. if you load a 4 times larger texture, it will reduce space for other textures and framebuffers. depending on vram usage and cache reloading mechanic it could break the renderer or slow down the system significantly. i know some games use a core vram footprint and layout. messing that up is not a good idea.

also i dunno how you plan to inject this into the ps2 disc in the first place. i dunno the data format of this game. i will not look into. not sure if the file system would allow the different size without breaking things.

either way. the safe solution is just to use the same resolution and formats.

Voxelated
n00b
Posts: 16
Joined: Mon Aug 26, 2019 6:45 pm
Has thanked: 2 times
Been thanked: 1 time

Re: Extracting .tex textures from the legend of spyro a new beginning (ps2)

Post by Voxelated » Sun Sep 15, 2019 4:28 pm

The plan would be to use this with pcsx2 (playstation 2 emulator), not on the original hardware. Now normally I would resort to a simple injector (such as texmod), but the upcoming release of pcsx2 will ditch the dx9 support completely and with no reliable dx11 injector in sight (resorep seems to be the only one and didn't work with the emulator) I thought I might as well try to mod the texture archive directly. Now technically I could use the current release of pcsx2 with texmod and it should work, but I'd much rather not to have to chooce with better emulation and improved visuals if that's possible.

Could the code of the emulator, game engine or whatever else get in the way? Yea, there's a more than a good chance something doesn't work as intended. When it comes to sheer computing performance I should be covered as well as a consumer can at the moment. This is the first time I attempt something like this so I will try to push the limits. If it goes beyond playability with this method, so be it, I just have to be more moderate with my edits. At the moment my largest assets are 6x the original. In the end nothing ventured nothing gained. Guess I would have to wait that some clever bloke puts together a working dx11 injector or to emulator to support it natively.

As for the data format if you mean where did I get the textures in the first place, the game uses Krome's .rkv archiving for all of it's assets. This a bms script should handle both ways, if I have understood correctly. So simply put I open the archive, edit what I need and restore the archive with the edits. Will it work then? That's what I am trying to find out.

episoder
veteran
Posts: 138
Joined: Fri Oct 16, 2015 8:05 pm
Has thanked: 3 times
Been thanked: 66 times

Re: Extracting .tex textures from the legend of spyro a new beginning (ps2)

Post by episoder » Sun Sep 15, 2019 4:41 pm

you should forget about that injecting mod thing with this file hack. this will never work. neither is pcsx2 capable of extending the limit of the hardware. it's still just emulating 4MB of vram. it is pretty exact and timing sensitive program. moving bigger resources will potentially just slow it down or plain break it. you will not get bigger textures in there either way. so, your only chance is...

if the rkv script aloows reimport you could try that. the files gotta be the exact same size tho, for this to work. hence why, use the same resolution and formats

Post Reply