Basics of Asset Creation in Blender: Take a Model from 3D to Game-Ready
When working on your own game project, a large part of it is creating the assets, whether it's an ammo crate, or even detailed environment pieces like rocks, cliff faces, trees, old ruble and more. While many game engines out there like Unreal Engine 4 have extremely powerful terrain editing features, allowing you to quickly create whole landscapes it certainly doesn't stop there. You'll need to create the things that fill these landscapes, the things that really breathe life into it. You'll need things like small rocks and boulders to place around your environments.
If you're a game designer on a budget, then one 3D application you might be very familiar with is Blender. Blender has all the capabilities of the other 3D applications, letting you create detailed assets, retopologize, texture and bring into the game engine. In this article we'll walk you through the process of modeling a cliff face in Blender utilizing its powerful sculpting features to create small details, you'll also learn the importance of retopologizing, and UV mapping to ensure that your asset will be optimized for Unreal Engine 4.
(Note that this tutorial assumes some prior knowledge of Blender and Unreal Engine 4. If you're new to both I recommend watching Introduction to Modeling in Blender as well as Introduction to Unreal Engine 4.)
Before you begin any model, the first thing you need to do is come at with a game plan. What asset are you going to create, and what purpose is it going to serve? For this particular asset we know we want it to be a simple rock asset, be we also want to have the ability to repeat the asset in other areas of the game. When it comes to game design, a very important and common technique is to use the same asset in different areas. For instance, a simple rock asset will probably be repeated hundreds of times in different areas on a level, whether it's protruding from a grassy hill, or part of a cliff face.
You also need to know your poly-count. Every game is going to have a polygon budget, which means each asset you create has to abide by these rules. While it would be nice to sculpt a rock in ZBrush that consists of a million polygons, and simply import it into Unreal Engine 4 and have it run smoothly, that just isn't the case. Thousands of assets can make up one single level, if every asset consists of millions of polygons; your game is going to break. For this particular scenario, we don't really have a game, so there isn't a polygon budget, we're just creating a single asset, but even then retopologizing is something we'll need to do. Because as a game artist, retopologizing is a technique you'll have to be familiar with.
Now it's time to start modeling. There are many different methods you can take, but when it comes to creating very organic shapes, taking a sculpting approach is probably the best method you can take. It's a very natural process and you can quickly sculpt in the roughness of a rock in shot a short while.
Luckily, Blender has some really nice sculpting features. To start creating the rock asset I dropped in a simple polygon cube, with the cube selected, I subdivided it roughly five times. Having enough resolution to work with is important, but you also don't want to over do it. Blender has a feature called dynamic topology, which we'll discuss more a little later when we get to that point.
Before we start sculpting, it's a good idea to change the material. Right now it's kind of hard to get a clear view of our mesh because there is a default material applied to the cube. If you've worked in any other sculpting application before like ZBrush or Mudbox you're probably familiar with matcap materials, which are great when sculpting, and Blender has these same material options.
To enable a matcap material, click and drag out the little "+" icon in the top right of the 3D viewport, this will open up the properties panel for the object. Scroll down to shading and check the Matcap option. You should see an image of a new material appear, click it and this will give you a few different matcap materials to choose from. I've chosen the "Red" madcap as it's very similar to the ZBrush material.
In order to activate sculpting, select the mode pop up menu, and choose Sculpt Mode. You should see that your toolbar changes slightly and displays a variation of sculpting properties. If you select the large image at the top, this will let you choose which brush to work with. For this particular sculpt, there is really only three brushes you need to use, the Clay Strips, Scrape/Peak and the Grab brush. Of course, you may find areas where other brushes may come in handy, but for the most part these should do the trick just fine.
Select the "Grab" brush and scroll down the sculpting properties and open the Topology drop down menu, and select Enable Dynamic, and check the Smooth Shade option. This will enable the dynamic topology that was mentioned previously. What dynamic topology does is add more topology or resolution as you're sculpting.
So with the "Grab" brush selected you can start pushing and pulling the cube around into a basic shape of a rock. It doesn't have to be a certain shape, because every rock is going to be different, so there is really no right or wrong way to start shaping the cube. I've gone for a more elongated look, so I started to pull the cube out into a more rectangular shape.
You can change the radius of the brush my adjusting the pixel size at the top of the Sculpt properties.
Now that we have a rough shape in, and it no longer look like a simple cube, we'll want to change the brush to Scrape/Peak. Once you start using it on your rock you should start to see some pretty interesting results, because this brush cuts into the mesh, creating very sharp corners and indentions, which is great for creating those random peaks and indentions you see on real rocks.
Finally we're going to use the Clay Strips brush to add some of the finishing touches. The Clay Strips brush is really great for adding that rough texture that you see on rocks in the real world. If you want to cut into the mesh, hold CTRL while you're sculpting, and if you want to add geometry to the rock, let go of CTRL and this will let you add onto the mesh. Experiment with pulling and cutting geometry into the mesh to get the look and feel that you want.
When it comes down to it, it's actually pretty simple to import an asset into a game engine like Unreal Engine 4, all you have to do is save it off as an .FBX. Well, that's great and all, but I don't feel like importing one single asset that consists of thousands of polygons into UE4. If your game is only going to have one asset, then yeah, that might be okay, but most games don't. This is where retopologizing comes into play.
This is something I gave a little sigh at, because retopologizing isn't the most fun and exciting process, let's face it. Nevertheless, it still has to be done. Blender has some decent retopology tools that ease the process a little.
The way I retopologized the mesh was first dropping in a plane. Once the plane is placed, I went into Edit Mode and selected all four vertices and deleted them. Then I enabled the Snap During Transform option, and I turned the snap element to Faces, and enabled the "Snap Project" option.
Now when you press Alt+LMB it will place a new vertex, and it should be right on the surface of the high poly mesh. You can continue to extrude the single vertex by pressing "E" on the keyboard. The vertices should snap nicely onto the high res mesh, and in no time, you're in a rhythm that is retopologizing.
However, be wary; constantly think about your topology. I found myself a few times, not thinking about how this particular strip of polygons is going to match up with the others, and ran into a few ngon scenarios.
Depending on your project, you may be able to get a way with a higher resolution game mesh, or it may need to be very conservative. Figure this out early on. The most important thing is using enough resolution to get the basic shape of your high-resolution mesh.
Finally comes the texturing process. Again, this is something that can be a little tedious, especially when uv unwrapping. Luckily, for us, a rock is pretty easy to unwrap. The first thing you'll want to do is mark a seam, you can do this by selecting a single vertex, and then Alt+RMB clicking the next vertex along the edge. This will select the ring of vertices. You'll want to set the seam somewhere where it's not going to be as visible, for instance, what you would consider the backside of the rock.
With the line of vertices selected, go to the toolbar and select Shading/UV. Toward the bottom of the properties you should see the "Mark Seam" option. Click this, and the line of vertices should now turn red. Press Ctrl+A to select the entire mesh, and in the Shading/UV properties press UV and select the Unwrap dropdown, and choose "Unwrap." You should get some decent results with the UV unwrap.
Now that the low res model is unwrapped we need to get the normal map from the high res model. So Select the high res model, and shift select the low res model. Under the Render settings of the properties panel change the bake mode to "Normals" and check the "Selected to Active" check box. Now press Bake.
Viola! You've got a normal map from the high res model. Change the 3D view to the UV Editor, and you should see the normal map there. Select the folder icon and save the normal map out as a .PNG.
There are a couple different ways you can go about texturing the rock. I got a decent 1K rock texture online; you could paint the texture yourself, or if you're in a crunch, skip the texturing all together. Since you've laid out the UV's you can apply one of the many rock materials that Unreal Engine 4 has included, and it should work nicely on the mesh.
If you decide to take my approach, then to apply the texture in Blender you'll need to go to your texture properties in the properties panel, add a new texture. Choose Image or Movie from the "Type" options. Navigate to where you saved the normal map and plug it in.
You'll need to scroll down in the properties until you find Mapping. Change the Coordinates to UV, and under influence check the "Normal" box.
Add another texture and plug in one of the rock textures you found. You can go into the material editor to adjust things like the diffuse intensity, as well as the specular. You can also change things like the Specular material type, right now it's set to Phong, but if you change it to something like Wardlso you'll get a rock that is much shinier, as if its wet.
The final step to take in Blender before you can bring the asset into UE4 is to bake out the various texture maps. To do this, go into the render settings, and scroll down to the Bake options. The first thing we'll want to bake is the texture, so change the Bake Mode to Texture, and run the bake. Once it's completed, go into the UV editor and save the image off. Now you can repeat this process, but this time set the bake mode to Specular Colors, and save that image off as well. Finally we'll do this one more time, and change the Bake Mode to Ambient Occlusion.
Bringing it Into Unreal Engine 4
Export the rock as an .FBX in Blender. Open up UE4 and in the Content Browser import the rock mesh, as well as all the texture maps. Now create a new material, and open up the Material Editor in UE4. Start with the Base Color, which would be the texture you baked from Blender. Select the texture in the Content Browser, and then in the Material editor right click and scroll down to Texture>Texture Sample.
With the texture sample loaded, plug it into the Base Color of the material. Continue this step with the rest of the texture maps. Your Material Editor should resemble the image above.
With the material applied to the rock, we now have a rock asset ready to use for a game. While there certainly is a lot that goes into taking a model from Blender to game ready, once you get more familiar with the process it will get much easier. Even though we used Blender in this article, the same workflow and technique can be transferred into any other 3D application. Be sure to check out the Digital-Tutors library for more in-depth Blender and Unreal Engine 4 tutorials.