Advertisement Jump to content
Sign in to follow this  

Trying to understand tangent/ worldspace

This topic is 1816 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

I'm trying to fully understand my normal mapping implementation (HLSL), but there's one thing I just cant figure out.

- I have light vectors in worldspace
- before I used normal mapping, I believe my lighting calculations were done in world space
- in my normal mapping vertex shader I make a matrix for transforming coordinate space, using normal, binormal and tangent vectors
- in the pixel shader I retrieve the normal map normal and multiply it by the matrix above

I believe this means my normalmap normal is transformed from tangent space to world space, so all my lighting calculations are in 1 coordinate space: worldspace.

So far so good.
But... Why is the matrix I described almost always called worldtotangentspace, when it's used to transform tangent space normal map normals into world space? (so shouldn't it be tangenttoworldspace)

Is my theory/ are my assumptions right or am I overseeing something?

Ps: the matrix is formed by multiplying normal, binormal and tangent with the objects world matrix

Share this post

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

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!