Creating Weapons for Games

Part 1: Highpoly and Lowpoly Modeling

You need to subscribe ONLY ONCE to
get accress to all project files on 3dgladiator.com

What this is all about

In this breakdown we will look at how to build a game-res version of the famous Artillery Luger Pistol. This project was made in collaboration with the amazing Aleksandr Bobrishev. Aleksandr was responsible for creating the model, maps and textures. I highly recommend that you to visit his Artstation portfolio.

Before we dive into the creation process, I will quickly outline the project requirements.

Project Guidelines:

The goal is to build a highly detailed replication of the Luger that was manufactured in Germany between 1898 and 1948. The model, maps and textures must match the requirements of next-gen game engines. Movable elements like the magazine, stock and knife must be detachable from the gun.

Software used:

Autodesk Maya, Marvelous Designer, ZBrush, UVLayout, Marmoset Toolbag, Faogen, Substance Painter, Knald and Photoshop

The workflow includes the following steps:

  • subdivision modeling in Maya to build the highpoly model
  • cloth simulation in Marvelous Designer to create the strap that wraps the holster to the stock
  • adding stitches and surface details in ZBrush
  • retopologizing the highpoly mesh in Maya
  • UV unwrapping of the lowpoly model in UVLayout and Maya
  • map baking in Marmoset Toolbag to transfer the details from highpoly to lowpoly mesh
  • additional surface detailing and texture painting in Substance Painter
  • assembling of all parts for presentation in Marmoset Toolbag

The download package contains the following project files:

All project files are available for FREE, so you can study the setup and apply the same strategies to your pipeline.

In the package you will find:

  • Maya scenes of the highpoly and lowpoly gun model; Maya version 2018 is required to open them,
  • a FBX file of the unwrapped lowpoly weapon,
  • a Marvelous Designer scene containing the straps for the holster, version 7.5 is required
  • a ZBrush tool with the detailed stock and holster, at least ZBrush 2018 must be installed on your computer,
  • a Marmoset Toolbag scene set up for map baking, release 3.06 is required to load the file,
  • all maps necessary for texture painting in Substance Painter saved as PSD,
  • two Substance Painter files, one with the setup for adding additional height details to the gun and one with the actual textures for gun and stock, Substance Painter version 2018.3.3 or later is required,
  • and last but not least, a Marmoset Toolbag scene that contains the final gun for presentation with maps and textures.

After subscribing to my newsletter, which can be done at the top of the page, I will send you an email with the download link. If you are already subscribed to 3DGladiator, please check your inbox, as I’ll have already sent you the email.

Read this before you proceed:

The following breakdown describes how to combine a wide variety of tools to get the job done. Some of you are probably wondering if this effort is absolutely necessary and if it really cannot be done using only one program. The answer is both Yes and No.

The game assets creation process can be quite complex. The goal here is to build a model that looks detailed and realistic while taking the limited resources provided by a game engine into consideration. As such, it is necessary that the weapon not only looks great but meets several technical requirements as well.

Of course, many tasks can be done in one application, but the more experienced you become, the more you strive to get the best use out of every tool available. Under these circumstances it can be beneficial to own and know how to use different software to create good results in a short amount of time.

Subdivision Modeling in Maya Subdivision Modeling in Maya

Before we cover some general advice on how to set up the Maya scene, I want to point out that it doesn’t matter what tool you use for subdivision modeling. Although it is true that every software has its strengths, when it comes to classic subdivision modeling, the approach and the results are pretty much equal across the field. The screenshot below shows the same, subdivided mesh created in Maya, ZBrush and 3DSMax.

Use whatever you feel most comfortable working with to create the highpoly model!

When you model the highpoly mesh, anything is allowed as long as the subdivided geometry looks smooth. Usually, it’s not worth wasting time to search for the perfect edge flow. There is also no need to aim for a mesh that entirely consists of quads. Triangles and N-gons are perfectly fine.

