Author Topic: Weird Texturing  (Read 2586 times)

Alhexx

  • *
  • Posts: 1894
    • View Profile
    • http://www.alhexx.com
Weird Texturing
« on: 2006-07-02 22:42:50 »
Okay, although this topic is not FF related, I know that there are a hand full of good programmers and game hackers around here.
And once again, I need your help.  :roll:

So, I have been spending dozens of hours sitting in front of my hex editor, hacking the model files of Tomb Raider Legendâ„¢.
I have been able to decode the geometry, i.e. vertices, triangles, normals and groups (if they can be called so)

Here's a screenshot of the quite strange grouping:



Now, I'm still having heavy problems with the texture coordinates...


Usually, as far as I know, the U and V coordinates are between 0.0 and 1.0, where (0.0 , 0.0) is the upper (or lower?) left corner and (1.0 , 1.0) is the lower (or upper?) right corner.

But the TRL model format is different...
The UV coords are in a quite bigger range, for the following model, they lie between (-2.0 , -1.0) and (3.0 , 3.0).

If you add ± 1.0 that often, so that the resulting tex coord lies between 0.0 and 1.0 (in other words: if you take the tex coord modulo 1.0), and then apply two different textures onto the mesh, you get the following results:

 

As you can see, both textures seem to be useful, however, only on some parts of the mesh...


However, the UV seem to have a bit of structure:
There appear to be "groups" of vertices, which lie in one "block" (e.g. 30 vertices whose uv coords lie between (-1.0 , 1.0) and (0.0 , 2.0))

I first thought, that the "final" texture might be some sort of matrix of the original textures. But this does not work either...

I have translated and scaled the orignial UV coords so that they lie between 0.0 and 1.0, and then I tried to create a matrix of textures, however, there still is a problem.
This does work for most parts of the model, however, there are still some textures overlapping.


For example, in the first screenshot in this post, you see that lara's fingers in her left hand are light-blue. So are her eyes and a part of her hair, which you unfortunately cannot see on that screenshot.
The problem is that even if I organize the textures in that matrix style, the texture coords of her fingers and her hair do overlap, or in other words, they are in the same UV-coord-block.

So I have the choice between having Lara with "Skin-Hair" and Lara with "Hairy-Hands"  :-P


I have been browsing through dozens of 3d sites and tutorials, manuals etc, however, I couldn't find any explanation for that.

So, does anyone in here have an idea?
If you need more info, screenshots or whatever, please let me know.


Thanks!

 - Alhexx

 - Edit -
BTW: Please do not tell me that the normals are weird, too. I do read out the normals correctly, just Milkshape3D does not seem to like them...
« Last Edit: 2006-07-02 22:46:46 by Alhexx »

mirex

  • *
  • Posts: 1645
    • View Profile
    • http://mirex.mypage.sk
Re: Weird Texturing
« Reply #1 on: 2006-07-03 10:50:27 »
If they overleap as you say then there is something fishy going on.
Are there multiple textures for this model ? Then it could mean that coords 0.0 - 1.0 are mapped on first texture, 1.0 - 2.0 are mapped on 2nd texture,  and so on ...
Or try another way around ... find where are fingers on the texture and compare the position with the texcoords present on the fingers of the model, maybe you'll find some connection.