PDA

View Full Version : bump mapping and triangle strips



JanHH
01-23-2004, 03:10 PM
Hello,

is it possible to use bump mapping with geometry that is rendered as triange strips? As far as I know I have to supply the light vector in the form of texture coordinates at each vertex, transformed to the triange's tangent space (OR let a vertex program do that, but then I have to supply the matrix used for the tangent space conversion). But in a triangle strip, this will only work if the tangent spaces of all triangles that share a vertex in a strip all have the same tangent spaces for this vertex, which roughly means (as the normal is the same for all triangles) that they all have to line on one plane!?

Am I getting this right?

thx
Jan

dorbie
01-23-2004, 03:23 PM
You can do this. The tangent space coordinate frames can be oriented differently at each vertex. Generally these are averaged at the vertices just as you'd average surface normals, although some attempt may be made to keep them orthogonal.

The vertex program transforms the vectors at each vertex to tangent space (or whatever space the coord frames are in, typically tangent in your scenario) and these are interpolated across the triangle. This is equivalent to interpolating the coordinate frame i.e. curving the surface. It is analogous to Phong shading where the normal is interpolated, except in this case the transformed vectors are interpolated in tangent space.

jwatte
01-23-2004, 05:56 PM
This is no different from having discontinuities in regular texture mapping. So, if your stripping handles that (with degenerates, say), it will handle the tangent spaces being different, too.