You only need to be more precise with the structure, if you plan to create the lowpoly mesh out of the highpoly model later on. In this case it’s not a good idea to apply a Boolean operation to an already subdivided mesh, as this breaks the object’s history and doesn’t allow you to reuse the basemesh if you haven’t stored a copy of it before.

Before you start modeling in Maya, set the working units to centimeter, enable AutoSave and choose a different AutoSave directory if you want to save these files in a separate location. Activate Backface Culling in the shading menu.

Placing reference images with transparent backgrounds in the viewport requires some additional steps. In Photoshop, separate the object from the background and save it as a PNG. You can than switch to any orthogonal viewport in Maya, select View/Image Plane and import the image. Move the image planes to a separate folder so you can turn their visibility on and off.

Using reference images in the viewport makes it necessary to adjust the transparency of the 3d objects during modeling. The quickest way to do this is by opening the script editor and copy/paste the following line:

setAttr “lambert1.transparency” -type double3 0.6 0.6 0.6 ;

Select the code and drag and drop it to the shelf as a MEL script. Right click on the icon and select Open to open the Shelf Editor. Under Icon Label type something like 50%. To set the transparency to zero again, repeat the previous steps with the following line of code:

setAttr “lambert1.transparency” -type double3 0 0 0 ;

As already mentioned, modeling can be a straightforward and fun process when you don’t have to worry about crafting the perfect mesh. Boolean operations can be your best friend when it comes to creating complex shapes. Take a look at this forum post on polycount.com to get an idea of what can be achieved with them.

After subtracting or combining objects, hit the 3 key on your keyboard from time to time to check how the geometry deforms. Rearrange edges with the modeling toolkit to achieve clean results.

The downside of Boolean operations is that you end up with surfaces that are difficult to subdivide without further editing. In the clip below I show you two new Maya commands that help solving this issue; polyRemesh and polyRetopo.

polyRemesh; breaks non-triangular faces into triangles. You can even tweak the Boolean operators after applying the function. By running the polyRetopo; command, you can quickly retopologize the triangulated mesh and turn it into quads. Both commands become super handy when dealing with meshes that result from Boolean operations.

polyRemesh and polyRetopo in action

When talking about Boolean operations, it’s also worth taking a look at the HardMesh plugin. It provides you with some additional functions and adds smooth transitions between the operands.

The leather strip that wraps the holster to the stock was simulated in Marvelous Designer. The stock was imported as an avatar. The strips are represented by simple rectangular patterns drawn in the 2D viewport. All you must do is fix the ends of the strips to the avatar.

When you hit the spacebar to start the simulation, you can double click on the stock to activate the transformation gizmo and slowly rotate the model. The patterns follow the avatar and wrap around it in real time. When you are happy with the result, change the mesh type to quads and export the strip.

Before we move one to detailing the weapon in ZBrush, I use the polyRemesh function again on components that where created with Boolean operations. The complexity of these meshes tend to cause issues when being imported in ZBrush.

In the bottom left corner of the next screenshot you can see that ZBrush is not able to handle faces that share a lot of vertices. You can solve these issues by rebuilding the surface with the polyRemesh command.

In ZBrush, you have several options for dealing with imported meshes. You can either turn them into Dynameshes or use Sculptris Pro that was introduced in version 4R8 to dynamically subdivide the imported geometry. For minor adjustments I prefer to stick with Sculptris as it only affects areas where I apply a brush stroke.

This way, you can easily fix surface bumps or wear of the edges without turning the entire model into a dense Dynamesh. Sculptris can be activated in the stroke palette.

