Skip to main content
gamedev.net
🔒 Locked

normal maps on moving objects

Started by amish1234 Nov 22, 2003 at 3:39 AM 5 replies 750+ views
Original Post
amish1234
amish1234
Let''s say I want to use dot product3 lighting on moving objects. I have a .x file of a character. The normal map was generated when the character was in a certain position. If the character, for example, rotates his arm, then all the triangles in the arm are facing different directions. This would result in incorrect lighting, right? I know Doom III uses normal maps on their characters. Do they use dot product3 for lighting? (I haven''t actually tried this out on moving objects. I was thinking this is what would happen). ___________________________________________________________ Proceeding on a brutal rampage is the obvious choice.
___________________________________________________________Where to find the intensity (Updated Dec 28, 2004)Member of UBAAG (Unban aftermath Association of Gamedev)
Wudan
Wudan
Recalculate the new normals based upon the transformation of the object the normals are ''on'', ie, transform your normals as you transform your mesh (or whatnot).
LousyPhreak
LousyPhreak
as far as i understand it the normalmaps get somehow added to the normals of the object they are applied to. --> if you rotate your object the normals of it get rotated --> the normalmap stays fine
http://mitglied.lycos.de/lousyphreak/
JonnyQuest
JonnyQuest
It depends if you use object-space normal maps or tangent-space normal maps. The latter should be fine when animated, but the former have problems when using skinning or blending. If you''re just applying one matrix to each submesh, you can get away with object-space normal maps, but this will only work for things like vehicles and machines, not humans or animals.

- JQ
~phil
amish1234
amish1234
What are tangent-space and object-space? I tried googling, but didn''t totally understand. I haven''t finished my normal map generator yet, but I was planning on doing the following.

  1. get the vertex normal for each vertex
  2. Assign the appropriate color for each vertex normal
  3. For each triangle, interpolate between the 3 vertices to fill the triangle with color
  4. write the data to a bitmap


This sounds like object-space, right? I mean, I didn''t worry about tanget vectors or binormals or anything.

___________________________________________________________
Proceeding on a brutal rampage is the obvious choice.
___________________________________________________________Where to find the intensity (Updated Dec 28, 2004)Member of UBAAG (Unban aftermath Association of Gamedev)
JonnyQuest
JonnyQuest
I'm not entirely sure why you're writing to a bitmap.
Also, I take it that by "appropriate colour" you mean the light vector transformed into object space?
In this case, yes that would be object-space bump mapping, which,as I've said, doesn't work well with animation. You might be able to implement a very hackish workaround (I haven't tried this) which might work with skeletal animation/skinning by transforming the light vector according to all matrices (inverse though!) corresponding to that vertex, and then forming the weighted mean, but if you want to do it properly you'll have to move to tangent space.

Tangent space normal maps contain the normal vector relative to the vertex normal, i.e. the positive z direction is "outwards". The tricky bit with them is you need (at least) a second vector to fully define tangent space. (the third component can be approximated by performing a vector product, but you might need to supply that as well)

- JQ

[edited by - JonnyQuest on November 23, 2003 7:03:27 AM]
~phil

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.