Jump to content
  • Advertisement
Sign in to follow this  

Quesion on TBN Matrix generation

This topic is 474 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi math experts, 

i have a question and i need deep understanding of normal map TBN matrix generation formula.

I see from lots of tutorials such as in learnopengl.com or in ogldev



that the formula goes something like this.




U1, U2, V1, V2 are texture coordinates

T and B are Tangent and Bitangent vectors


But i just dont understand how the above formula was created and why is the formula like that?

I understand we need to get two vectors that is why the difference of U and V vectors are computed to form a vector, 

but i dont understand why it needs to be dot products to T and added to difference of V vectors and dot product to B.

in summary, i dont fully understand the formula itself.. 

I need elementary explanation please :(

Edited by cebugdev

Share this post

Link to post
Share on other sites



These formulas are a different way to represent the edges E1 and E2 using the tangent and bitangent as the article says.


In order to calculate the tangents and bitangents per vertex you need to apply the last formula in the article.

There are several methods to calculate the tangents and bitangents for a mesh, the most popular one I know of is "MikkTSpace".




The TBN matrix that you construct in the shader is made up of the tangent, binormal and normal vectors. As these are all orthogonal unit vectors they create an orthonormal basis.

Edited by Syntac_

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!