How to edit GTA:IV PS3 textures - Tutorial
Channel: SuleMareVientu
Date: 2022-01-20

Original Reddit post: https://www.reddit.com/r/ps3homebrew/comments/pichgn/tutorial_porting_or_making_gta_iv_mods_from_pc_to/

Remember to NEVER change the resolution of a texture, it has to remain ALWAYS the same.

Texture Formats Info:
GPUTEXTUREFORMAT_DX1 = BC1 (Linear, DXT1)
GPUTEXTUREFORMAT_DX2_3 = BC2 (Linear, DXT3)
GPUTEXTUREFORMAT_DXT4_5 = BC3 (Linear, DXT5)
GPUTEXTUREFORMAT_8_8_8_8 = B8G8R8A8 (Linear, A8R8G8B8)
Read more here: https://www.fsdeveloper.com/wiki/index.php/DXT_compression_explained

NOTE: for A8R8G8B8 textures to work you'll need to swizzle them before importing them in a .ctd, to do so follow the tutorial in the description. Read more about texture swizzling here: https://community.khronos.org/t/what-is-texture-swizzling/66666

Updated Tools (use OpenIV instead of SparkIV): https://www.mediafire.com/file/5f5t8nbdwb2pbzn/GTAIV_PS3_Modding_Tools.zip/
Paint.NET: https://www.dotpdn.com/downloads/pdn.html

PS3 texture Swizzling:
Use the included Swizzling Tool [by RangerRus] to swizzle A8R8G8B8 textures on PS3 before importing them with RAGE Console Texture Editor v1.5:
1) Put the textures in the same folder as the tool's
2) Run Swizzling_Tool_swiz_all_dds_ps3.bat
3) Open the swizzled texture in Paint.NET and save it again (A8R8G8B8)
4) Import the texture in the Texture Editor (v1.5 required), you'll get an error, ignore it and save the file regardless
5) Test the new texture
To unswizzle a texture that's already been swizzled use Swizzling_Tool_unswiz_all_dds_ps3.bat

Written Tutorial:
1) Extract the *.xtd/*.ctd texture dictionaries from the game with OpenIV/SparkIV
2) Run RAGE Console Texture Editor and open the texture dictionary you want to edit
3) Export the texture you want to edit and look at the "Texture format" field at the bottom of the editor
4) Open it in Paint.NET and modify it to your liking
5) Save the texture as DirectDraw Surface (DDS) and choose the correct compression method in relation to the texture format shown inside the Texture Editor:
GPUTEXTUREFORMAT_DX1=BC1 (Linear, DXT1)
GPUTEXTUREFORMAT_DX2_3=BC2 (Linear, DXT3)
GPUTEXTUREFORMAT_DXT4_5=BC3 (Linear, DXT5)
GPUTEXTUREFORMAT_8_8_8_8=B8G8R8A8 (Linear, A8R8G8B8) NOTE: PS3 users need'll to swizzle A8R8G8B8 textures, see "PS3_ONLY" tools
DISABLE "Cube Map from crossed image" & "Generate Mip Maps"
6) Now import the texture in the Texture Editor and do the same proccess for every MipMap level present (resize the image opened in Paint.NET with CTRL+R)
7) Save the texture dictionary
8) Import the new file in the RPF/IMG archive and rebuild it with the according tool
You can use the included crunch_x64 build to mass-convert dds textures

Music (in order):
Happy Life – FREDJI
Hip Hop Rap Instrumental (Crying Over You) – christophermorrow
And So It Begins – Artificial Music

Thanks for watching