PDA

View Full Version : Skins (textures)



Modding Forum
10-23-2006, 01:55
Converting from .texture to .dds


Playing around with the files that came with mt_unit_xmls.rar (sorry can't find the download link again), converting the uncompressed .TEXTURE files to .DDS files is fairly simple. You just strip the first 48 bytes from the .TEXTURE file and save the result as .DDS file. So extracting the .TEXTURE information to a DDS is fairly simple. However finding out the information to put back into a TEXTURE file may be more difficult, but probably do-able.

For anybody else that wants to have a guess at the .TEXTURE header information, the values for the EN_Peasant_Padded_england.TEXTURE are :-

(by 32 words)
1
48
0
7562340
1237572
51208848
1235648
576
0
2084197989
3
1024(depth/width of texture)

My guess (and it's just that) would be that it would be pretty safe to use a silmilar header for a similar texture -ie cloth for cloth, mail for mail, etc. But when the unpacker comes out we'll know more :2thumbsup: .



I've been looking at the texture files in a hexeditor and comparing them, noticed some things. Between files of the same size and dxt type theres no change in the header, between files of the same size and different dxt types one byte changes, the 29th. This is 10 for DXT5 and 40 for DXT1. This applies to textures for units. Between textures for units ant those for other types of models, such as those in the attachment sets and new vegetations folder the 17th and 18th and 25th and 26th bytes change values.

My guess is that as the header is only changing between different types of models and dxt formats, it should be safe to strip out the header, edit the dds and reinsert the header and try it ingame. I've made an attempt to do this but I only have the demo and it doesnt seem to use unpacked files so it came to nowt. If anyone else wants to try it the file is here: http://rapidshare.com/files/7762805/test.rar.html
Unzip into the data folder, it should replace french chivalric or dismounted knights.

I've only noticed one other byte changing between files, the 46th seems to change value depending on the size of the file, although I've noticed two files of different dimensions but same area having the same value. Likewise I've noticed two files of the same dxt type having different values for the 29th byte, 10 and 20. I havent noticed two different dxt formats using the same value though. The other two byte sequences dont seem to have any effect ingame if you change them to those used by another type of model. Other than that I havent noticed any other changes between the headers in different files than those 6 bytes.

https://img98.imageshack.us/img98/2666/gendarmecr7.jpg (https://imageshack.us)
https://img88.imageshack.us/img88/7811/kilroybz4.jpg (https://imageshack.us)
https://img80.imageshack.us/img80/1273/bannerstq9.jpg (https://imageshack.us)

Epistolary Richard
12-16-2006, 01:43
Added .texture/.dds info from GrumpyOldMan

Epistolary Richard
12-17-2006, 13:31
Added adding new textures info from Casuir.