# Why to we need per vertex tangent?(normal mapping)

## Recommended Posts

noatom    927
I just started learning about normal mapping and I can't understand why do we need tangents for every vertex?

So in the plane of a triangle we have the texture space or tangent space.Where we can move the texture in all directions,rotate it etc.

But in my book says: if we use texture space for normal mapping,we will get a triangulated appearance since the tangent space is constant over the face of the triangle.(This is if we use tangent(or texture) space per TRIANGLE!).

So how does using a tangent per vertex fix this? And what does "triangulated" mean?
I can't understand why rotating and translating the texture using just texture space per TRIANGLE.

##### Share on other sites
zacaj    667
When you have it per vertex the tangent is interpolated over the triangle like the normal is. Triangulated probably means it looks flat shaded

##### Share on other sites
mhagain    13430
You can't send per-triangle attributes to the GPU. Well, you could probably hack something up with instancing and/or a GS, but it seems of dubious benefit and just adding the attribute per-vertex is the simplest solution.

##### Share on other sites
Matias Goldberg    9581
Because vertex shaders only look at the vertex they're processing, not at the other vertices they're connected with.
The Geometry shader is able to do that, but it breaks a lot of concurrency which is the strong point of GPUs, and hence that's why GS are so slow and rarely used (that, plus other factors in the GS break parallelism).

This is also why two triangles can share the same vertex, yet duplicate that vertex because they need totally different normals (unless you're using carefully layed out vertices using flat shading).
A cube only needs 8 vertices yet the traditional way of rendering it is using 24 vertices (again, unless you're using flat shading and carefully connected vertices; the order becomes important because the normal of the leading vertex, which is the first vertex being processed, is used).

##### Share on other sites
Dawoodoz    461
If you bake a model space normal map in Blender, you don't need tangent space but that method is less reusable because you need one normal map per model.