Towards Skeletal Animation Support

After reading a lot about the subject, I finally started my crusade to add skeletal animation support on Crimild. It’s going to be a behemoth task, so this will be the first post of many about the subject.

But before performing skeletal animations we need to have something to animate, right? The COLLADA file format specification seems to be the best choice once again. It successfully manages to store animated models with all of their complexities in a standard file format regardless of the tool used to create them.

Although Crimild’s COLLADA support was able to read static scenes, it turns out that rigged models (that is, models containing skeletal information) are stored in a different way. Then, my first task was to upgrade it in order to read the data in the correct fashion. I had to refactor a couple of methods in the importer in order to load both the skin (that is, the actual mesh) and the skeleton and a couple of hours later, the result looked at this:

A rigged model and its skeleton

The model is one of the many example files in the COLLADA Test Model Bank. In the image you can see the skin as well as several white lines that indicates the presence of a skeleton. Of course, the skeleton is drawn just for debugging purposes.

Here’s another model downloaded from 3DRT:

Another rigged model

One thing that keeps bothering me is that the COLLADA importer is getting bigger and bigger in each iteration, making it difficult to maintain (even for me). So I guess I’m gonna have to do some major code review there in the near future.

Stay tuned to know more about skeletal animation support in Crimild.

Let there be light (with the appropriated shading)

A couple of days ago I managed to fix a bug in the COLLADA importer related with normal vectors that was causing some artifacts when using dynamic lighting on imported models. It turns out I wasn’t reading normal data in the correct way.

Here are some screenshots for your to compare:














Notice how the layers of color in the old version are now smoother and more realistic.


Before and After


Moving forward

Here are some screenshots showing what I’ve been up to during the last week.

First, the new COLLADA importer. I only dedicated a couple of days to it, so it’s currently in an experimental phase (you can see the flat shaded effect due to some normal miscalculations). Still, I manage to load models from both Blender and 3d Max in a fairly easy way:

The classical monkey head from Blender imported using the new COLLADA importer

Next in the list is the new OpenGL Renderer implementation. I’m re-writing it from scratch. It’s going to be completely based on a programmable pipeline using GLSL with full support for multi-pass rendering with are required in order to achieve effects like bloom or render to texture. Here are some screens showing the same scene with different shader effects applied to it:

No effects
Diffuse Lighting
Specular Lighting
Messing around with the color buffer