LithTech Model Importation from 3ds Max 4

LithTech currently has exporters for
· 3D Studio MAX 3.x with Character Studio 2.1+ and 3.0.2+
· 3D Studio MAX 4.x with Character Studio 3.1.2+ or Skin

Creating models for LithTech requires in 3ds Max: 1. Create the model. 2. Apply the UV texture coordinates. 3. Insure mesh quality by utilizing ‘Xform’ modifier in 3ds Max. 4. Move mesh center to origin. 5. Attach the mesh to the skeleton. 6. Animate the skeleton. 7. Export the model.

The geometric center of the model should be at the origin. For human character models, for example, this would be the pelvis. Within max insure that the geometric center (the pivot aligned to center of object and world) is moved to 0,0,0.

The model can be made up of one or more meshes. Generally, splitting up models helps make UV mapping easier and can create reusable parts such as hands and feet. The UV mapping of a model has to be done in the modeling package.

Texture Mapping
All textures in LithTech are 32-bit by default and their size must be a power of 2.

You can assign multiple textures to a model by assigning up to four texture indices per model piece, but it is recommended to utilize one texture map if possble.

All surface material properties defined in the modeling package are ignored in the exporter. Vertex colors, lighting etc are lost in the conversion, except for UVW Mapping. Use DEdit to convert images into the .DTX format required for the game. DEdit can understand and import .PCX or .TGA files. The advantage to using a .TGA file is that since Targa files have a built-in alpha channel, DEdit can automatically generate an alpha mask for the texture without the need to import a second file as your alpha mask. .PCX files require a second file for their alpha mask, adding a second step and a second file to keep track of.

To attain the .dtx file for texture map, convert texture map to .tga via Adobe Photoshop or any other graphics application. Utilizing the Lithtech dtxutil executable, type:
dtxutil –tga2dtx ‘yourfilename’.tga ‘yourfilename’.dtx
The .dtx file will be created in the corresponding folders, if all paths are correct. Textures can optionally be assigned to objects in MAX and show up immediately in ModelEdit. To do this, assign a Standard material to the object and place a Bitmap texture in the diffuse slot of the material. At least one texture index for the object must be set up using the user properties as described above. The texture base path should be entered the same way as described in the 3D Studio MAX Terrain and Brush Exporter section of this manual, but a brief summary follows:
If you have this texture assigned in MAX:
C:\Max Scenes\ProjectModels\textures\wood\pine1.tga
And this texture in your LithTech resources:
D:\Project\d3drez\textures\wood\pine1.dtx
You would enter C:\Max Scenes\ProjectModels as your base texture path so that the project relative filename textures\wood\pin1.dtx would be stored in the model .LTA file.

Skeletal Animation
If models are to share animations, then all models sharing a set of animations should have the exact same hierarchy. This is very important. Differently organized hierarchies cannot share animations. The skeleton offsets should be similar, but do not have to be exact. There are problems using animation from a short character on a tall character, but most things like walks, runs, and general hand movement work fine. The biggest problem is two characters with different shoulder/arm proportions sharing an animation that requires using two hands together, like holding a rifle, or even something like clapping hands. This will almost never work right, but LithTech supports overriding a shared animation on a per-character basis, so it can be worked around. Remember that animated bone scaling will not be preserved by the exporter.

An important concept to remember about the .LTA file format is that it is a database that contains the model’s geometry, bone hierarchy, level of detail information, and mode. The model database can refer to other files, especially if many models share the same set of animations.

The engine supports the basic skinning operators available in the supported modelers. However, all modeling packages have many more features than the game engine does. Exporting new animated models into an existing .LTA file lets you create a file containing many animations. To do this requires that the hierarchy of the model being exported is identical to that of the existing file. You can import animations from other models with matching skeletons. Each animation must be exported as an .LTA file. In ModelEdit you select multiple .LTA files when you import.

All exporters work similarly, but because of the feature differences of each package, each exporter exerts different restrictions on modelers. The modeler is going to have to become familiar with the limitations of the packages in relation to the LithTech model format. When first starting try making simple models, test them in ModelEdit and a simple game level to see how it all fits.

Vertex Animation
Models animated with the Skin modifier cannot use any of the Deformer Gizmos. This includes the Joint Angle deformer, Bulge Angle deformer, and the Morph Angle deformer. The MAX model exporter supports vertex animation to be exported by using the User Defined Properties tab of the Object Properties dialog. Type the following in the Properties dialog box:
VertexAnimated=true
An object can be specified as being a vertex animated piece by using the VertexAnimated=true user property, or by having the object name begin with d_. Vertex-animated models don't use skeletal animations, but use vertex positions to draw the model. This allows for animations not possible with skeletal animation. LithTech supports vertex-animated models exported from 3D Studio Max, but they are very expensive for memory.
Vertex-animated model files tend to be very large. In vertex animation, every vertex has a position stored for every keyframe. In MAX, you can use any technique to animate the vertices and the exporter writes a keyframe for every frame. Vertex-animated models can be mixed with skeletally animated models, and attachments to skeletally animated models can be vertex-animated models.