Thread: Bump maps
View Single Post
Old 05-29-2012, 01:03 PM   #1
Darth InSidious
A handful of dust.
Darth InSidious's Avatar
Join Date: Feb 2005
Location: The Eleven-Day Empire
Posts: 5,778
Current Game: KotOR II
Bump maps

Warning: Thread contains semi-technical gobbledegook. Prior reading is suggested as follows:

All right, as everyone knows, bump-mapping in the KotOR games only works under certain circumstances, which means the devs could make it work and we can't at present.

In order to try and address this in part, I've been oing a bit of examination of the difference between the .tpc and .tga of a sample bump texture (DAN_Flr3B) in a HEX editor.

So far, I have three observations:
1. The files are different lengths, the .tpc ending at line 555FA, the .tga at line 5560B.

2. Different file beginnings (headers?). The .tpc file begins:

00 00 00 00 00 00 80 3F 00 01 00 01 04 09 00 00 00

Whereas the tga file begins:

00 00 02 00 00 00 00 00 00 00 00 00 00 01 00 01 20

Further, the .tpc file, following the first line, has 6 lines (lines 11 - 66) blank, and begins at column 10 on line 77; the .tga file begins at column 2 on line 11.

3. File endings. Both files end with the following .txi information:
isbumpmap 1 bumpmapscaling 2 xbox_downsample 128

However, the .tga file repeats this information twice, and has at appearing once well before the end of the file.

The file to which Flr3B is a bumpmap - DAN_Flr3.tpc has the same or a similar break at the start of the file, and ends:


.TGA files I have edited with GIMP, however, end with:


A similar pattern in the .tpc files' beginnings and endings was found in the KotOR 1 copies of V_EHawk01 and V_EHawk01b , although the extrated .tga of V_EHawk01 does not have the ending plain-text.

A comparison of DAN_Flr3B and V_EHawk01b reveals similarities, too. The main body of both files begins similarly. V_EHawk01b begins:

7D 83 FE FF 80 86 FE FF
91 6E FC FF 86 81 FE FF 86 83 FE FF 8A 89 FE FF 94

DAN_Flr3B begins:

80 7B FE FF 77 83 FE FF
7B 84 FE FF 84 80 FE FF 86 80 FE FF 84 80 FE FF 84 80 FE FF 84

Both files also end similarly, repeating 80 80 FF 3F before the "isbumpmap", etc. part.

Whether this actually advances us at all, I don't know, but I thought I'd share it.

Mods Released
Quid existis in desertum videre?
Darth InSidious is offline   you may: quote & reply,