New Asset Tutorial
This document describes how an artist can create a new 3d asset (mesh) to be used in the Worldforge system. We'll go through the steps needed to create a candle asset.
We use Blender for all of our 3d assets. This tutorial assumes that you are familiar with working with Blender.
1 Install the Blender Worldforge Addon
2 Get the media repository
Make sure you have Subversion installed and download the media repository from https://svn.worldforge.org:886/svn/media/trunk/
The media repository contains tools used by the Blender Addon. In order for the addon to correctly export assets your mesh also needs to be placed in a subdirectory of the repository, so that relative paths can be correctly calculated.
3 Create directories for our asset
We'll be creating a candle, so we need to determine where to place the asset. The natural location would be "assets/dural/items/misc/candle". We'll create a directory there.
4 Create an AUTHORS file
In our new directory we'll create a text file named AUTHORS where we'll enter our name and suitable contact information (email will suffice). For example "Name Namesson <email@example.com>". This is important since it makes it clear that the assets are ours. If there are multiple authors place them all in the file.
Optionally you can also provide a LICENSE file if you need your assets to be under a different license than the default GPL 2+ and GFDL 1.1+.
5 Create directories
Under our new "candle" directory we need to create three other directories: "source", "model" and "texture".
"source" will contain all of our sources, be it .blend files or texture source assets "model" will contain the exported mesh (and optionally a skeleton for an armature) "texture" will contain textures
6 Create textures
Worldforge uses a pre-defined naming system for all textures, which allows all of our tools to work together and makes it easier to know what a certain texture is for. Using our favourite image editor (GIMP for example) we'll create these three textures:
This is the diffuse texture, in RGB format, or RGBA if needed
This is the specular texture, determining the specular effect. It's a single channel gray scale texture.
This is the normals and height map texture. It's a four channel texture, where RGB contains the normal, and Alpha contains the height.
7 Create the blend file
Create the Blender source file in the "source" directory. In this case "assets/dural/items/misc/candle/source/candle.blend".
Complete the mesh and if needed bake the normals into the "N.png" texture.
8 Export from Blender
Once the mesh is complete you need to export it. Do this by first selecting it and then bringing up the Worldforge tools tab, and lastly click on the "Export mesh" button. By default the exported mesh will get the same name as the mesh object in Blender. This should create a "assets/dural/items/misc/candle/model/candle.mesh" file.
9 Generate materials
Finally we need to generate OGRE materials for our textures. Do this by selecting the mesh in Blender and then clicking on the "Generate materials" button. This will create an "assets/dural/items/misc/candle/texture/ogre.material" file.
And with that our asset should be complete. There should now be a "candle.mesh" which uses the materials found in "ogre.material" which in turn uses the textures ("D.png", "S.png" and "N.png").