5. Importing in OpenBRF
1. Are you happy with your new model? Let's export it. Go to File > Export > click little box after Wavefront (.obj). Make sure the settings are same as below in the screenshot.
Quote
One group per material: ticked
Triangulation: ticked
Import Scale: 10.0
Export Scale: 0.1
Export normals/smoothing groups: usually ticked, but you can untick this (quicker export)
Export UV coordinates: ticked
(click to show/hide)
You can untick Export normals/smoothing groups, because OpenBRF will do the work for us. For an explanation what they do see below:
Normals
We won't deal with this, you should skip this, because you don't need
to use it. But if you want to know it; normal maps are something which create a 3D view
of a flat surface. Look at the following images. The first one shows us an actual model
with many polygons, the second is a normal map. The third is a flat surface
rendered with normal map on. This creates a nice 3D view for free.
Now forget this and move on.
(click to show/hide)
Smoothing
They mean the use of soft/hard edges. You can manually make
edges soft or hard. The difference is clearly visible at these images:
Soft:
(click to show/hide)
Hard:
(click to show/hide)
2. Now export and replace the existing "dblhead_ax.obj" file. Rename it to doubleaxe.
3. Save your model again, but now as a .wings file. I bet you know how to do that. You use of course CTR+SHIFT+S.
Note: Give everything the same name. Photoshop file, .dds, .wings3d, .obj, texture, material. That's easier.
4. Time to open OpenBRF. Import the file with Import > Static Mesh. Time to explain something about OpenBRF. You can consider it a library of meshes, materials, textures and collision meshes.
Quote
Meshes - The actual models
Materials - Especially useful to assign shaders.
Textures -
Collision Meshes - Models consisting of solid faces which prevent you from walking through ingame.
(click to show/hide)
5. We have now imported the mesh (object/model). Let's import the material & texture. We create these by clicking Import > New Material > tick "Also add new texture..." > rename "new_material" to "doubleaxe" > Ok.
If everything went well you should be able to see your model with texture applied to.
We have now 3 tabs. Mes1, Mat1 and Tex1. Mes1 stands for: Meshes (1x).
Go to tab Mat1 (materials) and change shader to "tex_mul_color" as visible below:
(click to show/hide)
6. Let's do some magic. This is very useful information, listen carefully; click the mesh while being in Mes1 tab: RMB > Recompute Normals > Ok. OpenBRF now automatically calculates the hardness of your model See chapter 4.17 - Smoothing of this tutorial.
Now pick "Color with Ambient Occlusion". OpenBRF will now create some basic shadows.
Do you see the tab Make a collision mesh. Don't click it, it's only needed for scene props (scene models; buildings, carts). Again a collision mesh prevents you from walking through the model. If a surface of this mesh is less than 90 degrees you will be able to climb ingame (handy for stair models).
(click to show/hide)
Time to learn you something important: polygons. Polygons = faces.
Select your mesh while being in the Mes1 tab. You will be able to view the amount of polygons. This should absolutely not be very high. Otherwise it demands too much from your computer. Here's a list providing averages for each type model:
Quote from: Average amount of polygons per type model
Normal helmet : 500
Full faced helmet : 800/1000
A body armor : 1000
A sword : 250
Special/Detailed sword : 400
Small axe : 300
Two handed axe : 400
Two bladed axe : 500
Lance : 150/250
Spear : 200/300
Shield : 400/500
Bow : 100/200
Crossbow : 300/400
Scene prop : 500-2000
You see we are far below the average amount of polygons, very good!
It's of course possible to make exemptions. Take for example my model of the St. Peter Basilica which is about 350,000 polygons. I have a lot performance problems with it, so try to avoid such models.
7. Save your .brf file in ...Warband\Modules\MyMod\Resource\, do this by clicking File > Save as.