Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!

We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.

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

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 noatom   Members   -  Reputation: 785


Posted 02 July 2012 - 04:00 PM

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.


#2 zacaj   Members   -  Reputation: 643


Posted 02 July 2012 - 04:06 PM

When you have it per vertex the tangent is interpolated over the triangle like the normal is. Triangulated probably means it looks flat shaded

#3 mhagain   Crossbones+   -  Reputation: 8135


Posted 02 July 2012 - 06:15 PM

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.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.

#4 Matias Goldberg   Crossbones+   -  Reputation: 3562


Posted 02 July 2012 - 09:22 PM

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

Funny though, because you realized about this problem with Tangents, but not with Normals Posted Image

#5 Dawoodoz   Members   -  Reputation: 331


Posted 03 July 2012 - 06:56 AM

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.

My open source DirectX 10/11 graphics engine. https://sites.google.com/site/dawoodoz

"My design pattern is the simplest to understand. Everyone else is just too stupid to understand it."

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.