These are in process of being converted from the myriad of old formats and updated so that they can export cleanly to the gltf format being used by Naev.
The format basically consists of two scenes:
- The base scene is the standard model that should be used.
- The engine scene is the model to use when doing engine glows. It will be rendered separately and interpolated with the base one.
As each scene is rendered indepently and merged, it's possible to do all sorts of global illumination effects with baking.
When possible, it is recommended to bake ambient occlusion and emission maps for the model. To do this, use the bake_ao
and bake_glo
prepared in most models.
- Start with a template, in general, use the
gawain
- In the base scene, import the new model (if modelled separately) or create a new one, and remove the original gawain model
- Check to see if the model has a single texture, if so, you can use the base material as a reference with the existing textures. If not, you have to do UV mapping with the substeps below
- If model is symmetric, either use
bisect
or just delete have the model and use amirror
symmetry modifier - Create a new UV mapping, name the original base_uv and the new one bake_uv
- Now you have to adjust the new UV mapping. Using
smart UV
+pack islands
is the braindead approach to getting it done
- If model is symmetric, either use
- Bake the Ambient Occlusion (AO) using the bake_ao material on the model. You may have to adjust the texture size
- Now duplicate the base model and add it to the engine scene
- Add the glow which should be based on the ship fabricator. You can import the materials from
materials.blend
in the main directory - When done, it's time to bake the emission. Use the bake_glo material. Make sure you are not using emissions, only the emissions from the glow objects
- Save everything. Make sure it is using relative paths and unpacked.
- Now use gimp or whatever program you want to merge the emission texture (if applicable) into the baked glow texture. You should simplify copy the regular emission texture on top, and make sure the layer is set to
additive
. Save on top of the original texture - Export the model using the
export2gltf.sh
script. It'll create the files ingltf/
- Finally use
utils/model-view-c/
in the main Naev repository to check to see if the model looks OK. Look at the engine glow too by pressing thee
key - If all went well, you can now move tho model into the game and create the collision polygons with
utils/polygonize.py
- Some complicated models do not allow the above approach for baking textures because everything gets too small. In those cases, you can ignore baking (at least for now, unless you can simplify the models)
- When baking the emission for the engine glow, make sure the normal emission is not enabled, and add it later manually with a program like gimp. If you want global illumination effects, it may make sense to bake the original emission into a texture instead of using it directly too