Animation Channels and Polygon Offset

Published March 07, 2006
Advertisement
It's been a while since I last posted. I'm managed to accomplish quite a few things since last journal entry. The most notable change to the code base was the completion of my animation channel implementation.

An animation channel can be though of as a joint overrider. It is used to merge a list of animation together into one seamless animation (e.g. combining a running animation with an animation of the model pointing at something will yield an animation of the model pointing and running at the same time).

The animation channel modification goes as follows. For each model instance, I have a list of animation channels. Each animation channel has an associated animation sequence (startFrame, endFrame, currentFrame) and loop boolean (channel removes itself from the list if the sequence completes and loop is set to false).

I currently have only 2 channels defined, BASE_CHANNEL and UPPER_BODY_CHANNEL. Adding new channels is straightforward in my codebase.

The way I define an animation channel is pretty simple. For each model, I maintain a map which associates a channel to a list of joint indexes. To load the UPPER_BODY_CHANNEL, i simply find the joint named "torso" (a required joint name for my models) and add it and all of its children to the list for the UPPER_BODY_CHANNEL. BASE_CHANNEL is simply a list of all the joints.

Aside from cleaning up various areas of the model code, I also fixed a visualization bug that was really bothering me for quite some time.

To have the texture splats showing up properly, I added a real tiny tweak value to tile location, so that the splats would be rendered slightly above the base tile, and thus would not be lost during depth testing. The result of this produced some crappy results depending on where the camera was located (see below).





Well, I finally used glPolygonOffset to remove this ugly artifact, and was left with some nice results.







No matter what angle the camera is at, it always looks that good.
Previous Entry Model Manager changes
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement