View Full Version : Directional diffuse bump mapping

08-26-2003, 03:48 AM
In order to perform tangent space directional diffuse bump mapping, I have to compute, for each texel, the direction from this texel to the light, in tangent space, and then dot it with the corresponding texel from the bump map.

The direction, in object space, from each texel to the light is the same. However, in tangent space it has to be interpolated (using a cube map, or simple gouraud interpolation) with the 3 vertex of the texel's face.

I'm having trouble with this, because I have a rather coarse geometry, and it leads to artifacts when using the Gouraud interpolation. A solution is to use a cube map to normalize ... but I have no more texture units available. (Decal, detail, diffuse cube map, bump map)

Would it be possible to avoid such artifacts by computing my normal map in object space, rather than in tangent space ?


08-26-2003, 04:07 AM
glShadeModel(GL_FLAT) ??

08-26-2003, 06:35 AM
Yeah, i think object space would elegantly solve your problem, if you cannot afford two pass.

08-26-2003, 09:12 AM
Instead of putting the light into tangent space, you can transform the tangent space normal into object space. That makes reflection and specular much easier, too :-)

08-26-2003, 11:32 PM
How could I get my normal (from the normal bump map, that is in tangent space) back to obejct space ? I need the inverse tangent matrix, and the tangent matrix is specified by vertex, and not by texel ...

08-26-2003, 11:58 PM
Interpolate the tangent matrix.
NVidia have a paper on this using texture shaders.

08-27-2003, 10:26 AM
Sorry I posted a new thread before reading this one ...

I didn't find this paper ...
Could you precise wich one ? Or directly explain the solution to this problem ?
(passing tangent space normal from the normal map into object space in a fragment program)