ZBrush 4 Sculpting: Preparing the Creature for Games

Exclusive offer: get 50% off this eBook here
ZBrush 4 Sculpting for Games: Beginner's Guide

ZBrush 4 Sculpting for Games: Beginner's Guide — Save 50%

Sculpt machines, environments, and creatures for your game development projects

$26.99    $13.50
by Manuel Scherer | March 2011 | Beginner's Guides

Since ZBrush was released, it dramatically changed the way game art is created. It is unmatched in its speed for creating highly detailed models and thus, is widely used in the games and film industry. We could even say that if you want to be a game artist today, ZBrush is considered a standard. A few years ago, ZBrush was used only for organic modeling. With ZBrush 4.0 this changed dramatically and you can now sculpt mechanical spaceships as well as organic creatures.

In this article by Manuel Scherer, author of ZBrush 4 Sculpting for Games: Beginner's Guide, we'll cover the following topics in detail:

  • Building a low-poly in-game mesh with retopologize
  • Projecting the details onto our new topology
  • Fixing potential errors that may pop up
  • Extending ZBrush's capabilities with plug-ins
  • Unwrapping our mesh with UV Master


ZBrush 4 Sculpting for Games: Beginner's Guide

ZBrush 4 Sculpting for Games: Beginner's Guide

Sculpt machines, environments, and creatures for your game development projects

        Read more about this book      

(For more resources on the subject, see here.)

You can download the finished creature by clicking here.

Retopologizing for games

Okay, we've got our high-poly mesh ready. But in order to bring it into a game engine, we need to build a low-polygon mesh from it. Because we used ZSketch in the beginning, we now create the low-poly mesh at the end of the process. This step is called retopologizing, or in most cases just retopo, because it creates a mesh with a new topology and projects the details from the high-poly onto it. In this way, we end up with a mesh with a clean and optimized topology and all of the high resolution details that we sculpted in earlier.

This process can also be done in other major 3D applications such as Blender, 3ds Max, and so on. Honestly, I would prefer the retopologizing in Blender over that of ZBrush, as I find it a bit more robust. Nonetheless, the results are the same. So let's see how we can do this in ZBrush

Before retopologizing, we should be clear about these points:

  • Polycount: Think of how many polygons the character should have; this always seems tricky, but after some time you get used to it. Ask yourself how many polygons your platform and engine can handle for a character and how big will it be seen onscreen. Let's say our Brute will be used on a PC and console title, he's a few meters high and is visible fullscreen. So we're heading roughly for something around 5000 polygons. This is a very rough estimate and if we need less polygons for it, that's fine too. The fewer the better.
  • Animation: How will the character be animated? If there's elaborate facial animation going on, the character should have enough polygons in his face, so the animator can move something. Ideally, the polygon-flow supports the animation.
  • Quads: Always try to establish as many quads as possible. Sometimes, we just need to add triangles, but try to go for quads wherever you can.

With these three points in mind, let's start retopologizing

Time for action – creating an in-game mesh with retopologize

  1. First, lower the subdivision levels of all the subtools to get increased performance.
  2. Append a ZSphere as a subtool and make it the active one.
  3. Name it something meaningful like Retopo.
  4. Activate Transparency and place the ZSphere inside the mesh so that it is hidden, as shown in the next screenshot. Appending a ZSphere to the model gives us the advantage to easily hide subtools or adjust their subdivision level as we need it:

  5. Deactivate Transparency and go to Tool Topology| and click on Edit Topology.
  6. Activate Symmetry.
  7. Pick the SkinShade4 material and choose a darker color, so that we can see the orange lines of the retopologizing better. The SkinShade4 material offers very low contrast, which is what we need here.
  8. Begin drawing edges by left-clicking on the mesh. They will automatically snap to the underlying high-poly surface. Start out by laying in two circles around the eyes, as explained in the next image

    Retopologize commands
    When in retopologize mode, left-clicking adds a new vertex and an edge connecting it to the last selected vertex. If we want to start out from a different vertex, we can select a new starting point by Ctrl + left-clicking. Deleting points can be done by Alt + left-clicking. When you miss the point you wanted to delete, the last selected one gets deleted instead, so be careful about that.

ZBrush 4 Sculpting for Games: Beginner's Guide Sculpt machines, environments, and creatures for your game development projects
Published: March 2011
eBook Price: $26.99
Book Price: $44.99
See more
Select your format and quantity:
        Read more about this book      

