PDA

View Full Version : Directional diffuse bump mapping

SeskaPeel
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 ?

SeskaPeel.

knackered
08-26-2003, 04:07 AM

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

jwatte
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 :-)

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

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

SeskaPeel
08-27-2003, 10:26 AM