[gameprogrammer] Calculating the Tangent Space in FarCry!!!

  • From: Esam Bustaty <e.bustaty@xxxxxxxxxx>
  • To: "GameProgrammer freelists.org" <gameprogrammer@xxxxxxxxxxxxx>
  • Date: Sun, 2 Dec 2007 11:54:05 +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 

http://www.geocities.com/e.bustaty.t21@xxxxxxxxxxxxxx/wireframe.png

I tested the specular in my code but it wasn't good
enough
http://www.geocities.com/e.bustaty.t21@xxxxxxxxxxxxxx/shot0.jpg
http://www.geocities.com/e.bustaty.t21@xxxxxxxxxxxxxx/shot1.jpg

So i exported the object into the FarCry geometry
format (CGF), and viewed the results which was amazing
http://www.geocities.com/e.bustaty.t21@xxxxxxxxxxxxxx/farcryresult.png
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 - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ 

---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html


Other related posts: