Back to tutorial index page

Unreal 3

Tutorial 1

Using Blender 3D to create static meshes and how to get them, correctly textured, into the game

( Caveat: Although this article is aimed at beginner designers in the sense of limited exposure to Unreal 3 technology, it assumes a certain degree of familiarity with many aspects of level design in general. Areas that a sound level of expertise are expected in particular are Blender 3D and a 2D art application.)

So let's begin....

The first step is to make your mesh in Blender. I should just take a moment to explain why I use Blender. It is a powerful and free 3D application. I do not have several thousand pounds to splash out on Max or Maya, and I don't believe in using illegal software. By supporting a community project like Blender I hope in some small way to prolong its development and longevity. Exactly how to make a mesh in Blender is outside the scope of this article. Many good tutorial exist cover that topic. A good place to start for the complete beginner is Kat's bits.

I come from a long history with idtech, and was pretty used to working in a particular way. Right from the out set, let me stress, the hoops we need to jump through to getting working models into Unreal 3 are far far less tiresome that for Quake 3, DooM 3, Quake 4 or Quake World.

The above image shows my test level inside Blender. Note that the mesh faces have not been triangulated. Unreal 3 does not require the designer to triangulate the mesh before export. Each of the separate colours represents a Blender material. This is important. The area many people go wrong when attempting to export models into unreal is just this. Textures are not exported with the mesh. Textures (or more correctly game materials) are applied to the mesh inside the editor. For the game to know what image to map where on the model though we must assign each area where a separate image will be applied an individual blender material. Each blender material must have a unique name, and I assign a unique colour to assist my identification of each section.

A blender material is some thing like an undercoat, onto which we assign a texture. For Unreal models we don't actually have to assign a texture to the material. In order for in game images to be mapped correctly onto the mesh we must however unwrap the model. Because of this I do tend to go through the process of texturing my models in Blender. This is shown below.

You are probably thinking 'wtf!' Remember these in Blender textures are only place holders. I have a set of Blender only 'checker board' textures I assign to materials. These help my orientate, scale and align UVW maps correctly.

So I have made my mesh with one or more blender materials (in my case 5). I have UVW mapped (unwrapped) it. I have assigned temporary, place holder, textures. Now I am ready to export.

For idtech games exporting multimaterial objects was a chore. A single mesh needed to be separated into individual objects, each with a single blender material. With complex multimaterial objects this was a real pain. For Unreal 3 models we can leave everything as it is...all I can say is WOOOOOOOT!

I use the goofas ase script to export my mesh into .ase format, as shown above. Save your mesh to somewhere you will easily locate it!

Now lets jump into UnrealEd. Open the editor and go to the generic browser, go to file, import then select the model you want to import into an unreal 'package'. If like me, you use custom textures, you should also import the textures that you want to actually apply to your finished mesh. Just like idtech, Unreal 3 uses multi mapped materials. You require at least a diffuse image (a coloured texture image), and probably a normal map and specular map image too. Unlike idtech, these game materials are put together inside the editor. No more hand making scripts in edit or note pad!

So with all our custom assets imported lets go to the next step. If you are not intending to use custom materials you do not need to follow this stage, but for the sake of completeness I will cover the process of creating a new material.

Make sure in the selection menu materials and textures are ticked. Right click on the required texture image and select Create New Material.

Un-tick textures so only your material is showing and right click on that. Now select the Material Editor.

This opens a new window as shown below. Depending how many images your material has, you will need to drag a number of Texture Sample boxes out of the right hand menu.

You need to add a texture to each Texture Sample box. Drag the Material Editor window to one side and select the texture image (re-tick the texture box in the generic browser left hand menu). Then go back to the Material Editor window. Select a Texture Sample box. At the bottom of the window find the line that says Texture, at the moment it will say none. Click on the little green arrow at the end of that line. The selected texture in the Generic Browser will be added to the Texture Sample box.

Nearly there!

Now on each on the texture sample boxes, left click and drag the little black tab to the relevant node on the left hand menu (diffuse image to diffuse node, for example)

Repeat that process for each texture stage, then we have a basic game material! My model had 5 materials, so I had to create 5 separate game materials in preparation for my model.

Ground work done, go into the generic browser and right click on your mesh and select Static Mesh Editor

Unlike my image above, your mesh will be showing up textured in light and dark grey 'checker board' textures, which is the default 'no texture found' image for Unreal 3. The Static Mesh Editor will show up in a new window. For the sake of quickness I have checked useSimpleRigidBodyColision. Perhaps the most simple way to set up collision is to make a collision model that is imported into our package. For complex geometry this should be a simplified version of the mesh. For the sake of quickness, in my case I used the exact same mesh as my test mesh. The collision model is a separate object. If the model object seen in game is called mystaticmesh, the new object should be called UCX_mystaticmesh. The new object is moved exactly on top of the original mesh. I gave my new collision mesh a single unique material. Both objects are exported in the same .ase model file. The game picks up the prefix UCX and uses the second object as a collision model.

Unfold the LODInfo menu and your various material slots should show up. Unlike the image below, your slots will all be empty at the moment.

Starting with the first slot, unfold the material menu

In the generic browser window select the material you want to add to the mesh material slot. Then go back to the Static Mesh Editor and click the green arrow to the right of the material line, as shown above. That material will be added, and the corresponding section on your mesh will show textured in the preview window.

Repeat this process for each material slot, selecting and adding the appropriate game material.

One final thing, move the camera to a position you like in the preview window and click the little eye button on the button bar. This sets a cool new thumb nail image for your generic browser.

When you're done, remember to save your package!

And finally...the mesh with lighting compiled

That's about it....have fun :)