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

## 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 on other sites
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 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 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 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.

1. 1
2. 2
Rutin
19
3. 3
khawk
18
4. 4
A4L
14
5. 5

• 12
• 16
• 26
• 10
• 44
• ### Forum Statistics

• Total Topics
633767
• Total Posts
3013735
×