This tutorial was written by the amazing Jonathan Benainous and appeared in issue 105 of 3D Artist
In this tutorial, we will see how to make a photorealistic 3D weapon based on the Raging Bull .44 Magnum from Taurus. You will learn how to make a real-time 3D game asset, respecting all the constraints that are associated with the production of current-generation videogames.
We will go more in depth in the use of powerful tools such as Maya, ZBrush, and Substance Painter, and will attempt to highlight tips and tricks that could save you a lot of time in the process. We will cover all the different steps, from the low-poly in Maya, to the high-poly mesh in ZBrush, to the final PBR texture in Substance Painter, passing by the UVs in UVLayout. All the steps are very detailed, but don’t stop trying to push your skillset by studying user guides or by watching other 3D content on the internet.
To get better and better results, it’s crucial to feed your eyes with other 3D work, good references, photos, or by watching your environment everyday. After all, observation is key when it comes to creating realistic 3D art, and we will see how our attention to detail will help us to deliver a render with a very high level of realism.
Step 01 – Find references
First of all, to be as accurate as possible with the original weapon you need to have a lot of references. Look on the internet, and take all images you can find about the chosen weapon, including blueprints, photos and close-up videos. Try to find all the different angles of view to be able to reproduce it in 3D. The more pictures you have, the easier it will be to reproduce the different shapes later on.
It’s a very crucial step in this creation process and the base of your success, so I truly recommend you spend plenty of time on this step before going any further.
Step 02 – Block out the gun
Once in Maya, create planes and use them as a template for your gun. Pick two or three key references, such as a side, a front or a back view and apply them to your planes. Make sure to keep a good size ratio between all your planes and, once again, don’t hesitate to spend time on this step. Start to block out the main shapes, and try to identify the different parts you’ll have to separate. In our example, you can see that the barrel, the handle and the cannon can already be separated. It’s very important to precisely follow your reference and the outline, but also the different lines and curves to achieve a realistic result in the end.
Step 03 – Detail the mesh
Start to refine the model by separating and adding all the smaller pieces, including the rear sight, the front sight, the trigger, the hammer spur, and so on. Finding pictures of the inside of your gun will greatly help you to understand the shapes and how it works, especially for the recoil shield and the hammer. At this stage, if you realise that you need more information to keep detailing your gun, go back to the the first step of this tutorial and keep searching for more references. The less you have to improvise to read the shapes, the better result you’ll get.
Step 04 – Smooth and crease
Once your mesh is detailed enough, it’s time to smooth it. Use the 1, 2 and 3 keys to switch between the different Previsualization modes in the Maya viewport. Don’t hesitate to add Edge Loops and adjust the shapes if necessary. The best technique to keep hard edges and smooth surfaces is to use the Crease tool. To find it, go to the Edit button in the Mesh Tools menu. Once you’ve activated the Crease tool, select all the edges you would like to keep hard, then use the middle mouse button to define the hardness of your edges. In our case, I recommend to use 0 or 1 for the value. We will see in the next steps how to soften these sharp edges in ZBrush.
Step 05 – Smooth in ZBrush
Export all your elements from Maya to ZBrush using GoZ. By using this free plugin, you’ll be able to keep your crease information that was previously assigned in Maya. Once your gun is fully imported, you can start smoothing it using the Divide option present in the Geometry sub-palette in the Tool menu. To have the perfect control on your creased edges, set the Crease level in the Crease sub-palette. Here you have 15 levels available. If you divide your mesh at level 0, the mesh will be smoothed as there is no crease information. If, however, you set the level to 15, edges will stay totally sharp. The technique you’ll need to get nice smoothed bevels is to smooth multiple times at level 15, then set the level back to 0 and divide again to soften the sharp edges and only affect their roundness. With this perfect control between smoothness and hardness, you’ll be able to adjust the way that your edges respond to light perfectly, which is essential for the texturing and render steps.
Step 06 – Dynamesh Sub
Once you’ve smoothed all your SubTools, we’re going to experiment with a technique that I’ve massively used on this project. This method will basically save you a lot of time and give you a perfect result on your mesh. As an example, let’s take a look at the barrel. As you can see on the reference, the shape is really complex, with round elements subtracted from others. In Maya it can become a real nightmare to deal with this sort of topology, so in order to avoid any problems, I’ve decided to tackle this directly in ZBrush using a subtractive approach with DynaMesh.
I created basic primitive shapes in Maya that I’ve positioned at the right place around the barrel. Then I’ve imported them in ZBrush in order to use them as DynaMesh sub elements. To mark them as DynaMesh sub elements, go to the Polygroups sub-palette in the Tool menu. The process is pretty straightforward – simply merge all your elements together and click on Autogroup. Isolate the DynaMesh sub elements and mark them. Then display all the parts and rebuild your DynaMesh using the Cmd/Ctrl key. Note that you need to have the Groups option activated in the DynaMesh parameters to make the DynaMesh sub function works.
Step 07 – Clean and refine
When you’ve finally finished substracting all your different elements, it’s time to clean the little imperfections you may have in your meshes. In order to achieve this, use the hPolish brush to smooth all the pinches and irregularities you might have here and there. If some issues persist, don’t hesitate to DynaMesh the mesh to rebuild your topology. Try not modify your flat surfaces too much, as you’ll want to avoid bump effects. Use the Planar brush to soften these flat surfaces if necessary. Note that at this stage you can still adjust organic shapes, such as the handle, by using the Move brush, for example.
Step 08 – Decimation
To be able to have a good base for your retopology, we need to decimate our current HD mesh to avoid any performance issues later in Maya. To do so, go to ZPlugin>Decimation Master and select one of your SubTools. Click on Pre-process Current. Set the percentage of decimation you want, then click on Decimate Current. Do remember that the decimation process can take quite a bit of time and depends of the complexity of your topology. Be sure that you’re not being too extreme and to preserve all the details that you’ve created. It’s really important to keep a nice, smooth and rounded shape. Save all your decimated SubTools as OBJ files and import them in Maya.
Step 09 – Retopologise in Maya
Once your decimated mesh is in Maya, select one of your pieces that you want to retopologise and click on the last magnet on the right to make your object Live. By activating this option, you’ll have the ability to use it as a guide for your low-poly model. Now, whenever you move vertices, edges or faces, they’ll get automatically snapped to that surface as long as the decimated mesh is marked as Live Object.
Try to keep your topology homogeneous and be careful to preserve the silhouette of your shapes. A planar face or a straight line can be totally optimised but, on the contrary, rounded shapes need to have enough polygons.
Step 10 – UVLayout
Once your low poly is done, merge it and export it as one single OBJ file. On this project I decided to use UVLayout to unwrap my model. The program might not seem particularly user-friendly the first few times that you use it, but once you’ve learnt the basics and the main shortcuts, everything becomes much easier to use.
Let’s see some examples of shortcuts that could be useful, but do bear in mind that in this program, the cursor of your mouse defines what you’re going to interact with. Put your mouse over an edge and use the C key to select it. To unselect it, click on the Backspace key. To cut a selected edge, use the Enter key. Pressing the spacebar and holding the middle mouse button at the same time allows you to move objects. The D key will send your piece to the 2D view/UV view. To display it, press the U key.
All these shortcuts and many more can be found in the User Guide of the UVLayout website – simply head online to this website: www.uvlayout.com/doc/User_Guide:_Hotkeys.
Step 11 – Set up a naming system
Before baking in Painter, let’s take a look at our naming system carefully. In Painter, you have the ability to activate an option called Match. You can then select Always or By Mesh Name. With Always selected, all your separate elements will be baked together. It can be useful, but in our case we will have overlap issues during the projection process and we’ll get errors and artefacts in the Normal map. With By Mesh Name selected, you’ll be able to define which parts are going to be baked together as if they’re isolated. To proceed, you need to strictly set up mesh names by adding a suffix in order to enable Painter to recognise them. In our case, GUN_001_LOW will match with GUN_001_HIGH. Following the same example, if you need to bake multiple HD meshes on one single LP mesh, you’ll find that GUN_001_LOW matches GUN_001_HIGH_Part1, GUN_001_HIGH_Part2 and so on.
Step 12 – Bake in painter
Launch Substance Painter and click on File>New. A New Project window will pop up. Set the Template as ‘pbr-metal-rough-HQ’ and press Select to import your low-poly mesh. Remember that you have to import a single FBX or OBJ file. To keep all your part separated, select all your elements in Maya, and then click on Export Selected. You can also group them in Maya and export the group. Once your mesh is in Painter, it’s time for baking. Click on the Bake Textures button in the TextureSet Settings tab and set the baking window. Don’t forget to import all your high-definition meshes with the correct name and suffix. We will see how to use ID Maps later in the process, so for now, don’t load your floaters in the HD Meshes list and don’t forget to uncheck the checkbox next to ID.
Step 13 – Masks and groups
When working in Substance Painter, it’s really important to stay organised. Your stack of layers in the Layers tab works pretty much like it does in Photoshop, with blending modes and opacity parameters. If you start to accumulate too many layers, you’ll find that you can easily lose control, losing track of which filter is doing what and so on. To avoid this issue, I recommend grouping by material. In our case, we have the rubber of the grip, the steel of the frame, the black metal of the rear sight, and a sort of gold embellishment for the logo. Create a Fill layer and add a black mask on it. Press the 4 key to switch to Properties>Polygon Fill. Then use the different Fill modes to isolate your parts of the mesh. Change the colour of the Fill layer with a distinctive one and repeat the process for all the different materials.
Step 14 – Detail the material
A key to achieving photorealism is to tell a story with your asset. To do so, imagine how the gun could have been used. Maybe the weapon has been forgotten in a granary full of dust, or the owner of the gun lives in the desert, so it could be stained with dirt. It is your call to give a background to this asset and will definitely make all the difference. Now that you’ve masked all your parts, you can start replacing all the different Fill layers with materials – like before, don’t forget to stay close to your reference imagery. For the metal of the barrel, I mixed different materials together by changing their opacity. Adding Smart Masks for certain areas, such as the gun’s edges, can be a very good way to break the regularity and to create a certain level of wear and tear damage on the borders. Proceed the same way for the other types of materials until you get some kind of uniformity and consistency between all the parts.
Step 15 – Micro detail pass
Once you’re satisfied with your base material, it’s time to add another extra detail pass. This time, these details will be mostly visible in close up, but they will also add a lot of little snippets of visual information that will increase the overall realism of your picture. Create a new Fill Layer and add a black mask. Now go to the Alphas shelf and select the Greyscale Fingerprint map. Go back to your mask and stamp them in logical places. Try to stay realistic with the orientation and aim to be consistent in the size of the different fingerprints. Obviously don’t forget to make them match with the ratio of your weapon. Select your Fill layer and remove the Color and the Normal channel. What we want here is just to add some variation in the Roughness and the Metalness. Tweak the intensity until you get the desired effect. Around the barrel, you can add a black powder effect by masking out the faces of your mesh that you want to darken, then applying a Smart Mask on an almost black Fill Layer.
Step 16 – ID maps and floaters
To use the floaters that you’ve created in Maya, go back to the Substance baking window and add your meshes in the High Definition Meshes list following the correct naming system we covered earlier. This time, only check the ID checkbox. Don’t forget to go to the ID Baker parameters and select Mesh ID for the Color Source and Random for the Color Generator. Now that you’ve got your ID map, let’s learn how to use it. Create a Fill layer, Ctrl/right-click on it and add a mask with colour selection. Now if you select your mask, a new colour selection line will appear in your layers. Click on it to display the properties. The Output Value allows you to set the opacity of the black-and-white mask. Adjust Hardness and Tolerance to tweak your selection. Next, pick Color to select a colour in your ID map. Once you’ve set your mask properly, go back to your Fill layer to adjust the colour, height, Roughness, Metalness and the NRM parameters. Proceed the same way with the rest.
Step 17 – Create your own alpha map
If you look at the reference, you can see that the Taurus Raging Bull .44 Magnum has very specific elements carved on the rear sight. To add these little details, go to Photoshop and create a 1,024-pixel square document. Fill it in black, then use the Text tool to create letters. Make the two arrows using the Rectangular and Elliptical Marquee tool. Then export the four Alpha maps as PNGs. In Substance Painter, you just need to drag and drop your files in the Alphas shelf to specify a location on your computer and add them to your library. Now create a new Fill Layer, add a black mask, select one of your custom Alpha maps, go to Paint>Properties, set the Greyscale value to pure white, adjust your viewport and finally stamp your Alpha directly in your 3D view. You can also use the 2D view if you feel more comfortable. In Fill>Properties, tweak the Height map value to have a nice, carved effect. For the specific pattern of the grip, I used Substance Designer to make a custom Height map. Once in Substance Painter, I just used the map in combination with a Fill layer and mask to have a similar bump effect.
Step 18 – Import in Marmoset
Now that your textures are finished, go to File>Export Textures. Set the path to the desired folder, the file format, choose 4096×4096 for the Document Size and click on Export. In Marmoset, import your mesh by pressing Ctrl+B, and create a New Material by pressing Ctrl+M. In the Surface slot, load your Normal map. Painter uses OpenGL, so don’t forget to click on Flip Y in Marmoset to have the correct result. In the Microsurface slot, load your Roughness map. Once again, don’t forget to check the Invert checkbox. To load your Metallic map, go to the Reflectivity slot and switch it from Specular to Metalness. Set the reflection to GGX instead of Blinn-Phong, then load your Albedo and ambient occlusion. Apply your material by dragging and dropping the material sphere directly onto your asset.
Step 19 – Light and render in Marmoset
Now that your scene is set properly, go to Scene>Sky Browser and select an environment to suit your gun. For mine, I used Indoor Fluorescents to have a sort of studio-lit effect and a soft balance between colours. You can also use a flat colour as a background, or a very neat environment – it’s totally up to you. In our case, I changed Mode to Blurred Sky and I set the Backdrop Blur to 0.1. Note that you can use the Shift key in conjunction with a mouse click in order to rotate the Environment map and change the direction of your lighting. In the Light Editor, add lights by clicking directly on the Sky map. Don’t forget to check Cast Shadows and Contact Refinement for a better result. I recommend that you start by choosing a good camera angle before adding new lights. This is because you can highlight all the details much more easily, adding rim lights and so on. In the Lighting tab in Render, it’s important that you don’t forget to check Local Reflections, Ambient Occlusion, High-Res Shadows and Front-Face Shadows to get the best quality. Add the final touches by adding post effects into your Camera options, such as Bloom, Vignette, Depth Of Field and Chromatic Aberration.