Jump to content
  • Advertisement
  • entries
  • comments
  • views

Animation Channels and Polygon Offset

Sign in to follow this  


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.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!