[gameprogrammer] Calculating the Tangent Space in FarCry!!!
- From: Esam Bustaty <e.bustaty@xxxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Sat, 1 Dec 2007 15:18:57 +0000 (GMT)
I was calculating the tangent space with a simple algorithm that described in
"3D Game Engine Programming" book by Stefan Zerbst, and it was useful until i
found a large difference between the results on my code and the results on far
cry, The shape was planar but has a complex triangulation (view).
I tested the specular in my code but it wasn't good enough (view) (view2).
So i exported the object into the FarCry geometry format (CGF), and viewed the
results which was amazing (view), after that i ran the FarCry within "PIX for
Windows" (a program that enable me to spy on the vertex and index buffers...),
pix gave me a surprising results about the tangent space information... I was
expecting something like:
-1.000 0.000 0.000------------- 0.000 0.000 -1.000------------- 0.000
1.000 0.000
for all vertices, because the object is planar and the uv map is also planar,
but the result was:
-1.000 0.000 0.000------------- 0.000 0.053 -0.999------------- 0.000
0.999 0.053
-1.000 -0.000 -0.000------------- 0.000 -0.320 -0.947------------- 0.000
0.947 -0.320
-1.000 0.000 -0.000------------- 0.000 -0.428 -0.904------------- 0.000
0.904 -0.428
-1.000 0.000 -0.000------------- 0.000 -0.428 -0.904------------- 0.000
0.904 -0.428
-1.000 -0.000 -0.000------------- 0.000 -0.320 -0.947------------- 0.000
0.947 -0.320
-1.000 0.000 -0.000------------- 0.000 -0.428 -0.904------------- 0.000
0.904 -0.428
-1.000 -0.000 0.000------------- -0.000 -0.670 0.742------------- -0.000
-0.742 -0.670
-1.000 -0.000 0.000------------- 0.000 -0.603 0.798------------- -0.000
-0.798 -0.603
Of course the difference in the first line is not notable but on the the other
lines the result was so far from other programs give (i tested it on a big mass
of programs).
I tried to use the tangent space algorithm which is distributed within the
CryMod SDK, and the result was almost the same of my first results...
So do you know anything about the algorithm that used in the real FarCry???!!!!
---------------------------------
Yahoo! Answers - Get better answers from someone who knows. Tryit now.
Other related posts: