Dynamic Texture Space

Hi, I’ve been working on putting bump mapping onto some skeletally animated models, and I’m finding that generating the orthonormal basis for every triangle in the model is pretty time consuming, even when I use fast sqrts and store the math results which aren’t going to change because the tex coords are constant. It’s even worse when smoothing the ONBs across neighbouring triangles. I was wondering if there is some other way to generate the tangent space vectors from the dynamic model data? Could I generate the tangent space vectors once for each triangle, and then somehow rotate them correctly on the fly according to the triangles current position?

Thanks

Try storing the normal maps in object/pose space (the pose your skeleton’s vertices is defined in) and doing the dot product in object space. Just transform the light vector to pose space per vertex. This is kind of the same thing as doing the skeleteal transform of vertices and normals but in the other direction (to pose space instead of from). There was a demo of this in the news section of opengl.org a couple of months ago, try searching for object space bump mapping.

So to implement that I’d have to transform each vertex’s L vector by the inverse of the bone rotations it was subject to, correct?

Is Doom3/HL2 using object space or tangent space maps? Does it convert to/from one or the other at runtime?

Couldn’t one approach be to compute the per vertex ONB, and then simply rotate it with the vertex, would that work at all?

I couldn’t find any record of that news item, if someone has it bookmarked that would be cool.

Thanks

The original tutorial is here but it seems to be down. You can view google’s cache of it here though. What do you mean by the ONB? You can of course transform the normals instead of the light vectors, but that requires a per pixel transform which is expensive and only works on DX8 level hardware and requires vendor specific extensions (NV_texture_shader and ATI_fragment_shader). If you can rely on ARB_fragment_program support things get simpler of course. I have no idea what doom and/or HL does. HL doesn’t seem to be using much in the way of bumpmapping/per pixel lighting at all actually.

HL doesn’t seem to be using much in the way of bumpmapping/per pixel lighting at all actually.

He said HL 2 not the original HL. HL2 does have bumpmapping and perpixel stuff. The exact methods they use I don’t know yet. Doom 3 uses tangent space bumpmapping.

-SirKnight

HL2 does have bumpmapping, but they hide it really well, and I’ve seen no evidence of it being used for anything except world geometry. Their characters look vertex-lit with no bumpmapping.

Originally posted by rviney:
[b]So to implement that I’d have to transform each vertex’s L vector by the inverse of the bone rotations it was subject to, correct?

Is Doom3/HL2 using object space or tangent space maps? Does it convert to/from one or the other at runtime?

Couldn’t one approach be to compute the per vertex ONB, and then simply rotate it with the vertex, would that work at all?

I couldn’t find any record of that news item, if someone has it bookmarked that would be cool.

Thanks[/b]

Personally, I just use the 3x3 Rotation portion of the skinning matrix to rotate the Normal, Binormal and Tangent in the vertex shader. This works nicely.

-Chris