Loading...
 
Blender Modelling Tips        

Blender Modelling Tips

This page gives some general advice on how to model Grit assets in Blender, in particular how to make the display of those assets in Blender closely match the Grit engine's rendering.

Realtime Rendering in Blender


Always choose the GLSL option for rendering in the 3D view. This is the closest approximation to how the content will appear in Grit. This is selected in the 3D View space, in the panel on the right hand side, under 'Display'. In the 'View' panel nearby, one can change the FOV and the clip distances.

Normals


Always make the mesh geometry use 'smooth' shading. The exporter will always export your mesh as if smooth shading was set, so if you do not do this you will find the normals are not the same in-engine as they are in Blender.

Image

Smooth shading is controlled in Object Mode, by selecting the object and clicking smooth from the 3D View's Tools panel. Although Blender now exports per-face smoothing, we do not encourage this practice on assets intended to be exported into Grit.

Image

Use the edge split modifier with 'mark edge as sharp' functionality to control the sharpness of individual edges. This is the equivalent of Max's smoothing groups, only easier to use. You can use the modifier to split by angle if your model is willing to play nicely with it, but we will be covering marked edges in this run-through as it offers us the most control over our mesh surfaces and will leave no room for confusion. First, add the modifier to the object.

Image

The best control is gained by selecting sharp edges (and loops) manually, and making but an angle threshold can be used too.

Image

Then, in edit mode, select the edges you want to be sharp (you can control vertex/edge/face selection modes from the 3D view toolbar or hotkey ctrl+tab) and press ctrl+E, then select 'mark as sharp.

Image

Sharp edges are hilighted if the option is selected in the 'Mesh Display' panel.

Image

In object mode, the sharp edges will now be shaded correctly (i.e. the normals are correct).

Image

It is not necessary to split edges yourself, either manually, or by 'applying' the modifier. In fact, split vertexes usually makes modelling harder since you will have to manage the extra vertexces. However, the exporter will export such meshes correctly if you do end up working with them.

Materials


Materials are not exported, one must define them in a materials.lua file manually. When modelling, a Blender material must be assigned to the model, its name will be used in the game (i.e. you must define a material of that name in your own materials.lua file). The material in blender therefore need not be configured to use any colours or textures, but it can be helpful to do so, to help visualise the scene.

Materials are assigned to faces of the Blender mesh. However, if a Blender mesh is shared between two Blender Objects, it is possible to override the materials from the mesh on a per-object basis. This comes in useful when re-using graphics meshes as collision meshes, when the graphical materials need to be mapped to physical materials but otherwise the mesh is the same. See Blender Fundamental Concepts for more information.

Lighting


There are various modes for displaying geometry in Blender. The wireframe and solid shading modes do not require lights in the scene. The solid mode will by default not display textures, but this can be toggled below where you choose the GLSL mode, as 'Textured Solid'.

Image

However the textures displayed by 'Textured Solid' are not the textures of the assigned materials, but the textures you have selected in the UV unwrap window. Thus they are not quite accurate, for example they may not handle multiple materials per mesh correctly, and the per-object material overrides will not work.

The ultimate mode is the 'textured' mode, which will render everything correctly. However, lighting in this mode is calculated with Blender lights in the scene. It is recommended to create two 'sun' lights pointing in opposite directions (the one shining down being 2x brighter than the one shining up), to light both sides of every object in a relatively realistic way.

Image

Another option for illuminating the 'textured' mode in the Blender 3D view is to use the emissive property of the Blender material. One can e.g. set diffuse to 0.5 and emissive to 0.5 to get an object with some shading but also still quite clear in the parts that don't face any lights. These material settings have no affect on the content when exported to the actual Grit Engine, as just the name of the material is used. But they do help with visualisation in Blender.