March 29, 2024, 09:19:47 AM

Username
Password

  Show Posts
Pages: [1]
1  Modifications / 3D Scenery Models / Re: Warhammer Age of Reckoning Modding on: June 08, 2016, 09:17:24 PM
Hey Olly,

I'm still working on my little tool, but unfortunately I'm stuck on this very same issue you're having here. To my current understanding it's not possible to extract most of the DIFFUSE textures properly, because...they are simply missing data (entire DXT blocks to be more specific). If you have 512x512 DXT1 texture with 10 mip maps, it requires exactly 174,944 bytes to store all the data (along with DIFFUSE file header). If size is less than that it looks like this:



Notice two things here:

1. The yellow row of pixels at the bottom are the missing blocks. This particular texture is missing 190 4x4 blocks in its largest mip map and some more in two lower ones as well.
2. Texture is distorted in the middle. This suggest the place these blocks are missing from (not necessary in contiguous blob of pixels though).

Having said that, I still have absolutely no idea how to get this data back. Is this some form of compression? Did they remove random pixels to protect textures from extracting? If so, where the hell are they...

2. unk_word_00 and unk_word_01 should be used somehow to handle shifts in rect. images

This I was able to figure out at least. unk_word_00 and unk_word_01 are offsets (on x and y axis respectively) in pixels from texture's top left corner. For some weird reason Mythic decided to chop up certain textures into multiple pieces and this is the effect of this operation. Here's one example:



Overall dimensions of this texture are 512x512, but the largest mip map has only 176x260 pixels and the offsets are (336, 252). By default all texture data will start at (0, 0), so basically you need to take every pixel and move it by this amount on x and y. I've tested this with converted model and this is exactly where UV coordinates are for this particular piece.
Pages: [1]