Making and Preparing a Rock Arch for a Game Engine: Part One
Hello, this is a tutorial about making a rock arch and then preparing the model for use in game engine. It's simple and fast and shows only the basics. Please note that this tutorial is not for beginners. You will need to have some knowledge of polygon modeling, making the UVs of a model, importing/exporting operations. You'll also need to be familiar with ZBrush with Photoshop too.
So let's begin!
First make the sample foundation of the arch in 3ds Max and then import the model to ZBrush as an obj. file (Fig.01).
Divide the object several times with Tool > Geometry (Fig.02 - 02a). The object is now well divided and we have enough polys to start sculpting.
First choose the Move brush from the brush menu and then start tweaking the mesh (Fig.03 - 03a).
Then choose the Clay tubes brush and start adding forms to the mesh (Fig.04). You can play here as much as you want. The problem is that the results always look cool and you can spend days messing around. That's the problem of ZBrush; once you've started, you can't leave it alone!
So, decide what exactly you want and the result should look like Fig.05.
It's now time to add some details on the base pattern of the rock. In this case I am choosing the Crumple brush. Use this brush sensibly because if you sculpt a couple of times in one place then you can get bad results with the polygons below. Then this result will appear in your normal map. So to avoid these poly stretches, use the brush easily (Fig.06 - b).
Ok now you can leave your model as it is; it looks good and I've achieved very nice looking results in a game engine by only using these two brushes. But in this case I am going to use the noise feature in ZBrush. Go to the Tool menu and open the Surface tab. Check the noise button, increase the noise scale and decrease the noise strength. Then you can play with the noise curve and you will see the changes on the mesh. When you like the result click the Apply to Mesh button. Too much noise can destroy the form of the object so be careful (Fig.07 - a).
I've made a quick video of the process to this point. You can see it at my YouTube channel: https://www.youtube.com/user/manjurian
Now it's time to export your model to 3ds Max, or whatever is your favorite app. If you think that the model is too high poly and Max can't handle it use Decimation Master - it's a plugin to decrease the mesh poly count in ZBrush 3.5R2 and above. The plugin is great and works very smartly; it keeps maximum detail on the mesh, but decreases the polygons. Go to the Zplugin menu and open the Decimation Master tab (Fig.08) Click on Pre-process Current, wait a bit depending on your mesh poly count and then click on Decimate Current. The mesh will then be ready and you can export it from the Tool menu (Fig.08a).
Now we are in 3ds Max. Import the model, wait a bit - it's high poly you know! - and you will see it in viewport (Fig.09). Now I am using the Pro Optimizer tool to make my low poly model, which is available in 3ds Max 2009 via the Creativity Extension. If you don't have the tools or if you are using a different app then you can use the Polygon Cruncher stand alone. You can find a video of how to use it at Eat3d's site: http://eat3d.com/. Beside the other great videos that they sell there, there is a free section and you can find the video there.
Ok, so we are in Max now and your mesh is here. From the drop down menu find the Pro Optimizer (Fig.09a). Click on Calculate and wait. Then enter the amount of vertexes that you want your mesh to be in the Vertex Count field. Something around 700-1000 will be ok. Your end result with Pro Optimizer should look like Fig.09b.
By the way, this is the quickest method to make a low poly version of your model, but is not the exactly right method. It works fine - I have used it in three games so far - but it depends on your game company. Also it is not good for characters where the animator will need good topology on the mesh. It is good for rocks, cliffs etc., but your developer or the engine that you use may not like it and you will have to make a nice, clean and topologically correct mesh for low poly version. There are many ways to do that with ZBrush retopology tools, applications like Topogun - I recommend that - with 3ds Max 2010, graphite tools etc. Anyway it's just something to bear in mind.
Back to the tutorial and it's time to make your UVs. I won't explain how to make them - the process is easy with the Max Pelt option. You can use whatever app you want for that. I'm going to the bake the normal map part directly. You have the low poly mesh with UVs now. Load your high poly mesh again. They have to be like it the ones shown in Fig.10. Then, in your Max modifier list, choose the Projection modifier. Pick your high polygon mesh. Check Shaded in the Display section and then increase the amount in the Push section. You can see the cage around the mesh; you want to increase the amount enough to avoid intersection with the mesh and that's why Shaded is checked.
Now with your low poly model selected open the Render To Texture panel and press 0 on the keyboard. Here check Enable in the Projection mapping section, add your normal map and set the resolution - 2k in my case (Fig.11). Press Render and your normal map is ready. You can delete the high poly mesh now; you don't need it anymore. Save your scene and export the low poly model that has UVs.
Now it's time to go back to ZBrush for some textures. In ZBrush, load your model of the arch and open the SubTool tab. Click the Append button and choose PolyMesh3d (Fig.12). Select the Polymesh subtool and from the Tool palette, click Import. Find your low poly model now with the UVs. You can see how the star-like object will be replaced with the low poly model (Fig.12a).
Divide the new mesh a couple of times and then press the ProjectAll button that is at the bottom of the subtool menu. That should project all the details from the old mesh onto the new one that has the UVs (Fig.13). Then you can delete the old mesh if you want or hide it.
Now let's paint. Go to Tool > Polypaint and click Colorize (Fig.14a). In the Color menu choose a color of your choice and click Fill Object (Fig.14b). This will add a base color to your object (Fig.14c). Change the stroke to Spray, go Brush > Auto masking and enable CavityMask (Fig.14d - e). Chose a color and start painting. You will see how your base color will remain under your paint as nice details. That is because CavityMask is enabled. You can play with the cavity options and cavity mask curve to see the differences. With more complex geometry you get more details thanks to cavity. You can get very nice results here and make very detailed texture. At the end your model should look like this (Fig.14f).
Ok now go to the Texture Map panel and you will see several options here. For now you need to go to Polypaint > New. Click it and the texture will appear here (Fig.15).Then click Clone Texture. Go to the Texture menu and you will see your texture there. Click export and save the file (Fig.15a).
Go to Tool > Masking. You have many options here too, but you need the Occlusion intensity slider and the Mask Ambient Occlusion button. Get the slider to 5-6.5 or so. Higher values take a longer time to compute but give deeper occlusion. Wait a bit and then press Mask Ambient Occlusion and you should see what is shown in Fig.15b. Go back to the Texture Map tab and this time click Masking > New (Fig.15c). Repeat the steps again, clone your map then go to the Texture tab and export it. In Masking Tab there is a Mask by Cavity option. You can press it and generate a cavity mask. Then go back to Texture Map > Masking > New and you can get a nice cavity mask too beside the occlusion one. But this is an option you should only use if you want more details in your texture after combining all maps in Photoshop.
Well the maps are ready now and you can combine them in Photoshop. Separate them from the background first, then use the color map as foundation and the occlusion map on top of it but, with Multiply set as the layer mode. If it is too dark then reduce the opacity a bit. Also as the layers are set on multiply then you can add the cavity map here if you have one. I also added a real stone texture but with lower intensity to enhance the map details. Finally you should have something similar to Fig.16. This image also shows the normal map previously generated in 3ds Max and a render of the model in Max with the normal and texture maps assigned.