(For more resources on the subject, see here.)

  1. Continue spreading new points over the head, as shown in the next screenshot. Try to place the points so that they capture the underlying form well:

  2. When adding the horns, start with a circle around their origin and then work your way up to the tip, as shown in the next screenshot. You may need eight vertices for the base, but only four at the tip, so you can simply join two lines on their way up:

  3. Spread the net around the neck, the shoulders, and the torso, as shown in the next screenshot. At the shoulder joint, we should add at least two edge loops, so the mesh can deform better in that area when animated. The same counts for other joints, such as the elbow-, wrist-, and knee-joint:

  4. The hands may seem a bit tricky at first, but when you've got one finger down, it goes quite quickly for the others. The main question is how many sides the fingers should have. In this case, choose six sides, which is quite detailed for a finger and allows each to be fairly rounded. As shown in the next screenshot, at every joint, there's one edge loop for animation:

  5. Don't forget to save regularly.
  6. When working in retopologizing mode, for some reason, the navigation area gets ignored. To still be able to zoom when the model fills the whole screen, we can zoom out our canvas and use the gray border area to navigate. This is located under Zoom Zoom| or directly in the shelf.

  7. Finish the lower part of the body and the belt, using the same techniques and procedures described earlier.

  8. That's it, we just retopologized our mesh, which would now look like this:

What just happened?

We've just learned how to create a low-poly mesh from a high-poly one in ZBrush using retopologize.

Polycount

The Brute ended up as a low-poly mesh that has 2618 polygons and 2256 points. Beware! ZBrush counts a quad as well as a triangle as one polygon. But game meshes always get triangulated when exported to a game engine. So what we need to know is the triangle count, which is 4495, roughly twice the vertex count. Luckily, this is below 5000 polygons, and exactly what we were heading for. You can find out the exact value by exporting it to an application like Blender and then triangulating it. Nonetheless, doubling the point-count should be sufficient for rough estimates.

At this point, we could already unwrap the low-poly and bake a normal map from the highpoly one in other applications. In most cases, this simply works by putting both meshes in the same location and lets the computer try to match areas from the high- and the low-poly to create a normal map. In ZBrush, this takes one more step, but gives us more control over the result. We'll subdivide the low-polygon mesh and project the high-polygon details onto it, so we have a mesh with clean topology and all the details in one. Because this is then one mesh only, ZBrush already knows which high-poly details belong to which low-poly-vertex, so we get a cleaner normal map from it. Let's try that out.

Time for action – projecting the details onto the new mesh

Let's project all the details from the high-poly mesh onto our new low-poly one:

  1. Select your retopologized mesh, making it the active subtool.
  2. Projection can be done only with polygon meshes, not with ZSpheres, so we have to create an adaptive skin from it first. Go to Tool | Adaptive Skin and click on Make Adaptive Skin with the Density set to 1. This will add a new tool of the mesh named Skin_nameofthesubtool
  3. Append this subtool to your high-polygon mesh, so your list of subtools looks similar to this

  4. Turn off Smt and divide two times.
  5. Turn Smt back on and divide a few times until you reach a reasonable polygon count of a few million polygons
  6. Store a morph target by navigating to Tool | Morph Target and click on StoreMT
  7. Hide the Retopo-ZSphere-SubTool, leaving only the high-poly meshes and the lowpoly one visible.
  8. Projecting details from one mesh to another works only on meshes with the eye icon turned on in the SubTool list. If it's too heavy for your machine to handle all high-polygon meshes at once, there's a little trick: We can enter Solo mode, hiding all the other subtools, regardless of whether their visibility is turned on or off in the SubTool list. In this way, the high-poly meshes are hidden, but the projection will still work. We can enter Solo mode by navigating to Transform and clicking on Solo, which can also be found in the shelf
  9. It's always a good idea to save before starting an intensive calculation, like a projection.
  10. With a morph target stored and the tool saved, go to Tool | SubTool and click on the ProjectAll button with the default settings. Depending on your hardware, this may take a few minutes, so this is the perfect moment to get yourself another cup of coffee!
  11. The projection did a quite decent job with only some small areas that we have to fix by hand now:

  12. Now, simply pick the Morph brush and erase the errors.
  13. Exit Solo mode, otherwise the ZProject brush won't work
  14. Turn off symmetry or the ZProject brush will project one side onto another, which can really mess things up.
  15. Then pick the ZProject brush, turn on Zadd, set the Intensity, and reproject the missing details by hand. Pressing Alt will invert the direction of the projection. You get the best results if you project an area and then go over it again with Alt pressed. In this way, everything below gets pulled and everything above gets pushed into place. If this goes wrong, we can always pick the morph brush and start all over again

