FaceGen SDK Manual - Engine Integration

Shape

The best way to integrate an SSM is to update the vertex positions of your mesh structure.

FaceGen's mesh file formats are limited. In most cases, you will be using another format for storing your polygonal (and related) data and just using the SSM to move your vertices. The best way to do this is to preserve your vertex ordering (and count).

Some 3D engines will change your mesh's vertex ordering (or even count) when importing, to optimize for rendering. Depending on the engine, you can either disable this, or re-import after you modify vertex positions in your original ordering.

If you are making use of FaceGen stat morphs, then you will either need to copy over the morph target vertex positions, or just have these embedded in your original vertex list.

Surface Normals

For best results you should regenerate the surface normals of your head after applying an SSM (ie changing the shape). Not doing this will reduce the visual quality.

For this to work with your normal maps (useful for smile lines, wrinkles, etc) you should use tangent space normal maps.

You will get the best results by putting as many polygons as you can into the face.

These considerations are not unique to SSMs. When you animate the face you are also changing its shape, and the same considerations apply.

Animation

Your animation targets should work with all faces created with FaceGen. There are two ways that FaceGen does this.

First, the overall size of any generated face is the same. This means that most animation targets will look correct on any face. For delta morph targets (aka blendshapes), just ensure they are stored as deltas rather than absolute positions. For bone-based targets, no change should be necessary.

Second, if you are using morphs, there are a few targets for which the target position must be specified absolutely, such as eye motion or blinks. For these movements, FaceGen provides 'stat morphs', which are just target morphs in which the target vertex positions are transformed for a given face in the same way as the base vertex positions.

Eye Movements

As demonstrated in Modeller, eye movement can be reasonably approximated using FaceGen stat morphs to warp the eye patch vertex positions. This approach has the advantage of preserving the original realistic detailed texture of the eyes.

However if you must use bone-based rotation for eye movement in your engine, the 'fg3t ssmEyeC' and 'fg3t ssmEyeI' command can be used to generate SSM data for the eyes that keep them spherical. Note that when the eyes rotate they will expose colors which are not accurate.