PDA

View Full Version : Dynamic Texture Space



rviney
05-20-2003, 11:28 PM
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

harsman
05-21-2003, 02:34 AM
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.

rviney
05-21-2003, 03:44 AM
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

harsman
05-21-2003, 04:00 AM
The original tutorial is here (http://www.3dkingdoms.com/web/tutorial.htm) but it seems to be down. You can view google's cache of it here (http://216.239.39.100/search?q=cache:VXNKGEp86foJ:www.3dkingdoms.com/web/tutorial.htm+object+space+bump+mapping+tutorial&hl=sv&ie=UTF-8) 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.

SirKnight
05-21-2003, 11:07 AM
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

Coriolis
05-21-2003, 11:41 AM
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.

chrisATI
05-21-2003, 12:16 PM
Originally posted by rviney:
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

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