# that damn tangent space

A lot of people seem to be generating the T and B vectors using the vertex and 2D tex coords. Some algorihtms involve the normals.

But is it not possible to generate T and B simply using the vertices and normals (on arbitrary polygonal objects)

There is the risk of having bad T & B vectors when using tex coords.

Is anyone aware code that does this already?

This is not possible. You need the 3D texture derivitives from the s & t mappings. The normal map vector orientations are defined by the tangent space coordinate frame and must be consistent with how the texture is applied to the object.

I do my normal mapping by handing amodel to nvmeshmender and then using the computed tangent/binormals from it.

I’m trying to use normal mapping for some rocks. I can either make rocks by starting with a cube and smooth it, or starting with a sphere. The sphere isn’t a good choice since the poles are kind of screwy. By starting with a cube also get more effective texture resolution by using the same texture per face which is repeatable against any other edge. It looks a lot nicer than stretching the same texture around a sphere.

My normal mapping works fine for my rocks if they start out as spheres. Using a flat normal map I get nice per pixel lighting. But when I make a rock by smoothing a cube I see hard edges where the textures meet! This is strange as the normals are shared at each vertex…

Is there any reason I should see any seeming? The fact I see seeming (even though going across the texture works fine) means I’m doing something wrong, right?

Seaming of some kind will occur if any of your vectors defining the tangent space orientation or texture coordinates from adjacent triangles do not completely match at the shared vertices.

[This message has been edited by dorbie (edited 04-02-2003).]

Originally posted by dorbie:
This is not possible. You need the 3D texture derivitives from the s & t mappings. The normal map vector orientations are defined by the tangent space coordinate frame and must be consistent with how the texture is applied to the object.

yes that’s right. Orientation of the texture is needed so it can’t be done without it.

For spheres and cubes too, the same thing applies unless if you have a predefined way of texturing them and you can generate T and B without tex coords.

Titan, I’d be very interested in seeing your rocks, could you show us some screenshots?
is it fast? what kind of hardware do you use?
are you using arb_fp?