Skip to content

Latest commit

 

History

History
25 lines (23 loc) · 3.34 KB

Modifying Textures.md

File metadata and controls

25 lines (23 loc) · 3.34 KB

Modifying Textures

This method is for the RPK files in the PS3 games only (video tutorial).

  • First get the texture you want to edit. There are two ways of doing this:
    • This method is only possible on RPCS3. Rip the texture with RenderDoc (video tutorial).
    • Use the RPK unpacker to unpack the RPK. Go through the list of resulting files from largest to smallest, converting each one with the raw texture converter with offset 0x1B until you find the texture you want to edit. For Pacific Rift, the Known texture metadata table will help greatly.
      • If you need to convert a lot of files quickly, put the following code in a batch file (*.bat) and run it in the same folder as the unpacked files from the RPK and RawtexCmd.exe. It's set up for vehicle liveries, but you can adjust the values as needed for other types of textures.
      @echo off
      for %%a in (*.dat) do (
      .\RawtexCmd.exe %%a DXT1 1B 2048 1024
      )
      
  • Edit your texture and save it as DDS, with the same metadata as your source texture. Make sure you don't overwrite your source texture. You can use Compressonator to help with this as well as the Known texture metadata table for Pacific Rift.
  • Now, you need to replace the texture in the RPK. There are two ways of doing this:
    • Use SIs_TexSwap and select the source texture, new texture and RPK when prompted.
    • This method is more complicated and involves the use of a hex editor. Only use this if the first method fails:
      • Open the source texture in your hex editor and copy 30-ish bytes starting from 0x80.
      • Open the RPK in the hex editor and search for the bytes you just copied. You should now have the location of the raw DDS data in the RPK.
      • Open your edited texture in the hex editor, and select everything from 0x80 to the end.
      • Copy it, and paste it in the same place as the original texture data in the RPK, replacing it.
      • If the filesize is different, go to the 4 bytes immediately before the texture data. They form an unsigned integer, adjust that number to the size of the raw texture in bytes.
      • If the resolution is different, go to the EVOSBIG / 45 56 4F 53 42 49 47 20 before the texture, and skip 20 bytes. The next 2 bytes form an unsigned short which is the resolution in the x-axis. The 2 bytes after that form another unsigned short which is the resolution in the y-axis.
      • Save the RPK, and you're done.