Xaymar / Hellextractor

A simple tool to extract things from Helldivers 2 for your 3D printing needs.
BSD 3-Clause "New" or "Revised" License
32 stars 5 forks source link

Add converter for .texture files #15

Closed Xaymar closed 7 months ago

Xaymar commented 7 months ago

With 2023178c292a7018b0a9e16cc7dc8741c029cf29 most of the format of the .texture files was figured out. We know how to read the file and even what it does, and should be able to export it completely without errors.

The header (0xC0 bytes) simply tells us how we could stream mip levels in the texture file, so that we use less memory overall. This is why the header for the texture itself is in the main file, but the data is in the stream file. As for the data in the gpu_resources file, that is simply an exact clone of the data in stream, usually starting at mip level 2 (1/4th resolution).

As far as it seems, all textures are .DDS files. There are references to .TGA files, however I have yet to find an actual tga file. Might be useful to inspect the first 4 bytes and decide based on that.