Debugging Tools

As I started working on skeletal animation, there was a need for a couple of utility classes specifically designed for debugging purposes. So here they are:

The HierarchyRenderComponent class
One of these utility classes is the hierarchy render component, which I’m using in this example to render all bones in the model:

HierarchyRenderComponent class in action drawing bones on a rigged model

This render component implementation traverses a scene drawing lines from parents to each of its children. It requires a shader program to draw the lines, but it can be customized as much as needed. For example, I’m working on a version of the shader using different point size for the joints between bones that will be available soon.

The SceneDescriptor class
The other one is a visitor implementation that prints out all nodes in the hierarchy. That way I know if a scene is composed as I expected (and also if I’m adding more group nodes that needed).  Here’s the console’s output after loading the scene in the image above:

Example output for a loaded scene

This class is particularly useful to find out which nodes are redundant and can be eliminated. For example, a GroupNode with only one child and no transformations applied it’s hardly useful and can be completely avoided.

Both of this classes are part of the new Crimild::Debug namespace. My intention is to create as many of this utility classes as needed in order to provide a reusable debugging library for any Crimild-based project.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.