Vizard 7 » Content Creation » 3D Models » Cal3D Workflow » Cal3D Introduction
7.5

Cal3D Introduction

This section explains the difference between avatar and non-avatar geometry, their initial preparation, and guidelines for their use in projects.

Cal3D versus standard 3D models

The primary difference between Cal3D avatar and standard 3D models is the use of bone objects to deform a mesh. This is set up through a process called skinning and is necessary for the realistic portrayal of humans. In addition to bone deformation, avatars are able to use morph targets to deform specific parts of a mesh to new shapes. Avatars are also are designed to facilitate the use of and transitions between complex animations.

 

Avatars are also capable of being used with a modular approach to design. They can allow for head swapping, the use of props, variations in skin and clothing color, and for animations to be usable across multiple characters (that all share the same skeleton). Avatars are very useful, but they should not be used for everything. Deformability and interaction come at a price: avatars are inherently more resource intensive than environment geometry. When using software skinning, even as few as 20 avatars can cause a significant drop in framerate. Hardware skinned avatars have significantly less overhead (you can potentially have a hundred or more), but have certain restrictions to their abilities.

 

Designing with modularity in mind is also a double edged sword - the tradeoff for versatility must be weighed against a greater initial design and production phase. For modularity to work a greater amount of planning is needed - limitations must be agreed upon and great care must be taken to keep avatars consistent to each other. A complex avatar may be broken into several different parts, each with multiple variations, and could have a few hundred animations. Each part is exported to an individual file. If you only need a handful of avatars in a project, using a modular approach may take more time than it saves. For complex avatars strict naming conventions and automation via maxscript are strongly recommended.

Uses of Cal3D Avatars

While avatars are primarily used for human characters and animals they can actually be used for anything that requires complex animation. Bone animation and morph targets can be useful for portraying the movement of rope or cloth. Morph targets can also be used on vehicles to animate things like crash damage. A lone tree swaying in the wind could benefit from the use of bones as well, but a full forest would be strongly discouraged.

 

Because of the additional overhead, avatars should be used sparingly. Avatars would be a poor choice for animating a large flock of birds, distant crowds, or the subtle movement of every tree in a forest. For these cases it is preferable to use simple linked hierarchies, especially when they’ll mostly be seen at a distance.

 

For cloth animation like drapes and flags, an alternate option is the use of the OSG Sequence helper. OSG Sequence works by storing a snapshot of the entire mesh for every frame of animation. This means that deforming objects can have more accurate results than using bones and morph targets.

 

When using OSG Sequences there are two main things to watch out for: slow playback and large file sizes. If a model is too dense it may not be able to load fast enough to keep up with a 60fps frame rate. This can make it get out of sync with audio playback or anything else that is carefully timed. Large file sizes mostly happen when the animation time is long, but can happen with dense models as well. A 100 frame OSG Sequence would have a file size 100 times the size of the static object. e.g. a 1mb objects would become a 100mb animation. OSG Sequences should only be used when other approaches will not provide a sufficiently detailed animation. If an OSG Sequence is necessary, keep the mesh as simple as possible, and use the shortest loop as you can get away with.

Avatar Overhead

When software skinning is being used individual avatars have an extremely high overhead. This is because the avatars are running on the CPU. Even when using relatively undetailed avatars it is recommended to keep their population fewer than 20.

 

Hardware skinning runs on the GPU and can handle significantly larger numbers of avatars. The actual number depends on the capabilities of your individual system and the complexity of the avatar. Hardware skinning does not support morph targets, and requires each individual vertex to be influenced by no more than 4 bones.

Biped vs Custom Skeletons

3ds Max allows the use of any kind of geometry to be used as bones within a Skin modifier. Nearly anything that Max sees as a valid bone is also allowable by Cal3D. You can use Biped, Max bones, splines, etc. and can also use them in combination with each other.

 

The only rule for skeletons is to avoid mixing visible geometry with your bone hierarchy. Everything in the skeleton’s hierarchy are invisible - no geometry is actually stored in the CSF, only the pivot’s location and orientation. All geometry that needs to be visible must have a Skin modifier. While some approaches to eye movement will link the eyeballs directly to the head bone, this workflow is not compatible with Cal3D. Instead you can create eye bones, link them to the head, then add them to each eye mesh within a skin modifier. It is not necessary for the skin modifier to contain the whole skeleton.

Valid Geometry Types

As long as your Skin modifier is at the top of the stack, you can use Editable Mesh, Editable Poly, Deformable GPoly or Editable Patch. Exporting NURBS is not supported and should be converted to another type of geometry before skinning and exporting.

Valid Map Types

Cal3D avatars allow for most of the shader features that are available with OSG exports, with a few key limitations. Like OSG exports nearly all map slots of a Standard material are usable in some way: Ambient, Diffuse, Self-Illumination, Opacity, and so on. Composite layers, used for detail maps and enabling special features, and cube map reflections are also available.

 

As with OSG exports intended for shader use, maps will automatically be assumed to use the same UVs unless otherwise specified by adding in a composite map.

 

Cal3D materials have the following limitations:

Valid Skinning Modifiers

Both Skin and Physique are valid skinning modifiers for exporting Cal3D avatars. That said, most people prefer to work with Skin because it has a better toolset, a more efficient workflow, and is more stable (prevents errors and crashes). Skin was designed as a successor to Physique. Physique is still included in Max for legacy support, but is no longer actively being worked on. If an existing avatar already uses Physique it is unnecessary to re-skin it with Skin before exporting.

 

Please be aware that Skin’s Angle Deformer gizmos and Physique’s bulge editor are dependent on Max-specific features and are not supported by the exporter. An experienced user can create a similar muscle bulge effect by animating between morph targets in Vizard.

 

If you are planning to use hardware skinning, keep in mind that each individual vertex will be limited to being influenced by four bones, but in most cases this is more than enough.

Valid Animations

Cal3D animations are fairly straightforward. Nearly anything you see playing back on your skeleton can be exported as an animation. They don’t have to be limited to a single hierarchy (“floating bones” are allowed), and animations that have been tweaked using layers and the computed results of Motion Mixer can be exported without collapsing them down to explicit keyframes. Cal3D animations do not allow for any retargeting and are strictly tied to whatever skeleton they were exported for. For this reason it is common for many avatars to share the same skeleton. Cal3D animations do not support scaling bones, but a stretching effect can be produced through the use of floating bones.

Using Pre-made Avatars

Any avatar that works in Max without requiring a special plugin should also be compatible with the Cal3D exporter. Any hierarchy of meshes can be exported as a skeleton. Both Skin and Physique modifiers are supported for skinning, but Skin is preferable. Editable mesh, Editable Poly, Deformable GPoly, and Editable Patch are supported, but NURBS are not (Editable Poly is recommended). In some cases, extra modifiers like Turbosmooth may need to either be removed or relocated underneath the Skin modifier - the exporter will see the extra tessellation as unweighted vertices.

Steps Before Exporting

Once your character is finished being modeled and textured, the following must be done before export: