Sign in to follow this  
iEat_Babies

[XNA] [HLSL] Tangents and Binormals

Recommended Posts

I currently have vertices with position, texture coordinate and normal data. How do I determine the tangent and binormal data for each vertex?
Some easy to read C# code would be very helpful.
Thanks!

Share this post


Link to post
Share on other sites
This link has a good explanation of how to compute the TBN matrix. It has C++ code, but it can easily be converted to C#.

[url="http://www.terathon.com/code/tangent.html"]http://www.terathon.com/code/tangent.html[/url]

Share this post


Link to post
Share on other sites
Your vertices are real time created? or can be created with a DCC tool? Because the XNA content pipeline calculates [size="2"]automatically the [/size]models' tangents if the developer wants it.

If not, maybe (but I doubt it) the XNA team has the tangent method accessor set to public.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this