Home | Resume | Links | Tutorials | Contact

Using Textures to Generate Mesh Geometry in Zbrush 2

Image-based modeling is a term that describes the process of using a 2D image to generate a 3D result. Basically, you can make a height map using a grey-scale image to use as a "displacement driver" in Zbrush 2. Once the geometry has been displaced (think of injection molding and you'll get a good idea of the result) in Zbrush 2, you can then further refine the geometry in Zbrush 2 with Z2's sculpting tools.
The most obvious question is "Why not just sculpt the details in Zbrush to begin with?" The short answer is that mechanical components and any art element requiring a high degree of precision can be difficult to pull off in Z2 (I'm not saying it can be done - it's just more difficult). And if any element in the art needs to be altered (or modified to make a secondary subset), it's much easier to move paths and layers in Photoshop than it is to resculpt the geometry in Zbrush. The benefits of the following technique are: (a) Speed (b) Predictable precision (c) Elegant integration with existing tools.
Let's look at each point.
(a) Speed: Zbrush is an awesome organic modeler. Character meshes can be created completely from scratch or modified from existing meshes in record times. However, when it comes time to create mechanical, or non-organic models with the intent of extracting usable normal maps for environments or pieces of a character (namely armor) that are mechanical or hard-surface, Zbrush can be frustratingly difficult to use. Thus, it can be hard for some artists to achieve the precise look they are going for with the normal sculpting tools. Integrating the tools in Photoshop also gives the artist the flexibility to switch between the two applications as needed.
(b) Predictable Precision: Zbrush is an awesome organic modeler. Character meshes can be created completely from scratch or modified from existing meshes in record time. However, when it comes time to create mechanical, or non-organic models with the intent of extracting usable normal maps for environments or pieces of a character that are mechanical or hard-surface, Zbrush can be frustratingly difficult to use. It can be difficult to replicate that sculptural detail across multiple objects that are only slightly different if all the detail is purely sculpted in Zbrush 2. Thus, it can be hard for some artists to achieve the precise look they are going for with the normal sculpting tools. Leveraging the tools in Photoshop from the beginning does much to alleviate this problem.
(c) Elegant Integration: One of the big strengths of Zbrush is how well it plays with other programs. Using images made in Photoshop to create actual geometry is elegant and straightforward. The inverse is also true. It's quite easy to take a Zbrush-generated displacement map and use it as a start for a color map in Photoshop.
Here is the workflow in a nutshell:
  • Create a grey-scale image using Photoshop (or another image editing program - but this tutorial focuses on Photoshop)
  • Save the image as a mitmap or a .psd
  • In Zbrush, import the .bmp or .psd as an alpha.
  • Make the alpha a texture.
  • Make a Plane3D tool.
  • Turn the Plane3D tool into a Polymesh3D.
  • Subdivide the mesh as many times as you can (usually you'll get about 6 levels of Subdivision).
  • Project the image on to the geometry as both an alpha and a texture.
  • Under the displacement tab, preview how the mesh will be displaced using the intensity slider.
  • Displace the mesh (i.e. emboss, for the lack of a better word, the height map onto the geometry).
  • Refine or add more details to the mesh using Z2's sculpting tools.
  • Extract a normal map or displacement map.
  • Fix the seams generated by this process in Photoshop (more on that in a moment).
  • Here is an image created in Photoshop. It has been constructed using the Pen tool to create paths and different componnents have been rendered on layers (lots of layers - keep the layers organized and named intelligently). Layer effects are used to create differing height fields.
    Using the combination of the pen tool and layer effects, precise mechanical effects can be achieved. Experimentation with the effects yields different results. Keep in mind that, for the most part, all the rules for bump, displacement, and height maps apply; i.e. black = down and white = up with greys = differing degrees of elevation between the two.
    It's a good time to discuss the need to have a gap between the active image area (the actual texture area that will be seen on the model) and the edge of the total area around the active image area. This gutter of neutral grey (128,128,128) will be a consistent height around the active image area, which could have wildly divergent heights up to the very edges of the mesh. The result could be undesirable as the actual geometry you create will not have seamless heights around the perimeter of the texture. This is bad for tiling textures because of the height variance.
    This is the result of not putting a protective border around the active image area. There is an obvious seam that is easy enough to fix using the clone tool (although it's still a pain). However, there is also a subtle color imbalance at the edges. Notice the slightly pinkish tone on the left two quadrants. Once the seam is removed, the color is still not balanced. Currently, there is no good way to correct this. All methods ultimately degrade the image. The better way to approach this is to create the buffer border so that the depth at the edges of the texture is consistent on all sides. The seam still exists, but there is no color imbalance. After cropping the image to the correct size, eliminating the seam (crop the image to the right size first) is all that needs to be done.
    A decent workaround to this problem is to make a border around the image in Photoshop. Once you have created the gutter, save the file as either a 24-bit bitmap (.bmp) or a .PSD file. Once saved, start Zbrush 2 and create a Plane3D tool. Drag the Plane3D out in the canvas. Go to Edit mode (press "T").
    Click the "Make PolyMesh3D tool" button. Zbrush will then create a Polygonal mesh from the Plane3D tool. You'll need to drop the Plane3D tool (press "T" again) and then clear the canvas (press "Ctrl+N"), otherwise you'll end up bringing the new mesh. The canvas is clear.
    In the tool menu, choose the new tool. It will be called "PM3D_Plane3D" or something like that. The Plane3D tool is not a subdivision surface and doesn't support multiple levels of resolution or displacement and therefore can't be used to extract a normal map or a displacement map. The only reason to create the Plane3D tool is to use it to create the Polymesh.
    Click and drag out the polymesh tool. Press "T" to make it editable. Now you can do all the standard Zbrush manipulations to it. It's at a zero subdivision level, so you'll need to subdivide the mesh as many times as you can. Expand the "Geometry" roll-out and hit the "Divide" button. Repeat this until you have as many subdivisions as you can support (usually around 6 levels of subdivisions).
    Click on the "Alpha" menu. Click the Import button. Locate the saved Photoshop .bmp or .psd file. You will use this to displace the polymesh.
    Click the "Make TX" button. A copy of the Alpha has been put in the Texture menu.
    The image should appear on the Polymesh.
    Under "Tools>Geometry," make sure the Polymesh is set to the highest level of subdivision.
    Under "Tools>Displacement," adjust the "Intensity" slider to preview how strong you want Zbrush to displace the mesh. Zbrush 2 is very sensitive to displacement, so a super-high number is not necessary. Something in the .0144 range is usually good enough, however, experimentation will often be the best indicator or what works and what doesn't.
    To commit the displacement to the mesh, click the "Apply Displacement" button. Zbrush 2 may take a few seconds, but it is cooking in the values of the image into the mesh.
    The mesh has now taken the dispacement image and has been modified.
    To see the new mesh properly, turn of the texture. Under Texture, click the "Txtr Off" button.
    The mesh will now be rendered without a texture projected on to it. The default material, a fast shader, is whitish-grey.
    After the mesh has been displaced, further detail may be added by using the Standard Modeling tools available in Zbrush in unison with Projection Master. Hiding everything but the part of the mesh you will be working on speeds up performance and allows you to focus in tighter on the area you wish to affect. Hide all but one area of the mesh (Ctrl+Shift+Left Mouse Click and Drag around a region. Green = visible. Ctrl+Left Mouse Click and Drag around a region to unhide a mesh. If you want to hide a part of the mesh, Ctrl+Shift+Left Mouse Click and Drag, then with the Ctrl and Left Mouse button still clicked, take your finger off of the Shift key. The selection marquis should change from green to red. Red = invisible).
    To zoom in on the hidden mesh, hit the "Delete" key. The visible mesh will now be maximized to the entire canvas.
    Click the "G" key to invoke "Projection Master," a utility for painting fine detail onto a mesh. Make sure "Colors" and "Material" are unchecked and "Deformation" and "Normalized" are checked.
    To get a glimpse of the additional detail that can be created in Zbrush2, go to "Stroke>Grid." Leave the settings as they are, but be aware they can be changed by adjusting the "Main Repeat" and "Secondary Repeat" sliders. Uncheck "MGRB," "RGB," and "M" if they are checked. Check "Zadd" if it isn't checked. Leave the strength alone, but keep in mind the settings can be increased or decreased if necessary.
    Click on a part of the image to paint the grid stroke onto the canvas. Then hit the "E" key. A gyro should appear which means the stroke that has just been made that can be scaled. Scale the stroke so it is bigger. Hit the "W" key. The stroke can now be moved by manipulating the gyro. Pull the grid over an area where it can be used effectively. Click the Snapshot button to make a copy of the stroke. A copy is made directly on top of the existing stroke. Using the gyro, move the new stroke to the right of the existing stroke.
    Continue to copy the stroke until the sequence is completed. Other strokes can be used in the same way.
    Press "G" to exit Projection Master and to pick the tool back up.
    Once the tool has been picked up, the additonal modeling done in Projection Master can be viewed.
    As is evident, the stroke tools in Zbrush 2 can be used to supplement the detail that is produced by the displacment.
    Unhide the mesh. Now pick another area and hide the rest of the mesh so that more detail can be added using projection master. After you hide the area, and maximize it in the workspace, go into Projection Master.
    Select the Deco brush.
    Uncheck, "MRGB," "RGB," "M" if they are checked. Check "Zsub." Set the strength to 6. Begin to paint divots into the mesh. By changing Alphas and adjusting the Accurate Curve Mode settings, you can pull of some very interesting effects. This is great for knocks and dings.
    Change tools to the Depth brush and pick a noisy alpha to paint in more detail. Pick up the canvas and smooth out the noise. Repeat this process to add details as needed. Once enough detail has been added, press "G," leave Projection Master and go back to Standard Edit Mode.
    If you need to have explicit control of the detail, mask off portions of the mesh with another version of the displacment driver image. Go back to Photoshop and use the paths to generate a stark, high-contrast image (basically black and white) with black = masked off areas and white = exposed areas. This is handy because this masking allows for very alterations on very selective areas - areas that would normally be hard to isolate.
    Go back to Zbrush and make sure there are no masks applied to the active tool.
    To load the image, repeat the same process you used to import the displacement driver image. Go to Alpha>Import and pick the image. Loading it puts the new image in the active alpha slot.
    Once you have the Alpha loaded, expand the "Masking" rollout under the tools Menu. To make the image a mask, click on the "Alp" button. The new image should be displayed on the tool mesh.
    Now, with the mask active, expand the "Deformation" rollout and locate the "Inflate" slider. Turn of the "X" and "Y" option and leave the "Z" on. Now, crank the Inflate slider up or down to push the exposed areas out. Experiment with the settings until you get one that suits you.
    After you inflate the exposed area, you might want to smooth out the new changes. Hold down the shift key to turn the Standard Edit Brush or Inflate Brush into the Smooth Brush (the cursor reticule should turn blue). You'll want to adjust the strength of the brush. It might also help to hide all but the area you want to work on.
    Once you're done making changes, it's a good idea to clear the mask. If you don't you won't be able to affect anything other than the exposed part of the mask. Expand the "Masking" rollout and hit the "Clear" button. The mask will no longer be drawn on the tool mesh.
    Make sure the mesh is at maximum detail. Click the snapshot button.
    Hit "Ctrl+N" to clear the canvas. Then lower the geometry to the lowest subdivision level.
    Under Tool, expand "Normal Map." Make sure the "Tangent" and "Average" are checked. Press the "Create Normal Map" button.
    Zbrush will cook a normal map.
    To export the normal map to Photoshop, go to "Texture" and Click the "Export" button. Choose a directory that is appropriate and save the image.
    In Photoshop, locate the texture from Zbrush and open it up.
    Crop the normal map to the proper dimensions it needs to be. Offset it and correct any tiling issues, if necessary. You can generate a displacment map the same way you generated the normal map. The main difference in methods is that you use "Tools>Displacement" to generate the displacment map. The displacment map is an excellent start for the color map.
    Here is a shot of the normal map with a diffuse color map (which is tinted and modified version of the displacement map) and specular highlight map loaded onto a realtime shader in Maya.
    Tutorials Home