User Tools

Site Tools


Sidebar

hpl3:engine:model_export

This is an old revision of the document!


Model Export

HPL3 mainly uses Collada for importing models into the engine binary format, so this guide will only be about the Collada format (.dae). First of there will be some general information that concerns all 3d modelers. After that there will be some more specifics for the mayor packats

General

Setup

Units
Before doing any modelling, make sure that the units are properly set up. 1 unit must equal 1 meter or similar. It is also okay that 1 unit = 1 centimeter, but then a 1 meter high object needs to be 100 units high and so on. The engine will automatically adjust any data according to how the units are set up.

Modelling

Setting Material
Always set the diffuse texture of the editor-material to have the same name as the engine-material (.mat) you want it to have. This is best accomplished by always letting the diffuse texture for the material have the same name as the engine-material (e.g. “dirt_road.dds” and “dirt_road.mat”). What happens when the model is loaded is that the engine checks the diffuse texture for the current submesh and then replaces the extention (eg “.dds”, “.tga”, etc) with “.mat” and then tries to load a material with that file name.
Note: When using the modelviewer, it will automatically create the “.mat”-file if one does not exist, and thus an engine-material does not need to be created by hand if the names of the texture are set up as described here.

Multiple Materials
In order to have a mesh with multiple material you must have several submeshes (or whatever the name of discrete objects in the editor) each with its own material and with different names of the diffuse texture. For example say you are making a character that requires a two materials, one for the hair and one for the body. You then first need to make sure that the hair and body are separate submeshes, then give each one their own material. The body's material can then have the diffuse map: “character_body.dds” and the hair's material can have “character_hair.dss”. The engine will now use two different materials to load this character.
Note that this is the only way to go about! It is not possible to have polygon-IDs or whatever tricks the editor might have. One submesh can only have one material!

Animation

Maya

Setup

Collada exporter settings
Here is how the export tool should be set up:

(Click for large version)

Modelling

Material fails to export
If the model gets exported without any material, check so that “intitialshadingGroup” has not been connected to the model. If it has been, then simple set the same material to the model again and the problem will go away.

Animation

3DS Max

Modelling

Animation

Modo

Modelling

Mesh Setup
Every submesh in the scene need to have its own mesh layer and material for the texture and properties to be exported correctly.

Triangulate
The export tool does not triangulate the mesh autoatically so before exporting, you must enter geometry/polygon/triple in order for everything to be triangulated.

Animation

hpl3/engine/model_export.1322210226.txt.gz · Last modified: 2011/11/25 08:37 by thomas