Midnight Club 3 - DUB Edition Remix (PS2) Texture Extraction Follow-up

Textures, recreate headers, conversions, algorithms and parsing of image files
bigsteve327
Posts: 8
Joined: Thu Sep 09, 2021 7:49 am

Midnight Club 3 - DUB Edition Remix (PS2) Texture Extraction Follow-up

Post by bigsteve327 »

Hi Everyone!

I am working to create a texture pack including upscaled textures for Midnight Club 3 - DUB Edition Remix for the PS2. It would be great to not only scale the resolution of the game to 4K, but to also have the textures for the game properly scale as well (as at the moment, PCSX2 doesn't do this)! At a high-level, there are 3 things I need to do:

1. Extract textures from the game
2. Upscale the textures using Cupscale
3. Configure PCSX2 to use the upscaled textures

So far, steps 2 and 3 are fully flushed out, but I need help with step 1. From my research online, there are essentially two ways to extract textures.

Option 1 is to dump them using PCSX2's dump texture feature. To do this however, I have to load every single texture into memory which is not only a time-consuming process (7 car classes containing 10+ cars, each car can be customized with 100s of things, 4 cities, 100s of billboards, about 20-30 traffic cars, and pedestrians), but a space-consuming one as well: there are already 20k dumped pngs for loading one city alone!

When these are upscaled, the result is 100+ GIGABYTES of files, which does not seem right to me. Not to mention, that as I dumped more files, I noticed that there seemed to be a lot of duplicate data (but not duplicate files). Which leads me to this post.

Option 2 is to extract them directly from the game iso, which is the option I have been exploring and would like some more guidance on.

So based on my older thread here, the dave.bms script will extract files from assets.dat and texture.dat here is a list of files from a traffic truck folder as an example:
sample texture names.png
Upon further digging, I found this thread here where user Kaparti linked a very useful program named 3D Object Converter to help view mesh files. Well turns out it can also view these .tex files too! However...no export format in this program is compatible with Cupscale (dds, png, tga, etc.). It also seems like the export logic is based on building a component for the program which I have no idea how to do. Based on my googling so far, a tex to png converter won't work based on the few I've tried.

But wait, there's more! I found a Youtube Video where someone created a program to convert the tex files to tga! In addition, Cupscale can upscale these files (as confirmed with the few folders I have tried)! In the image below, left is the TGA file extracted from the .TEX, and the right is the upscaled version of it as a .DDS
before & after upscale.png
However, PCSX2 uses different logic for reading textures for a specific game and as a result, I cannot read the upscaled DDS files using PCSX2. I don't think renaming is enough nor is it feasible considering that there are variants of all texture files dumped from PCSX2. Given this limitation, I think that in order to use these upscaled textures, I have to convert the DDS files back to .TEX and then re-create the asset.dat file using another QuickBMS script.

So given all of this information, I have a few questions:

1. How can I convert an upscaled DDS file (or TGA file if it's easier, since I can upscale and maintain a TGA format in Cupscale) into a .TEX file that can be recognized by the game?
2. How can I package the asset files extracted from the dave.bms script back into a .DAT file?

If either of these is not possible, please let me know. Any help would be greatly appreciated.

Thank you!
BloodRaynare
Posts: 367
Joined: Fri Mar 10, 2017 7:23 am

Re: Midnight Club 3 - DUB Edition Remix (PS2) Texture Extraction Follow-up

Post by BloodRaynare »

bigsteve327 wrote: 1. How can I convert an upscaled DDS file (or TGA file if it's easier, since I can upscale and maintain a TGA format in Cupscale) into a .TEX file that can be recognized by the game?
A BMS script or a program tool need to be written to take the DDS/TGA pixel data and then turn it into a TEX file that the game can read. However, there are some caveats:

1. You can't just use DDS/TGA pixel data as-is. From my experience with PS2 textures, most of the times the textures were palettized with 256 colors (or sometimes 16) to conserve PS2's VRAM usage (Remember that it only had 4MB and PCSX2 won't help you exceed that limit outside of the custom texture features). So, you had to reduce the colors first.

2. Also, due to the VRAM limit, textures that is bigger than the original is not possible (At best the game would either crash or simply not displaying your custom textures). That means, the replacement textures must be the same size as the original which, of course, defeats the whole purpose of texture upscaling.
bigsteve327 wrote: 2. How can I package the asset files extracted from the dave.bms script back into a .DAT file?
Well, usually you can run quickbms like this:

Code: Select all

quickbms -w -r -r dave.bms (DAT file) (Target directory where did you extracted the DAT file)
Or use reimport2.bat/reimport3.bat. However, since the script are using "MEMORY_FILE", as per quickbms's readme:
The reimport2 method doesn't work if:
- the TOC is compressed or located on a MEMORY_FILE