Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


#Actual0r0d

Posted 05 May 2013 - 12:00 AM

when blender makes the normals in tangent space it has to use 3 direction vectors, one is the normal of a face, the other is vector "b" and the other is the cross between this two vectors.

What is vector "b"?

"b" refers to the binormal.

 

In tangent space calculations you have the Normal, Tangent, and Binormal.  These 3 normalized vectors represent the basis vectors of the tangent space, which BTW is not necessarily an orthogonal space.  These vectors are in object space, and the 3x3 matrix generated from them represents the transformation from object space to "tangent" space.

 

The normal is the vector pointing directly away from the surface.  This is calculated from the vertex positions and has nothing to do with the UV coordinates.  The tangent vector points along the direction of change of the U coordinates.  The binormal points along the direction of change of the V coordinates.

 

if the UV coordinates are orthogonal, then you can calculate the binormal like this:

 

B = T x N

 

Sometimes in games, inside the shaders, the binormals are calculated this way.  But, again, this only works if the U and V coordinates are orthogonal, which they're not guaranteed to be.  It's very easy for artists to make the texture coordinates flow however they want.  The general solution is to pass in all three, N, T, and B in the vertex to the vertex shader.


#10r0d

Posted 04 May 2013 - 11:57 PM

when blender makes the normals in tangent space it has to use 3 direction vectors, one is the normal of a face, the other is vector "b" and the other is the cross between this two vectors.

What is vector "b"?

"b" refers to the binormal.

 

In tangent space calculations you have the Normal, Tangent, and Binormal.  These 3 normalized vectors represent the basis vectors of the tangent space, which BTW is not necessarily an orthogonal space.  These vectors are in object space, and the 3x3 matrix generated from them represents the transformation from object space to "tangent" space.

 

The normal is the vector pointing directly away from the surface.  This is calculated from the vertex positions and has nothing to do with the UV coordinates.  The tangent vector points along the direction of change of the U coordinates.  The binormal points along the direction of change of the V coordinates.

 

if the UV coordinates are orthogonal, then you can calculate the binormal like this:

 

B = T x N

 

Although depending on which direction U and V flow and which you consider the binormal, this equation can be different.  

 

Sometimes in games, inside the shaders, the binormals are calculated this way.  But, again, this only works if the U and V coordinates are orthogonal, which they're not guaranteed to be.  It's very easy for artists to make the texture coordinates flow however they want.  The general solution is to pass in all three, N, T, and B in the vertex to the vertex shader.


PARTNERS