Jump to content
  • Advertisement
Sign in to follow this  
mlt

Tangent vectors for a normal in a normal map?

This topic is 3670 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 have a heightmap, H, and its corresponding normal map, N. When I do: N(u,v) I get the normal vector, n, in the "point" (u,v). But how do I find the two tangent vectors which defines the plane that n is perpendicular to?

Share this post


Link to post
Share on other sites
Advertisement
Tangent vectors need to be calculated ahead of time for each vertex. You can find some information about how to do this here:

http://www.terathon.com/code/tangent.html

Share this post


Link to post
Share on other sites
Yes I have read that website but would like to determine the tangent vectors in the vertex program.

But since I only know the position of one vertex in the vertex program is that the reason that it has to be done in the application?

As I understand I need to know the position for all three vertices to dertermine the tangent vectors.

Share this post


Link to post
Share on other sites
There's a good article in ShaderX5 about this: "Normal Mapping without Pre-Computed Tangents".

Share this post


Link to post
Share on other sites
It is worth mentioning that you can normal-map without any tangents at all, provided that you can live with the restrictions of object-space normal-mapping (i.e. no animation).

Share this post


Link to post
Share on other sites
I would like to use it for displacement mapping and to calculate the new normals I need the tangent and binormal vectors. But the section in ShaderX5 looks interesting, I also read that in shaderX4 there should be a good article about tangent space.

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.

GameDev.net 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!