The stitches were created by turning a 3D primitive into an InsertMesh brush that gets applied to a framed mesh border. Let me explain how this works step by step:

  • 1. Draw a 3D primitive ring on the canvas and enter the edit mode. Before you turn it into a PolyMesh3D, open the tool palette, scroll down to Initialize and adjust settings like the radius or the resolution.
  • 2. Convert the ring into a PolyMesh3D, hide the bottom part and select DelHidden in the geometry sub-palette. Activate symmetry and slightly deform the mesh with the move brush.
  • 3. Position the model on the canvas so that you look at it from above. Open the brush palette, go to the Create sub-palette and select Create InsertMesh. Choose New in the dialog box. It’s important that you position the geometry correctly before you turn it into an InsertMesh, as the position of the tool is noted when you turn it into a brush.
  • 4. With the InsertMesh tool still selected, go to the Stroke palette and activate Curve Mode. This is necessary because we want the InsertMesh to follow the curve created in the next steps.
  • 5. Now take the mesh you want to add the stitches to and assign different polygroups. This can be done by isolating parts that should share the same group and click Group Visible in the Polygroups sub-palette.
  • 6. Next, CTRL+Shift click on a polygroup to isolate it, go the Stroke palette again and choose Frame Mesh. Make sure Border is checked. ZBrush now frames the polygroup with a curve. Unhide all parts again.
  • 7. To add the stitches, all you must do now is select the previously created InsertMesh brush and click on the curve. As long as the curve is live, you can change the size of the stitches by adjusting the draw size of the red cursor and clicking on the curve again. A smaller curser results in smaller stitches and vice versa. In case the stitches are floating above the mesh, open the brush palette and search for the Depth sub-palette. Adjust the Imbed value or move the little circle up and down and click on the still active curve to apply the adjustments.
  • 8. Once you are happy with the result, go to the stroke palette one more time and hit Delete to get rid of the curve. The stitches come in their own polygroup, so you can easily select them and split them into a separate subtool.

As I’m going to use the highpoly model from ZBrush for baking maps later one, I assign different colors to individual parts before I export the mesh as an FBX. This allows me to bake a Material ID map in Marmoset Toolbag based on the vertex colors.

The ID map makes it possible to mask parts of the mesh through colors in Substance Painter. The stitches get their own RGB value for instance, so I can select them via the ID map and apply an appropriate texture.

Retopologizing the highpoly model: Retopologizing the highpoly model:

The idea behind retopologizing a mesh is to create a lowpoly version that represents the highpoly model as efficiently as possible while using as few geometry as possible. I personally always try to complete this rather technical step fast and straightforward by using different tools and techniques.

Depending on the shape of the highpoly model and the way it was built, you have several options:

If you are dealing with a clean subdivision model where the subdivision levels are still intact, you can start with the basemesh and proceed from there. Remove edge loops and bevels and simplify elements that can be represented by the normal map.

Let’s look at the component from the very beginning of this tutorial. I’ve closed the holes as we can just stick the bolts into the surface. I then remove any additional loops that were created by beveling the edges. I’ve also made sure that the geometry consists exclusively of four-sided polygons and triangles.

It doesn’t matter where you place the quads as we will triangulate all parts before exporting.

If you have shapes that were generated through Boolean operations, you can make use of the previously described polyRemesh; and polyRetopo; again. After completing the Boolean operations, use the polyRemesh; command to let Maya reconstruct the model with triangles. Then type polyRetopo; in the command line to turn the surface into a mesh consisting of quads.

If the object is symmetrical, mirror one half and weld the vertices with the merge function.

The fastest way to retopologize organic surfaces is to use the quad draw tool in Maya. For the leather parts of the stock, just import a decimated lowres version from ZBrush, select the object and make it live. Then switch to the quad draw tool and start drawing polygons on top of the live surface.

An alternative way to retopo highpoly models is to build the lowpoly mesh with simple primitives on top of it. For instance, the barrel can be represented by a simpl cylinder. Roughly place a cylinder over it, make the barrel object live, select the vertices of the primitive shape and move them slightly, so they snap to the underlying surface. Now extrude the edges further until you end up with a lowres cage on top of the highres model.

That’s it for part 1 of this tutorial. In PART 2 I will show you how to unwrap the lowpoly gun and what a good UV layout looks like. We will also look at how to bake maps in Marmoset Toolbag and prepare the model for texturing in Substance Painter.


Ben | 3D Gladiator