# Quesion on TBN Matrix generation

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

## 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.

E1=ΔU1T+ΔV1B

E2=ΔU2T+ΔV2B

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..

Edited by cebugdev

##### Share on other sites

E1=ΔU1T+ΔV1B

E2=ΔU2T+ΔV2B

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_

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 13
• 9
• 15
• 14
• 46
• ### Forum Statistics

• Total Topics
634067
• Total Posts
3015323
×