Game Export
Note:
Game Export was modified to transfer eyelashes rigged with the new Build Eyelashes tool.
• In the Mesh tab of the Game Export property a new UI Group named Face Parts was added. o If the Face Robot mesh has eyelashes rigged with the eyelash tool, the Copy Face Parts button will transfer them to the Game Rig.
• In the Envelopes tab of the Game Export property, the structure has slightly changed. • The Groups were made to be dynamic such that if Envelope is not checked inside the Envelope Generation Group, the envelope settings will not appear. • The Envelope Timeline Resampling Settings were also made dynamic. They will only show up in the UI if Envelope Timeline Resampling is checked. • Some groups were renamed to distinguish between options that are executed when the Generate button is pressed and options that can be manually executed afterwards. o <On Generation> These occur when the envelope and animation are being transferred. o <Driven> These are extra steps that can be preformed manually after the envelope has been generated.
• Eyelashes, if found, are automatically enveloped and animation is transferred. • If eyelashes are attached to the Face Robot rig after the game export has been done, they can be manually transferred by clicking on Transfer Eyelash Envelope.
Tools have also been added to Game Export to allow for controlled smoothing of the envelope weights.
• An Envelope Smoothing UI group was added in the Envelopes tab with options to smooth the envelope in the difficult areas around the eyes and mouth. o Get Smooth Map calculates a smoothing ring around the eyes and mouth. This map can be refined by the artist. o Apply Smooth Map smoothes the game envelope on the areas defined by the smoothing map. This button can be applied as many times as necessary to increase the smoothing effect. o Cleanup will remove the smoothing maps from the game mesh.
After you have solved, tuned, adjusted, calibrated, and animated a head in Face Robot, you can prepare it for and export it to a game engine using the Game Export tool. This tool exports the envelopes and bones in a model file (.emdl).
To use the Game Export tool, you need:
- A high-resolution solved Face Robot face mesh.
Make sure that this mesh has all the wrinkles and folds built into its geometry, and that you’re satisfied with the animation on it. Remember that the quality of the resulting game export rig will only be as good as what you start with!
- A game-Resolution face with a non-overlapping UV set.
This is the game model that you will create. It may be an exact copy of the high-resolution mesh, or a reduced version of it. This model allows real-time playback of the performance and is ready to be brought into a game engine.
| Table of contents |
|
1 Creating and Preparing the Game Mesh 2 Selecting the Game Mesh and Its UVs |
Overview of the Game Export Workflow
The basic Game Export workflow involves the following steps. See each corresponding section for details on what you need to do:
| To run a batch file for this process, see Game Export Batching.
|
1. Create a game version of the original Face Robot head for exporting — see Creating and Preparing the Game Mesh.
2. Align the game mesh and the original Face Robot mesh in the same physical space when they're in a neutral/base state — see Creating and Preparing the Game Mesh.
3. Click the Export tab on the Act panel and choose the Export Game Rig (Bones) option. The Game Export property editor opens - see Exporting from Face Robot for more information.
4. On the Mesh page in the Game Export property editor, select the game mesh to export and its non-overlapping UV set — see Selecting the Game Mesh and Its UVs.
5. On the Envelope page, paint the bone locators on the face and set the other envelope options — see Painting Bone Locators for the Envelope.
6. Export the envelope with the animation and then check for problems. Go back and fix any issues on the envelope, if necessary.
| If you want to start again, delete the Envelope operator from the game mesh and delete the Game model that has been created.
|
7. On the Normals page, generate the rest and stress normal maps for the face — see Generating the Normal Maps.
8. On the Masks page, generate the normal masks to be exported — see Generating the Masks.
9. On the Shaders page, build up and apply the realtime shader to be exported — see Building Realtime Shaders.
10. Create a flipbook to see how everything is going.
11. When you’re done everything, export the GameExport model as an .emdl file.
Display Options
Set these options on the Display page to optimize what's displayed in the viewport as you’re working, as well as quickly select the high-res Face Robot mesh or the destination mesh.
Creating and Preparing the Game Mesh
To use Game Export, the original head model in Face Robot must be a completed high-resolution mesh. Make sure that this mesh has all the wrinkles and folds built into its geometry, and that you’re satisfied with the animation on it.
Once you have a good head, you need to create a game version of it for exporting.
To create the game mesh:
1. Click the Export tab on the Act panel and choose the Game Export option. The Game Export property editor opens.
2. On the Mesh tab in this property editor, click the Use Duplicate button to create a copy of the original Face Robot mesh. The copy is automatically selected as the game mesh.
3. You can then do either of the following:
- Leave the game mesh head “as is� so that you have a high-resolution mesh that’s identical to the original head. The result is an optimized model that doesn’t include the entire Face Robot solver, so it can be more easily exported.
or
- Create a lower-resolution version of the original Face Robot head for the game mesh. You can use the Polygon Reduction command to do this. This is the most common route to take. Even though the head has fewer polygons, you can transfer the animation from the original head without losing quality. As well, all wrinkling details from the original head will be preserved in the game mesh.
Aligning the Meshes
Once you have created a game mesh, you need to align it and the original Face Robot mesh in the same physical space when they’re both in their neutral/base state. This has implications for transferring the envelope later, so you should try to match the location of the original and game mesh as closely as possible.
1. Because the original mesh is animated, it may be moving around a bit, so you need to first mute the operators in the head’s Animation construction history, which returns it to its neutral pose.
For information on operators and the construction history, see the section called Operator Stack in Building 3D Objects (http://softimage.wiki.avid.com/xsidocs/basic_mod.htm).
2. Select the points on the game mesh and then use Deform > Shrinkwrap to make it match exactly with the original head. Use the Closest Surface option. Remove the shrinkwrap operator from the game mesh’s operator stack when you’re done.
For information on shrinkwrapping, see the section called Shrinkwrap in Deformations (http://softimage.wiki.avid.com/xsidocs/deforms.htm).
3. When you’re done, unmute the operators in the head’s Animation construction history so that you’re using the correct animation data.
Selecting the Game Mesh and Its UVs
After the head meshes are aligned, you need to select the mesh that you want to export, also known as the game mesh.
1. On the Mesh page in the Game Export property editor, click the Pick Mesh button and select the game mesh that you want to export.
If you clicked the Use Duplicate button to create a copy of the original Face Robot mesh, the copy is already selected as the game mesh.
| Use the buttons on the Display page to easily hide/display and select the original Face Robot mesh and the game (export) mesh.
|
You also need to select a set of UVs for the game mesh, or generate a new set. The UVs should be non-overlapping with as little discontinuity as possible. If you want to reuse the same UVs from the Face Robot mesh, you can use GATOR to transfer the UVs from it to the game mesh.
For information on GATOR, see the section called Attribute Transfer in Building 3D Objects (http://softimage.wiki.avid.com/xsidocs/basic_mod.htm).
2. Do either of the following:
- On the Mesh page, select UV Map > Pick UV. This opens an explorer from which you can select an existing UV set.
or
- Click UV Map > Generate to create a new set of UVS called texcoords, which is based on the angle grouping. You can find this set under the geometry node of the game mesh head or in the Texture Editor (press Alt+7).
Painting Bone Locators for the Envelope
The purpose of painting locators is to define the location of the bones that will be exported to your game engine. These are the bones that deform the envelope.
You paint the locators on the original Face Robot mesh, then transfer the envelope weights and/or animation to the game mesh. You need to paint locators at anchor positions in the areas of greatest deformation, such as the mouth region. Every major deformation area should be covered by a bone.
You want to capture the face’s deformation as accurately as possible with the minimum number of bones (30 bones is often the maximum number used in games). This is often a trial-and-error process requiring a few iterations to get the bone positions just right.
Always refer to your reference animation or live action video to figure out which areas move the most.
1. On the Envelopes page in the Game Export property editor, click the Locators button and start painting on the map where the bones should be.
or
If you already have a weight map created for the locators, click the Import button to open a browser from which you can select the weight map.
For more information about using the Paint Tools, see Painting Weight Maps.
2. Create a flipbook to see if there are any problems with bone flipping, etc. Then go back and repaint the locators as necessary.
For information on flipbooks, see the section called Capturing Animation in a Viewport (Flipbook) in Playing Animation (http://softimage.wiki.avid.com/xsidocs/ani_play.htm).
3. Click the Hierarchy > Jaw Parent button to paint the area around the jaw that will be deformed by the jaw bone (mandible) at runtime. This creates a jaw map.
By painting the jaw bone properly, you can improve the quality of interpolation between animation clips. If you don’t create a jaw map, the jaw will not be parent to any bones.
Clicking the Jaw Parent button activates the paint brush and hides the game mesh so that you paint only on the original high-res mesh.
You should select a frame where the mouth is open so that you can more easily paint the bottom half of the mouth and jaw.
Smooth out the edges between the jaw and the rest of the head.
4. Click the Hierarchy > Neck Parent button to paint the area around the neck to define which part of the skin is parented to the neck bone. This creates a neck parent map.
If you don’t create a Neck Parent map, the neck will not be parent to any bones.
Clicking the Neck Parent button activates the paint brush and hides the game mesh so that you paint only on the original high-res mesh.
Smooth out the edges between the neck and the head.
5. Set the Envelope Settings:
- Weights Per Bone: Number of weights per bone that the game engine can handle. This is usually 3.
- Envelope Ears to Head Deformer: If you select this option, the ear envelope in the game mesh is automatically included as part of the head.
- Clamp Weights: Clamps the envelope weights.
After picking the bones and painting the jaw and neck maps on the original high-res mesh, Face Robot can automatically set envelope weights on your low-res mesh and transfer the animation from the high-res mesh to it.
Before you export, you may want to apply the Smooth operator to the envelope to help smooth out any bumps in the geometry.
For information on smoothing, see the section called Modifying Envelope Weights in Envelopes (http://softimage.wiki.avid.com/xsidocs/att_env.htm)
6. Select the Export Animation and/or Export Envelope options, depending on what you want to export.
- Export Animation exports only the animation from the high-res mesh to the low-res game mesh.
- Export Envelope exports only the envelope weights from the high-res mesh to the low-res game mesh. If there is already an envelope on the game mesh, deselect this option.
7. When you're done all painting and setting up the envelope, export all this information to the game mesh by clicking the big Export button.
After the animation is transferred, check that the general deformation is good on the low-res mesh envelope by moving the nulls on the face.
Scrub through the timeline or create a flipbook of the animation and study the low-res mesh to check for flipping problems: if you notice some flipping, it indicates that a locator was not placed properly. You can either remove the locator or pick a new position for the locator and re-export it.
Envelope Timeline Filter
This filter is an optical flow method to improve the quality of the envelope. If you select this option, the filter is run automatically when the envelope is set. It can also be used to improve the quality of the envelope if it does not fit a certain animation. This option should be used only if there is animation associated to the export.
The Envelope Timeline Filter works by reconstructing a set of best possible envelopes per point per frame along a timeline, and then fitting the resulting combinations. This allows the game export mesh to match the closest possible weight combination to the FR mesh.
Note that the quality of the envelope requires that the locators are well placed; that is, the points of major deformation have deformers associated with them. Envelope filtering will only fix an envelope if the locators have been painted.
While envelope filtering significantly improves the quality of the export in most cases, it can be a slow process if the mesh is very heavy or if there are many frames.
To have the best fit, you can select an area of the timeline where major deformations occur and run the envelope filtering over only those frames. It is not necessary to run the entire timeline, but it is important that the timeline range that is evaluated with the filter has good deformations.
- Resample Envelope on Animation Export runs the Envelope Timeline Filter when you export.
- Reconsider Neighborhood: With the default value of 0, the envelope filter analyzes weight distribution only for the deformers that already affect a point. If this is not accurate, you can set this option to analyze the deformers for the points' neighbors as well. The higher this value, the slower the fit process, but in certain cases this might help the quality of the game export if the initial weight distribution is wrong.
Step is the interval of frames that are sampled; for example, a value of 2 samples every other frame. The larger this value, the faster the export; the smaller this value, the more sampling and time required, but with probably better results.
- Resample Envelope runs the Envelope Timeline Filter again.
- Revert Envelope toggles between the filtered and unfiltered mesh envelope. The information is stored in a DataBlob under the Game Mesh, and can be deleted for scene cleanliness.
Generating the Normal Maps
Face Robot can automatically generate stressed and unstressed (rest) normal maps to “feed� the runtime shader. These maps take all the surface details from the original high-resolution Face Robot mesh and transfer them to the game mesh. Normal maps need to be generated to get a good looking export.
For the best quality, you should also generate a stressed mesh, then export it and tune the visual quality of the wrinkling by using general modeling in any 3D program (such as Face Robot, XSI, Maya, 3DS Max, etc.) and detailing in a paint program (such as ZBrush, Mudbox, etc.). Then bring it back into Face Robot and pick it as the stress normal map to create better definition for the expressions.
1. On the Normals page, select the options for the maps that you want to generate:
- Select the Rest Normal Map option to generate a normal map of the face in its rest state, where it’s in a relaxed pose.
- Select the Stress Normal Map option to generate a normal map of the face in its stressed state, with many muscles in the face being active.
2. Set the Normal Map Options used for the maps:
- Image Type: Select the output image format for the map: png, tga, bmp, pic, jpg, ppm, tif(8b), tif(16), tif(float), exr(half), exr(float), ct(8b), ct(16b), or ct(float)
- Resolution: 2048 is probably the best-looking
- Quality: Medium is usually fine, but Highest will obviously produce the best quality, if you don’t mind the wait!
- Rest Map Prefix and Stress Map Prefix: Specify the prefix names used to distinguish the normal maps from each other.
- Geometry > Subdivision Level: 2 is probably fine. This is the SubD Level that is applied to the original Face Robot mesh from which the Rest and Stress Normal Maps will be generated.
For information on subdivision levels, see the section called Creating Subdivision Surfaces > Applying Geometry Approximation in Subdivision Surfaces (http://softimage.wiki.avid.com/xsidocs/subdivs.htm).
- Geometry > Normal Discontinuity Angle: 180 degrees. This number should be kept high to get good normal map generation, otherwise areas of high angles will get discontinuities. Increase the value when you notice areas of discontinuity.
For information on discontinuity angles, see the section called Viewing and Rendering Polygon Meshes in Fundamentals of Polygon Modeling (http://softimage.wiki.avid.com/xsidocs/poly_basic_FundamentalsofPolygonalModeling.htm).
3. Click the big Generate button to generate the normal maps you’ve selected.
Creating a Stressed Mesh
For the best quality, you should generate a stressed mesh, then export it and enhance the visual quality of the wrinkling by using general modeling in any 3D program (such as Face Robot, XSI, Maya, 3DS Max, etc.) and detailing in a paint program (such as ZBrush, Mudbox, etc.).
When you bring it back into Face Robot, you can pick it as the stress normal map to create better definition for the expressions.
You need to generate the rest and stress normal maps before you create a stressed mesh.
1. Select the Stressed Mesh option to create a version of the game mesh with the results of the stress map applied to it.
2. Select Use Custom Stress Maps to pick and use a specific stress map to generate the stressed mesh. If not, then the current stress map is used.
3. Click the big Generate button to generate the stressed mesh.
Generating the Masks
Masks modulate the blending between the stress and rest normal maps. They are automatically generated in 1, 2, or 3 vertex color map sets, where each color channel contains one mask (3 per vertex color map) so that you can have 3, 6, or 9 region masks.
Masks consolidate the region deform areas on the face (see Adjusting the Region Deform Areas) into a smaller set of regions (as many as 9) for the game engine. One mask can cover a group of deform areas, such as one mask for the forehead, one for each cheek, etc.
1. On the Masks page, select the Generate Masks to generate the masks.
2. Select the Animate Masks option to generate the animation on the masks. The animation determines which area of the mask turns on or off at the right time to reveal the stress normal map.
3. Set the number of Region Masks to be generated for the shader: 3, 6, or 9. Each mask controls 3 regions of the face.
4. When you’ve set all the mask options, click the big Generate button to generate the masks you’ve selected.
In the explorer, check under the game mesh’s cluster to see that the masks that are generated, as well as a tangent operator.
5. Click the Toggle Display Map button repeatedly to toggle through the masks that have been created for the game mesh.
Click the Display Next Mask Set button to toggle through the sets of masks.
6. Use the Vertex Color tools to paint on the masks to add or subtract definition.
For information on vertex colors, see Vertex Colors (http://softimage.wiki.avid.com/xsidocs/tex_vcolor.htm).
7. After the realtime shader is applied, select the Region Masks Pset to experiment with the sliders. This lets you exaggerate the animation to tweak the normal maps’ influence. You can also animate each of the slider’s weights separately.
Building Realtime Shaders
You can build a game realtime shader to which you can add textures. This shader is created for the game mesh. When you add textures in the “texture stack�, nodes for each texture are created and attached to the realtime shader, as you can see in the shader’s render tree.
For information on the render tree, see The Render Tree (http://softimage.wiki.avid.com/xsidocs/rendertree.htm); and for information on realtime shaders, see Realtime Shaders (http://softimage.wiki.avid.com/xsidocs/realtime_conc.htm).
1. Click the Shaders tab in the Game export property editor.
2. Do either of the following:
- Click the Add Textures button to create a shader node in the render tree for each texture that’s defined on the game mesh.
or
- In the Texture Stack area, click the buttons to select the texture images you want to use:
- Rest Color - regular skin texture map
- Stress Color - stress skin texture map
- Rest Normal - rest normal map
- Stress Normal - stress normal map
- Specular - highlights map
- Back Diffuse - Used for the Subsurface Scattering (SSS) shader, if you’re using one. This shows areas where the skin “glows�. If you’re not using an SSS shader, you can ignore this option.
3. From the Map to Blend list, select a Normal map, Albedo map, or Both to blend with face’s texture.
4. Apply the texture and maps and create a shader output by clicking either the big Skin CGFX or Skin DX button, depending on which format you want to use.
For either of these options, there need to be at least 3 directional lights in the scene for the shader to work properly.
or
Click the Custom OGL > Pick button and select an OGL preset.
5. After the shader is applied, select the Region Masks Pset option on the Masks page to experiment with the sliders. This lets you exaggerate the animation to tweak the normal maps' influence.
If the wrinkles aren’t strong enough or the expressions are weak, you can create more pronounced effects after you’ve hooked up the shader.
To do this, click the Region Masks Pset button on the Masks page to open the set. In it, you can edit the sliders’ fcurves in the fcurve editor. Select them all and scale them up to create overall stronger effects.
Managing the Paths to Your Files
Check these paths on the Shaders page in the Game Export property editor:
- Project Path is the path to the folder where Game Mesh Models will be output. If none found, Game Export will not be exported to emdl. Click Current to use your current project’s folder.
- Relative Paths ...
- Absolute Paths is the list of c3d files that are to be passed to animation. C3d files must have nmaps and fmaps already assigned
- Force Relative Paths forces the game export generation to continue despite any errors.