What just happened?

That's it! We just projected all the details onto our new topology.

Another way of doing this is to project the details with ProjectAll, one subdivision level at a time. Although, this is a little bit more accurate, it is also a bit more time-consuming. The choice is up to you

When we divided our low-poly mesh, we had to make sure that Smt is turned off, so the form stays as it is. Because the low-poly was created exactly on the surface of the high-poly one, smoothing it would result in a form that matches the high-poly less.

If you like, you could also do the whole projection by hand by using the ZProject brush. For a plane this could be easier, but the more complex the mesh gets, the faster it is to use the projection function.

The ZProject brush will always project from the viewing angle. The more the mesh points away from the camera, the worse the brush will work because it can't look around edges. So, try to project details on faces that roughly point into the camera.

You will also note that the new projection can have fewer polygons, but still have the same amount of detail in it. This comes from the more optimized polygon placement, which we did when retopologizing. In my case, the retopologized version has only a quarter of the polygons of the high-poly mesh with the same amount of detail.

Extending ZBrush with plug-ins: UV-Master

Okay, the last thing that holds us from baking a normal map, are the missing UV-coordinates. We could, of course, do that in an external application, but we can also use the new plug-in: UV-Master. Let's see how this can be done.

We can browse and download plug-ins for ZBrush on www.pixologic.com. Once downloaded, plug-ins are installed by putting the downloaded files into the right folder of ZBrush. If successfully installed, the new plug-in will then be listed under Zplugin after the next restart of ZBrush.

ZBrush 4 Sculpting for Games: Beginner's Guide Sculpt machines, environments, and creatures for your game development projects
Published: March 2011
eBook Price: $26.99
Book Price: $44.99
See more
Select your format and quantity:
        Read more about this book      

(For more resources on the subject, see here.)

Time for action – unwrapping the creature with UV Master

UV Master produces decent UV-layouts for organic meshes in a very short time. It is a good starting point and you can still tweak the result in another application, if you like to.

For a quick UV-layout, follow these steps:

  1. Go to http://www.pixologic.com/ZBrush/downloadcenter/Zplugins/ and download UV Master for ZBrush.
  2. Extract it and put its contents, the UVMaster_4.0.zsc and the UVMasterData_4.0-folder, into your installation path: \ZBrush 4.0\ ZStartup\ZPlugs folder.
  3. Restart ZBrush.
  4. Open your new mesh with optimized topology and all the transferred details.
  5. Switch to the lowest level of subdivision.
  6. Open the Zplugin palette in a tray and expand the UV Master subpalette.
  7. Go to Zplugin | UV Master and click on the Work On Clone button.
  8. Go to Zplugin | UV Master and click on the Unwrap button, which will automatically unwrap your model
  9. Navigate to Zplugin | UV Master and click on the CheckSeams button to see where ZBrush cuts the model, as shown in the next screenshot:

  10. Alternatively, you can go to Zplugin | UV Master and click on the Flatten button to see the UV-coordinates as in other 3D programs. Pressing Unflatten will get you the model back. The following screenshot shows the flattened model with some annotations to make it more clear:

  11. When you're done with unwrapping, navigate to Zplugin | UV Master and click on the Copy Uvs button.
  12. Switch from your clone to the original mesh and go to Zplugin | UV Master and click on the Paste Uvs button, which will transfer the created UV-coordinates from the clone to the original mesh.
  13. Now that we have UV-coordinates, we can bake a normal map like we did with the drone.

What just happened?

We just created UV-coordinates for our mesh with only a few clicks. Let's talk a bit about what we did.

First, we chose to work on a clone, which is better, because it has no polypaint, subdivision levels, and other attributes that could bother us when creating a UV map

Fine control with control painting

Pressing Unwrap created a UV map for us in one click. This could be called a quick and dirty method, but it's fast. If we want more control, we can enable Zplugin | UV Master|Enable Control Painting. With control painting, we can attract seams or protect areas– like the face– from being cut. Just click on the Attract button and paint faces where you would like the seams to appear. You must have a brush selected that can actually apply paint, like the Standard brush. A good area for attracting seams could be in-between the legs, where the seam is hidden. Clicking Protect allows us to protect areas from being cut, for example, the face. Although this allows for better control, it's still a tradeoff. Painting attractive and protected areas will not guarantee that the algorithm will follow, but it's still much faster than cutting edges exactly by hand.

The middle way—attract by ambient occlusion

