Pose animation lacks proper normals...

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
klauss
Hobgoblin
Posts: 559
Joined: Wed Oct 19, 2005 4:57 pm
Location: LS87, Buenos Aires, República Argentina.

Pose animation lacks proper normals...

Post by klauss »

I've been browsing the code for pose animation, and it suddenly struck me: Pose/Morph animation does not update normals as vertex positions get changed. That completely messes up lighting, except in the (oh so common) case of slight, minute animations (like facial animation... yes).

I was wondering if there was any specific thing stopping pose/morph animation from updating normals (not that much work... just add normal elements to each displacement entry, renormalise normals after applying each displacement, and viola).

Except... though... that it would indeed be a lot of trouble making both ways (normal-updating and non-normal-updating) possible and compatible (otherwise, it would break all existing animated models :( )
Oíd mortales, el grito sagrado...
Hey! What is it with that that?
Wing Commander Universe

User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Yes, this was a deliberate choice. With skeletal animation, the interpolation is an affine transform, and as such the normal adjustment is straight forward. In the case of vertex morphing, you can't adjust the normals correctly based on the position changes without re-averaging all the face normals. Yes, it is possible to export the normal information as part of the keyframe, but even then you need to re-normalise every normal every frame (potentially expensive since that's a square root), and because of the lack of orientation information the kinds of transform where normals are significantly affected don't linearly interpolate well at all. You'd be forced to bake many intermediate keyframes just to hide those artefacts.

Given these practical problems I decided to make morph / pose animation cover positions only since that was the primary usage. It's worth noting that the main existing morph-based animation formats (like MD3) don't animate normals either. I'm sure there is a way to include normals as an option but I didn't consider it worth the investment in time since it was not a commonly supported feature.

klauss
Hobgoblin
Posts: 559
Joined: Wed Oct 19, 2005 4:57 pm
Location: LS87, Buenos Aires, República Argentina.

Post by klauss »

Fair enough.
I guess then, that unless there's a clean patch...
Oíd mortales, el grito sagrado...
Hey! What is it with that that?
Wing Commander Universe

Post Reply