A nice semi-automated way of creating UV Coordinates is the Zplugin | UV Master | AttractByAmbientOcclusion button, which will add attract painting based on ambient occlusion. This already gives some decent results for our character, which we can then finetune with control painting.

Seams, what seams?

So why are we having seams anyway? Imagine peeling an orange—what would you do if you had to lay out the peel flat on a table?

As the orange represents a closed volume, you would have to cut it in order to make it flat. Now the question arises, how can you flatten an orange with as few cuts as possible, which is the first problem.

This also involves the stretching problem because no part of the orange's peel is really flat. So you have to press it down and squeeze it, the same goes for UV-layouts.

The third problem is painting. Imagine you had to paint a checker pattern on the laid out peel of the orange. If you form a sphere from it again, along the cuts, the pattern probably won't match. That's why fewer seams make painting in a 2D application easier.

So let's apply our orange-knowledge to 3D:

In general, it's better to have fewer seams. But fewer seams means more waste of space. A UV Layout that uses space most efficiently would lay out every single polygon as a separate island, but no one would be able to recognize or even paint anything inside of this map. So we have to find a middle way. Try to place seams where they can't be seen, for example, the armpits, between the fingers, the inner sides of the legs, and so on. If the character's wearing armor, this border would also do great as a seam.

The UV-layout that you need depends on the way you or your company work. If you sculpt and texture everything in ZBrush, you only need an efficient UV-Map to bake to. If you or others texture in a 2D-application such as GIMP or Photoshop, the UV-layout should be clearly readable and organized, which needs more adjustment in UV-mapping. Imagine you try to paint some jeans on a character's leg in Photoshop, and the leg is scattered in ten different islands across the texture, it will take forever and probably not look good anyway.

The best way to get a decent grasp on how UV-layouts can be done is to look at some reference. Just Google something like "uv-layout" and analyze them as to how easy they are to read and how efficiently they cover the texture space. If you do this, you will soon know how things work because unwrapping is no form of art. Once you get it, you just do it, like putting on your trousers every morning

That's it; you just finished your third model and even unwrapped it. You can now go ahead and bake a normal map to view it in a game engine.

Have a go hero – bake the polypainting into a texture

Now that you know how to retopologize and unwrap, you could even create a low-poly version of the tree, unwrap it, and bake the polypainting into a texture. To do this, you have to create a new texture in Tool | Texture Map and then bake the polypaint by clicking Tool | Texture Map | from Polypaint. In Tool | UV Map, you can set the texture's size.

Summary

In this article, we learned a lot about creating a low-poly from a high poly and how to project the details back to our new in-game mesh. Most importantly, we learned how to make a high-polygon model first and do the low-poly afterwards, which gives us another workflow at hand we can choose from. Specifically, we learned:

  • We get more creative freedom during the modeling process if we do the technical work like retopologizing and unwrapping at the end. Go wild first and clean up afterwards
  • To make models that work well in animation, we should add edge loops in important areas when retopologizing.
  • To transfer details from one mesh to another, we can use projection.
  • To get full control, we can even project details by hand using the ZProject brush.
  • To apply a texture to a model, it needs UV-coordinates, which can easily be created with UV Master.
  • When creating UV-layouts, we have to deal with three problems:
    • The amount and placement of cuts
    • Stretching
    • Readability of the layout

Further resources on this subject:


About the Author :


Manuel Scherer

Manuel Scherer is a German game developer who has worked in the games industry and in the fields of visual computing. He is currently teaching real-time visualizations at the Offenbach Academy of Art and Design.

Apart from his beloved work, he writes as a freelance journalist about the games industry from major events such as the Game Developers Conference Europe.

Books From Packt


Unity 3D Game Development by Example   Beginner's Guide
Unity 3D Game Development by Example Beginner's Guide

Panda3D 1.6 Game Engine Beginner's Guide
Panda3D 1.6 Game Engine Beginner's Guide

XNA 4.0 Game Development by   Example: Beginner's Guide
XNA 4.0 Game Development by Example: Beginner's Guide

Facebook Graph API Development   with Flash
Facebook Graph API Development with Flash

Away3D 3.6 Cookbook
Away3D 3.6 Cookbook

OGRE 3D 1.7 Beginner's Guide
OGRE 3D 1.7 Beginner's Guide

Cocos2d for iPhone 0.99   Beginner's Guide
Cocos2d for iPhone 0.99 Beginner's Guide

Flash 10 Multiplayer Game Essentials
Flash 10 Multiplayer Game Essentials


Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software