Вы находитесь на странице: 1из 100

Normal Mapping with ZBrush and ZMapper

November 29, 2005

2005 Pixologic, Inc. All rights reserved. Pixologic and the Pixologic logo, and ZBrush and the ZBrush logo, are registered trademarks of Pixologic, Inc. All other trademarks are the property of their respective owners

Please mail comments or suggestions about this document to doc@pixologic.com.


1

Document Orientation
We wanted to give a reference not just on ZMapper, but on normal map concepts, so this is a large document. But, you dont need to read all or even most of it to begin using ZMapper. Here are some directions for starting with minimal reading: If normal mapping is a new concept to you, you may first want to read section 7, which talks about the concepts behind normal, bump, and displacement maps; but if youre comfortable with normal map concepts, you can ignore that section. For those familiar with ZBrush and with normal maps, section 2 gives a high-level description of the normal map generation process. This may be all you need. To learn ZMapper by going through a detailed example, look at section 5.5. Section 3 deals with the special case in which youve had to re-create your model with a new topology, after having already detailed and normal-mapped the original model in ZBrush. If you do not need to change topology in this way, you do not need to read this section, nor will the example in section 5.6 be of interest. Section 6 gives a description of normal mapping tools that existed in ZBrush prior to ZMapper; these tools may still be useful in many circumstances, and this chapter is included for convenience. For most purposes, most of the controls described in section 4 may be ignored. In fact, it is possible youll only ever use the controls described in sections 4.4.1, 4.4.3, and 4.4.4.

More generally, reading chapter 1 will give you a one-page overview of what ZMapper can do and its workflow. Section 2 give a more detailed description of normal map creation (without examples), and section 3 is the same thing for the specialized topic of projecting normal maps onto new topology. Section 4 is the detailed reference section. Section 5 gives detailed examples that illustrate the use of ZMapper, and the next sections cover normal map topics not related specifically to ZMapper. The final section is a simple ZMapper cheat sheet.

Table of Contents 1. INTRODUCTION ...................................................................................................... 1

1 . 1 . Pr c i so fNo r ma l Ma pW o r k f l o w. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1 . 2 . Pr o j e c t e d No r ma l Ma p s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

2.

NORMAL MAP GENERATION QUICK START....................................................... 3

2 . 1 . No r ma l Ma p sf r o mS u bd i v i s i o nM o de l s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2 . 2 . No r ma l Ma p sf r o m Bump M a p s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.2.1. Creating Bump Maps In ZBrush ...................................................................................................................... 4 2 . 3 . No r ma l Ma p sf r o m Bo t h Bump M a p sa ndS u b di v i s i o nM o d e l s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2 . 4 . Ca v i t yS h a d i n g. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2 . 5 . Ca v e a t sa n d Ti p s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

3.

PROJECTING NORMAL MAPS ONTO NEW TOPOLOGY..................................... 7

3 . 1 . Al i g ni n gt heI n i t i a l a ndNe w Ba s eM e s he s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.1.1. ZBrush Settings to Check ................................................................................................................................. 8 3.1.2. Workflow Issues................................................................................................................................................ 8 3.1.2.1. Workflow; Original and New Model from External Program ............................................................... 9 3.1.2.2. Workflow; Original Model in ZBrush, New Model Externally............................................................. 9 3.1.2.3. Workflow; Original Single Model, New Model Broken into Pieces..................................................... 9 3.1.3. Aligning Rotations ............................................................................................................................................ 9 3.1.4. Aligning Scaling.............................................................................................................................................. 10 3 . 2 . S e t t i n g s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1

4.

ZMAPPER DETAILS.............................................................................................. 13

4 . 1 . I n s t a l l i n go rS t a r t i n gZM a p p e r. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 3 4.1.1. Installing ZMapper as a Plugin ...................................................................................................................... 13 4.1.2. Loading ZMapper Manually........................................................................................................................... 13 4 . 2 . Th eZM a p pe rPr o c e s s Wo r k f l o w Re f e r e n c e. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 4 4 . 3 . Ma pa n dM o d e l Re s o l u t i o n s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 5 4 . 4 . ZM a pp e rI n t e r f a c eDe s c r i p t i o na n dRe f e r e nc e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 6 4.4.1. Navigating Around the Model........................................................................................................................ 16 4.4.2. ZMapper Control Panel and Control Types .................................................................................................. 16 4.4.3. Upper Controls ................................................................................................................................................ 17 4.4.3.1. ZMapper Column .................................................................................................................................... 17 4.4.3.2. Transform Column .................................................................................................................................. 19 4.4.3.3. Mesh Column .......................................................................................................................................... 19

4.4.3.4. Morph Modes Column............................................................................................................................ 20 4.4.3.5. Wires Column.......................................................................................................................................... 22 4.4.3.6. Screen Column ........................................................................................................................................ 24 4.4.3.7. Display Column....................................................................................................................................... 25 4.4.3.8. Configuration and Preview Controls ..................................................................................................... 29 4.4.3.9. Subpanel Tabs (see bottom left of Figure 4) ......................................................................................... 30 4.4.4. Normal & Cavity Map Tabbed Panel ............................................................................................................ 30 4.4.5. Projection Tabbed Panel ................................................................................................................................. 37 4.4.6. Expert 1 Pass and Expert 2 Pass Tabbed Panels ........................................................................................... 38 4.4.6.1. Expert Option Passes .............................................................................................................................. 38 4.4.6.2. Surface Normal Interpolation ................................................................................................................. 38 4.4.6.3. Map Distortion Issues ............................................................................................................................. 39 4.4.6.4. Expert Options Summary ....................................................................................................................... 39 4.4.7. Misc Tabbed Panel.......................................................................................................................................... 39

5.

ZMAPPER EXAMPLES ......................................................................................... 41

5 . 1 . Vi e wi n gaFi n i s h e dM o de l . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1 5 . 2 . Co n s t r u c t i n gaNo r ma l Ma pf r o m aFi n i s h e dM o de l ;El e p h a n t . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 2 5 . 3 . Co n s t r u c t i n gaNo r ma l Ma pf r o m aFi n i s h e dM o de l ;Tr o l l . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 5 5 . 4 . Cr e a t i n gBu mpM a psf o rZM a p pe r . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 6 5.4.1. Viewing the Bump Map as you Create .......................................................................................................... 47 5.4.2. Tips and Tricks for Creating Bump Maps ..................................................................................................... 48 5 . 5 . AnEx a mpl ef r o mI nc e p t i o nt oCo mpl e t i o n. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 8 5.5.1. Creating the Geometry .................................................................................................................................... 49 5.5.2. (Continued) Create a Bump Map ................................................................................................................... 50 5.5.3. (Continued) Create a Normal Map................................................................................................................. 52 5 . 6 . Pr o j e c t i n gaNo r ma l Ma p On t oDi f f e r e n tTo p o l o g y. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3 5.6.1. Projection Example ......................................................................................................................................... 53 5.6.2. Projection Troubleshooting ............................................................................................................................ 57 5.6.2.1. Scaling Problems..................................................................................................................................... 57 5.6.2.2. Rotational Mismatches ........................................................................................................................... 58 5.6.2.3. Texture Map Problems............................................................................................................................ 59 5.6.2.4. Projection ExampleFixing Projection Problems ............................................................................... 59

6.

NON-ZMAPPER ZBRUSH NORMAL MAPPING TOOLS...................................... 64

6 . 1 . Cr e a t eEn h a n c e dDe t a i l i n gwi t h ZBr us h2 D, 2 . 5 Da n d3 D To o l s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 4 6 . 2 . Cr e a t i n gS e a ml e s sAl ph a sa n d Pa i n t i n gBump M a p s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 5 6 . 3 . De t a i l e d Tu t o r i a l :Us i n gZbr u s h sCa n v a st oCr e a t eNo r ma l a n d Bump M a p s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 8

7.

CONCEPTS BEHIND BUMP, DISPLACEMENT, AND NORMAL MAPS.............. 75

7 . 1 . Bump M a p s. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 5 7 . 2 . Di s pl a c e me n tM a ps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 5 2

7 . 3 . S u r f a c eNo r ma l sa n d Li g h t i n g. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 8 7.3.1. Surface Normals with Specular and Reflective Lighting ............................................................................. 79 7 . 4 . S u r f a c eNo r ma l Pe r t ur b a t i o n. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 9 7 . 5 . Bump M a p sa n dS u r f a c eNo r ma l s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 0 7 . 6 . No r ma l Ma p s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 1 7.6.1. Representing Normal Maps as Textures........................................................................................................ 82 7.6.2. Normal Map Generation ................................................................................................................................. 83 7.6.2.1. Converting From a Bump Map .............................................................................................................. 83 7.6.2.2. Raytracing/Raycasting ............................................................................................................................ 84 7.6.3. Normal Maps in Tangent and Object Space.................................................................................................. 85 7.6.3.1. Object Space Map Uses .......................................................................................................................... 86 7.6.3.2. Tangent Space Map Uses ....................................................................................................................... 87 7.6.3.3. How Does Your Application Distinguish Between Tangent and Object Space Normal Maps? ....... 87 7.6.3.4. Summary of Object Space and Tangent Space Normal Maps ............................................................. 87 7.6.4. Cavity Shading ................................................................................................................................................ 88

8.

ZMAPPER CHEAT SHEET .................................................................................... 89

8 . 1 . Co n t r o l Pa n e l s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 9 8 . 2 . Mo d e l Na v i g a t i o n wi t ht h eM o u s e . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 9 8 . 3 . Ke y b o a r dS h o r t c u t s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 0

1. Introduction
1. 1. Pr ci s ofNor m alM ap W or kf l ow
ZMapper uses some of the unique features of ZBrush, such as multi-resolution subdivision surfaces, to make the creation of normal maps a quick and easy process. Section 4.2 gives a more detailed conceptual overview of the process, and the examples in section 5 give step-by-step instructions for generating normal maps, in order to illustrate the full range of possibilities. But heres a quick preview of a typical use of ZMapper, so you can have an idea of how it fits in with ZBrush. 1. Create a low-resolution model to your liking and (in ZBrush, using the multiple subdivision levels feature) a high-resolution model that is a subdivision of the lowresolution model. 2. Choose a texture size for the normal map. 3. Add a bump map if desired, for high-frequency detail. 4. Start the ZMapper plugin and use it to create a normal map for the low-resolution model. The map will incorporate both the differentials in geometry between the low- and highresolution models, and the details of the bump map. The world below shows how well an extremely high-resolution model can be mapped to a very low-resolution model, given the appropriate geometry.

Fi g u r e1 .W o r l d No r ma l Ma p
The low-res model shown below is less than 600 polygons (the straight lines of the polygons are just visible in silhouette). The high-resolution model used to generate the normal map was more than two million polygons. The smaller inserts on the right show the low-resolution polygon geometry, and close-up detail of the normal-mapped model.

1. 2. Pr oj ect ed Nor m alM aps


An additional feature of ZMapper is the ability to take a normal map generated for an existing model, and project it onto a new model with the same shape but a different topology. This is useful for cases where a new topology for the model has been developed after sculpting in ZBrush; rather than resculpting the new model, simply project the normal map from the original model onto the new model. Full details are in section 3.

2. Normal Map Generation Quick Start


This section is for readers who already possess a reasonable familiarity with ZBrush and the concepts of normal maps. It gives you the bare details you need to get going, without going into material youre likely already familiar with. If you do want to look at certain aspects in more details weve provided all of the appropriate cross-references. A good first step would be to follow the instructions for viewing the examples in sections 5.1 and 5.2. This will take just a few minutes, and will expose you to all of the basic ZMapper features. Not included in this section is the process of projecting a previously generated normal map onto a new model with a different topology.

2. 1. Nor m alM aps f r om Subdi vi si on M odel s


ZBrush exploits its powerful multi-resolution subdivision modeling feature to allow easy creation of normal maps from a single model sculpted at both low and high resolutions. The process is simple: 1. Install or load ZMapper. (See section 4.1.) 2. Create the low-resolution Polymesh3D model you want to start with, and make sure it conforms as closely as possible in shape to the high-resolution mesh that will be expressing all of the details. 3. Using the ZBrush tools you are already familiar with, iteratively subdivide the model and sculpt finer and finer detail, until you have the desired final result. 4. Create and select a texture that will hold the normal map. It must be square, and its side dimensions must be powers of two. (256, 512, 1024, and so on.) To capture all of the detail, the normal map area used (i.e. that portion not left blank by the UV mapping) should have about as many pixels as the high-resolution model has polygons. ZMapper will use whatever UV mapping you choose for the model. 5. Set the model to its lowest subdivision setting. The selected level is the model level for which the normal map will be generated. 6. Start ZMapper. Select Tangent Space N.Map or Object Space N.Map to choose between generating a tangent or object space normal map. Open the Normal & Cavity Map tab, and press Create Normal Map. 7. Once the normal map is complete, exit ZMapper. The finished texture map will be in the texture palette.

2. 2. Nor m alM aps f r om Bum p M aps


Another way to produce a normal map is to start with a bump map, and convert it to a normal map. This has the advantage that the resulting normal map no longer has the intensity adjustment problems that can be encountered with bump maps, when transferring them between different programs. Even better, bump maps can be used along with the techniques described in section 2.1. The process is straightforward.
3

1. Choose a polymesh 3D model for which you wish to generate a normal map. 2. The bump map will be a grayscale texture map that has a UV mapping to the model. Get it into the Alpha palette and select it as the current alpha map. The bump map dimensions should be between one to two times the dimensions of the final normal map. (So if your normal map is 1024x1024, choose a bump map from 1024x1024 to 2048x2048.) Less than this, and theres not a lot of point in using a bump map. More than this, and you risk putting a lot of work into the details of the bump map that will then be filtered out because the normal map resolution is not high enough to support them. If you have enough memory, we recommend using a larger bump map than the normal map, and just keep in mind when editing that very fine details in the bump map will not come through. The higher resolution will still probably improve quality on the larger details. 3. Create a texture that will hold the generated normal map. The restrictions outlined in the previous section as regards to normal map dimensions apply. (Square, power of two.) 4. Set Tool:Displacement:Displacement Intensity to about 0.05. After a highly rigorous evaluation, this figure was chosen because it seems to work pretty well most of the time. Feel free to experiment. This is the setting that tells ZMapper the chosen alpha map is to be considered a bump map, and with what intensity to apply it. 5. Go into ZMapper and, as in the previous section, choose the type of normal map to generate and then create it. When it has been created, exit ZMapper and your normal map will be in the texture palette and ready for use.

2.2.1. Creating Bump Maps In ZBrush


Youve no doubt thought, Aha, I can use ZBrush to create great bump maps as well, to use in the above process. Youre right, of course. There is a plethora of ways to generate the requisite grayscale bump map from within ZBrush. You can paint directly to the 2.5D canvas and then grab an alpha off of there. Using Projection Master with the BumpViewerMaterial, you can paint a grayscale texture onto your model, and then create an alpha from that. Some of these techniques are discussed in section 6. The experienced ZBrush user will no doubt come up with many more. There are some points here you should be aware of, pertaining to the relative resolutions of the various map that come into play. See section 4.3 for details.

2. 3. Nor m alM aps f r om Bot h Bum p M aps and Subdi vi si on M odel s


Its easy enough to combine the above two ways of generating normal maps. Just make sure youve followed the steps in section 2.2 so that you have an appropriate bump map alpha selected, and that youve followed the steps in section 2.1 so that you have a subdivision model set to its lowest level. Then go and create the map as usual. Both the geometry and the bump map will be incorporated.

2. 4. Cavi t y Shadi ng
Strictly speaking, cavity shading (a form of simulating ambient occlusion) has nothing to do in concept with normal mapping, but it turns out to be easy to incorporate a cavity shading effect into the normal map process, at no further end-use cost. ZMapper has the ability to produce and
4

integrate cavity shading. The process is not difficult, but there are a number of settings that affect the final result, so rather than go into it here, Ill refer you to section. 4.4.4.

2. 5. Caveat s and Ti ps
ZMapper will do its best, but no normal map generator can compensate for models whose large-scale structure varies significantly between the high-resolution and lowresolution models. In other words, dont turn a hillock in your low-resolution model into a tree in your high-resolution model, and expect to come up with anything intelligible. Another no-no is producing elements in the high-resolution model that fold over, where they did not do that in the low-resolution geometry. This produces a situation where one point in the normal map must represent two different normal directions (depending on viewing angle, no less!), and that simply isnt possible. Youll probably end up with a normal map, but not one youd want to use. Creating normal maps between a very low-resolution model and a very highresolution model can be problematic. For example, if your starting geometry is a single quad, and you then take that up to a million quads for the high-resolution model, ZMapper may have difficulties. The solution is to start with a higher-res lowresolution model (say 100 or 10,000 quads), and produce a normal map for it. Then, you can remap that normal map to a single quad to get the effect you want. If at any point you need more detail in the steps outlined above, look at section 5.5. It attempts to give a very simple but thorough example touching on almost every aspect of normal map generation discussed here.

3. Projecting Normal Maps Onto New Topology


Once youve created a normal map for an object, you may find you need to change the base topology of your original low-resolution mesh, in order to allow better deformation during animation, or for some similar reason. However, the new base mesh will of course not have any of the sculpted detail applied to the original mesh with ZBrush, so a normal map cannot be generated for it in the same way. In order to allow reuse of the original sculpted model, ZMapper provides the Projection tab. Fi g u r e2 . Th ePr o j e c t i o nTa b

Simply put, these controls allow you to make use of the detail from the original mesh by fitting it over the new mesh, and projecting that detail onto the new mesh as the normal map is being built. Conceptually, the process is fairly simple. It consists of the following steps. 1. Build and sculpt the initial modelcall it model A. 2. Build and import the new base meshcall it model B. 3. Ensure the two meshes are properly aligned and scaled within ZBrushs coordinate space. 4. Choose the original mesh (A), go into ZMapper, and click Capture Current Mesh in the panel above. This will remember model A as the mesh from which detail is being projected. Then leave ZMapper. 5. Choose model B, ensure UV coordinates have been assigned to it (if not assigned before importation into ZBrush), enter ZMapper, and click Create Projected NormalMap. This creates a new normal map for B by raycasting the details of A onto it. There are various settings you can use to affect the quality of the final result, but the most important thing is just to make sure that the original low-resolution mesh and the new lowresolution mesh fit together as closely as possible; youre not going to be able to transfer the detail from a ducks head into a normal map for a robin. If your new mesh ends up being differently shaped in some places than the previous mesh, you can try resculpting the original in ZBrush to better fit the new; this should keep most of the high-resolution details. The remainder of this chapter discusses some of the concepts and details youll need to understand to make working with raycasting easy. A full example is presented in section 5.6, and the controls are detailed in the section 4.4.

3. 1. Al i gni ng t he I ni t i aland New Base M eshes


Aside from being as identical in shape as possible, the base meshes also need to be identically aligned with respect to global location, scaling, and rotation, to obtain the ideal result. If they are
7

not aligned, the mismatches will show up when you go into ZMapper, and you can correct them using the techniques described below. Examples of this are given in section 5.6. There are a couple of things that can affect whether or not you need to deal with alignment problems. Controls described below can have an effect; more importantly, certain workflows can require dealing with scale issues. These are also discussed below. The simple case, where the settings below are left at their default values and the models being worked with are single-piece models built in an external program, should not cause any alignment mismatches.

3.1.1. ZBrush Settings to Check


You should be aware of two controls in ZBrush that might affect scaling, and one set that can affect rotation. These are the Preferences:Importexport:Unify Scale setting, the Tool:Export:Scale setting, and various of the flip settings in Preferences:Importexport. If you encounter unexpected alignment problems, check these controls to ensure they are set at reasonable values. The default values are reasonable for almost all cases. does what you might think from the name; it scales the mesh up or down on export. For example, if you import a 1x1x1 cube, set Tool:Export:Scale to 2, and then export the cube, youll get a 2x2x2 cube. The default for this setting is 1, and you should normally leave it at that.
Tool:Export:Scale

The other scaling setting, Unify Scale, affects the scale factor that is used to change from external coordinates to ZBrush internal coordinates when a model is imported or exported, and the simplest thing to do with it is just not change it. Regardless of what this control is set at (the default is 4), if you import an object, sculpt it, and then export it without changing Unify Scale and with ToolExport:Scale = 1, the exported object will have the same size as the imported object, and you wont encounter scaling issues. The flip settings in Preferences:Importexport are all off by default, and should normally left that way when using ZMapper. If you do find a model is flipped when it is imported, you can activate the appropriate ones of these switches and import the model again, but its probably faster to use the technique described in section 3.1.3.

3.1.2. Workflow Issues


There are all sorts of different workflows that might be employed when building an original mesh and then a similar mesh with a new topology. For example, you might sculpt the original mesh from a ZBrush primitive, export the base level, use an external program to produce a new topology, and then import that new topology. Or you might produce both the original topology and the new topology in a single program, and import both into ZMapper. Or, conceivably, one artist might produce the original mesh in one program, sculpt it in ZBrush, and then somehow transfer the original base mesh to another artist who uses another program to produce another mesh with a different topology but the same shape. Regardless of workflow, the end goal is to project normal maps in ZMapper, and to do that the models need to be as closely aligned in ZMapper as possible. Lets discuss a few common workflows, and some of the things you might need to think about with each of them.
8

3 . 1 . 2 . 1 .Wo r k f l o w;Or i g i n a l a n d Ne wMo d e l f r o m Ex t e r n a l Pr o g r a m


In this instance, you build the initial head in your favorite modeling package, import into ZBrush, and sculpt. Then, it turns out that the original head topology isnt satisfactory, so you go back to the modeling package, and build the new topology exactly over the old topology; eyes are in the same place, nostrils in the same place, etc. Most particularly, the width, height, depth, and origin of the models are the same. When thats done, you import the new topology into ZBrush. In this case, you shouldnt encounter any problems whatsoever. Since the dimensions and origins of each model are the same, theyll undergo identical scaling in ZBrush, and should line up just as well in ZBrush as they do in the external modeler.

3 . 1 . 2 . 2 .Wo r k f l o w;Or i g i n a l Mo d e l i n ZBr u s h , Ne wMo d e l Ex t e r n a l l y


This is the case where youre a sculptor who just loves ZBrush, and would never want to start a model any other way. So you begin with a ZBrush sphere, convert it to a polymesh, do all of your sculpting in ZBrush, and export one level (probably the base level) of the polymesh. Then you or someone else builds the desired topology around that exported mesh using a program of choice, and finally the new mesh is imported back into ZBrush for projection of the normal map onto it. In this case, you may find in ZMapper that the imported model is scaled differently than the original model. (This occurs because by default, ZBrush rescales imported models to fit in an optimal working area of the ZBrush coordinate system.) The fix for this is found in section 3.1.4.

3 . 1 . 2 . 3 .Wo r k f l o w;Or i g i n a l S i n g l eM o d e l , Ne wMo d e l Br o k e ni n t oPi e c e s


Here, an initial model is made, imported into ZBrush, and sculpted. A new model is then made, broken into pieces, and the pieces are imported separately into ZBrush for normal map projection. A naive import of the pieces will result in them having scales different from the sculpted model. The fix here is the same as the fix for the previous workflow case, and is described in section 3.1.4.

3.1.3. Aligning Rotations


The fastest tool for aligning mismatched rotations is the Tool:Preview subpalette. When opened, it displays the current tool in its current global orientation, with the z-axis going straight into the screen. By dragging anywhere on the image except the small red cross, you can rotate the preview (the dark plane is the xy plane); and by holding down the Shift key as you rotate, you can force the object to rotate in 90 degree increments. Finally, clicking the Store button will reset the rotation of the x, y, and z planes so that the objects new global orientation is visually the same as the last position youd moved it to. The figure below makes this clearer. Fi g u r e3 . Ch a n g i n gGl o b a l Ro t a t i o n sW i t ht h ePr e v i e w Pa n e l
The three images below show (a) the preview of the Polymesh3D star tool, the currently chosen tool; (b) a rotation of the preview image, with the dark xy plane indicating that the rotation of the

object in global space has not actually been changed, rather we have just moved our view around in global space; and (c) the same view after clicking the Store button. The xy plane is now face on again, indicating the z-axis is going directly into the screen. We!ve changed the global orientation of the star so that instead of being flat along the xy plane, it is diagonal to that plane.

(a)

(b)

(c)

This allows you to fix the only rotational problem youre at all likely to encounter, one where the new mesh is flipped or inverted. The follow instructions give both the process and the details of what is going on behind the scenes: 1. Choose your original mesh as the current tool, and open the Tool:Preview pane to check the default orientation of the meshthis is not necessarily the rotation that appears onscreen. 2. Choose the new mesh, and check its orientation in the Preview panel. If it is the same (even if the size is different), nothing more need be done. If it is flipped or rotated by 90 or 180 degrees, hold down the Shift key and drag on the background of the panel to rotate the object until it matches the orientation of the original mesh. 3. Click the Store button to finalize the rotational alignment.

3.1.4. Aligning Scaling


You may not encounter scaling mismatches, but if you do, the way to fix them is by way of an operation in ZBrush that can be quite useful in other contexts also. When ZBrush imports a model as a new tool, it scales that model to best fit in the ZBrush modeling area. However, when a mesh is imported to replace an existing tool, the mesh is scaled by the same factor that was applied to the tool it is replacing. This can be used to ensure that meshes imported into ZBrush retain their same relative size. A description of the workflow is the best place to discuss the details: 1. We begin by assuming that we have a sculpted mesh A with multiple subdivision levels, and an external mesh B that is the same shape as A but with a different topology. If we were to import B directly, we might find that there is a scale mismatch. 2. Instead, select A and use Tool:Clone to make a copy of A; well call this copy C. since C is an exact copy of A, it has the same scale as A. 3. Now select C, set Tool:Geometry:SDiv to 1, and click Tool:Geometry:Del Higher. This creates a copy of the base mesh of A, with the same scale as A.
10

4. With C still selected, use Tool:Import to import B. A new tool will be created from B, replacing C and with the same scaling as C. Since C has the same scaling as A, the new tool will also have the same scaling as A. In a slightly different scenario, we create the new mesh B, and split it into pieces B1, B2, B3, etc. In this case, we simply create multiple clones C1, C2, and C3 of A, and using the process above, replace C1 with B1, C2 with B2, and C3 with B3.

3. 2. Set t i ngs
There are a number of settings that affect projected normal maps. They are described in the reference section. However, you shouldnt normally need to use them, since ZMapper ships with a large number of predefined configuration files, one of which is likely to be correct for your needs. As of this writing, the files shown below are part of the distribution.

When setting values for projections, note that you cannot incorporate bump maps or cavity shading when creating normal maps via projection. Bump maps can be used when generating the initial normal map, and their effect will then appear in the projection.

11

4. ZMapper Details
This section is the main reference for using ZMapper. It describes the methods that can be used when generating normal maps with ZMapper; ZMapper installation; the standard steps and basic knowledge of controls needed to produce normal maps; and provides a reference to the ZMapper controls. It does not go deeply into specialized details, since many of those details are applicable only in special cases and will not be of interest to those first learning ZMapper or looking for a reference to basic ZMapper workflow. Section 5 gives examples showing advanced ZMapper techniques.

4. 1. I nst al l i ng orSt ar t i ng ZM apper


In order to use the plugin, youll have to make sure it is loaded. There are two ways of doing this. ZMapper can either be installed as a plugin, meaning it will automatically load whenever ZBrush is started, or it can be loaded manually whenever you wish to use it. Both methods are described below. In general, installing ZMapper as a plugin is probably the way to go; ZMapper adds just one button to the user interface, and requires no significant resources when not being used.

4.1.1. Installing ZMapper as a Plugin


First, locate the home ZBrush folder, the one containing the ZBrush application. This can be almost anywhere on your system, depending on how ZBrush was installed, but good places to look first are /Applications/ZBrush2 (on a Macintosh), or C:\Program Files\Pixologic\ZBrush2 (on a PC). If you cannot find it easily, use your computers find file function to search for ZBrush. Within the ZBrush home folder should be a folder called ZStartup. Inside that folder, create a folder called ZPlugs, if it does not already exist. Finally, copy or move the ZMapper files (ZMapperData and ZMapper.zsc) into the ZPlugs directory. The next time ZBrush is started, it should automatically load ZMapper. If you then open the Zplugin palette, youll see a button called ZMapper. Pressing this button will start ZMapper.

4.1.2. Loading ZMapper Manually


To load ZMapper manually into ZBrush, make sure you know the location of the folder containing the ZMapper plugin and its associated files. From within ZBrush, open the Zscript palette and press Load. Using the file open dialog that comes up, locate and load the file ZMapper.zsc, that will start it just as if it had loaded as a plugin Once this is done, pressing ZMapper in the Zplugin palette will start the ZMapper plugin. If you use this method, youll need to load ZMapper each time you start ZBrush.

13

4. 2. The ZM apperPr ocess W or kf l ow Ref er ence


The steps below specify how the ZMapper plugin is used from ZBrush, without going into ZMapper details. See section 4.4, more detailed examples and explanations of the options available in the ZMapper plugin. 1. To begin, create or obtain a low-resolution mesh in ZBrush. There are two ways of doing this. First, you can create a Polymesh3D tool in ZBrush and use that. Or, you can import a low-resolution mesh from another application.. 2. Once the initial mesh is in ZBrush, edit it as you normally would. This typically consists of subdividing the mesh and then adding detail at higher and higher levels of resolution until you are satisfied with the final detail. 3. In the Texture palette, create a new custom texture or select an existing custom texture into which the normal map will be written. If no texture has been created for the model, a new texture with a default size will be created. 4. If you wish to incorporate a bump map in the generated normal map, select it as the Alpha palette map and set Tool:Displacement:Intensity appropriately. (See examples for further details.) 5. Set the subdivision of your model to show the low-resolution model for which you are creating a normal map. 6. Activate the ZMapper plugin by pressing the ZMapper button. Unless the UI configuration has been customized, this button can be found in the Zplugin palette. The display will show a preview screen containing your model, and a control panel for setting options and generating normal maps. 7. Select either tangent coordinates or object coordinates, then create the map. There are a number of other options that may also be set before map creation, to affect various aspects of the final appearance. 8. Exit ZMapper. The created normal map will appear in the ZBrush Texture palette, and may be exported like any other texture. Of course, the above is just a recipe that doesnt really indicate all of the possibilities. Here are some of the many ways you can alter this recipe. Create a model in ZBrush, then subdivide and sculpt it to a certain level. Create a very high-resolution texture map and paint it with displacement information using Projection Master. In ZMapper, generate a normal map that incorporates both the high-level sculpted details and the painted displacement information. Import an externally generated model and a bump map for it. Use ZBrush to sculpt further details into the model, then apply both that information and the previously existing bump map to generate a comprehensive normal map.

14

Import an externally generated model and a displacement map for it. Subdivide the model in ZBrush to show an extremely high level of detail, and use the displacement map to produce a subdivided model whose geometry actually reflects the geometry implied by the displacement map. Refine the model and then use ZMapper to create a normal map without further need for reference to the original displacement map. The details of all of these techniques are described throughout section 4, and examples of them may be seen in section 5.

4. 3. M ap and M odelResol ut i ons


In spite of the nondescript title, the information in this section is quite important to achieving the best normal map possible. When working with ZMapper, there are up to four different resolutions you must consider: The resolution of the 3D object being mapped, in terms of number of polygons and uniformity of distribution. The resolution of the final normal map. If creating a bump map in ZBrush, the resolution of the bump map.

If using Projection Master as part of the process, the resolution of the canvas. For optimal results, you need to make sure that all of these resolutions are set to be compatible with one another. Heres how to do it. Assuming the polygons on your high-resolution model are distributed fairly equally over the UV unwrapping of the model, the number of pixels in the normal map (i.e., map pixel height times map pixel width) should be about equal to the number of polygons in the high-resolution model. If you have many more pixels than polygons, many pixels will end up mapping to the same polygons, which means your map will be carrying redundant information. Conversely, if you have many fewer pixels than polygons, some of your polygons will not be reflected in the normal map, and detail will be lost. Note that whenever you increase the size of a normal map, the number of pixels in it goes up by a factor of four, which might make it hard to get a good match for the number of model polygons. If your end use application can handle it, too many pixels will give better results than too few in this case. If you will be incorporating a bump map, the bump map dimensions (width and height) should generally be between one and two times the width and height dimensions of the normal map. Bump maps smaller than this will not be taking full advantage of the detail they can contribute to the normal map, and bump maps larger than this may lose fine detail when rolled into the normal map. Note that bump map dimensions are not constrained to have the same width and height, or to be powers of two. If using Projection Master to create a bump (or similar) map, we need to consider the resolution of the ZBrush canvas. The rule is that there should be an approximate oneto-one correspondence between pixels on the canvas and mapped pixels on the viewed portion of the model after it has been dropped, assuming it is sized so as to fill most of the canvas. This ensures that any change to a pixel on the canvas will result in
15

a more-or-less equivalent change to a pixel (or a couple of pixels) in the bump map. When working with a flat one-sided model such as a plane representing a wall, this means that the resolution (and for that matter, the pixel dimensions) of the canvas should be about the same as the model. If the model is two sided, then on average only one-half of its mapped pixels will be exposed at any time, so the number of pixels on the canvas should be about half of the number of pixels in the bump map.

4. 4. ZM apperI nt er f ace Descr i pt i on and Ref er ence


Once in ZMapper, youll be presented with your model and the ZMapper control panel. Basic navigation around the model can be done using the mouse. Everything else is done with the control panel.

4.4.1. Navigating Around the Model


As in ZBrush proper, ZMapper provides quick ways of viewing your model from different angles, zooming in and out, and so forth. These are described below. In addition, some of the control panel options affect model navigation, as discussed in section 4.4.3.2. NOTE: These techniques apply only if the Rotate transform mode is selected. See the description of the Transform controls in section 4.4.3.2 for full details. Rotate Model: Click and drag on the model or the display background. If the Spin switch in the control panel is on, the model will continue to rotate after the mouse button is released, in the direction of the drag. The speed of the rotation corresponds to the speed of the mouse at the end of the drag. Pan Model: Hold down the space bar while you click and drag the mouse on the model or background. Zoom Model: Right-click and drag on the model or background.

4.4.2. ZMapper Control Panel and Control Types


The ZMapper control panel appears along the bottom of the ZMapper screen. It contains an upper portion and several other sections that may be accessed via tabbed pages. See Figure 4. ZMapper uses the standard control types in its interface; buttons, tabs, etc. These are described below. Buttons such as Exit are shown as a lighter gray outlined area, containing the button text. Pressing on a button causes an action. Switches such as Spin are shown as text drawn on a darker gray background if deselected; and as text on a yellow background if selected. Switches may either be toggles (clicking turns them on or off), or part of a group (clicking one activates it, and turns any other switch in its group off). Intensity controls such as Morph Speed are shown with a gradated bar underneath. Clicking on the control sets the degree of intensity. If only the white square at the left of the bar is highlighted, the intensity is set to 0.

16

Tabs, such as Normal & Cavity Map, allow access to further controls in ZMapper. Clicking on a tab shows the controls associated with that tab, hiding any other tabs controls. Shift-clicking on a tab will show that tabs panel, without hiding other panels. The most common controls in the UI can be accessed with the hotkeys. These keys are indicated by a yellow letter or number in the control panel. At any point in time, clicking on the UI title barthe one at the top of the control panelwill hide or unhide the rest of the panel, to allow enlarging the area of the screen available for viewing the model.

4.4.3. Upper Controls


The upper ZMapper controls are those shown below; they are the most basic controls in the interface, and are not part of a tabbed page. The controls in the tabs will be discussed in later sections. Fi g u r e4 . ZM a p p e rUp p e rCo n t r o l s

Well go through the upper controls on a column by column basis, then talk about the tabs and open/save configuration controls at the end of this section.

4 . 4 . 3 . 1 . ZM a p p e rCo l u mn

The ZMapper column contains general controls not related to the categories defined by the other columns. These are:
Exit: Quit ZMapper. After exiting, any normal map you created will be available in the Texture palette of the main ZBrush application. ZMapper may also be exited using the Escape key. Hide:

Toggles visibility of the ZMapper UI.

Local Light:

The ZMapper preview normally shows the model lit with a fixed, predefined lighting source. When Local Light is activated, a light will be created which rotates with the model. This light source, if visible on the display, will appear as a yellow cube, as shown in Figure 5. To move the light relative to the model, click and drag it (if it is visible on the screen) or click and drag anywhere on the screen while holding down the shift key.
17

You cannot use the shift-drag method to move the light entirely around the model. Instead, rotate the model so the light remains visible, and then move the light, incrementally. When using the local light, the Diffuse Intensity slider affects the intensity of the local light. Fi g u r e5 . Lo c a l Li g h tI l l u mi n a t i o n .
The yellow light will always illuminate the model from the same relative angle, regardless of how the model is rotated (i.e. the light rotates with the model). If this view of the model were flipped vertically, you!d see the backside is completely unlit by the local light.

Opaque:

By default the UI panel is semi-transparent to enable viewing any part of the model that might be behind it. This toggles it to be opaque. Controls the grayscale intensity of the background.

Background: RenderRgn:

When active, this switch causes a render box to appear on the screen. The box may be resized by dragging on any of the four corners, and moved by dragging anywhere else in the border. In addition, dragging within the box will draw a region that further refines the render area. Once a region is created, creating a normal map will create it only in and around that region. This can be extremely important when working on specific areas, since you can evaluate changes on those areas without re-rendering the entire normal mappotentially a time consuming process. Below you can see a selected, rendered region.

Fi g u r e6 . Re n d e r i n gaS p e c i f i cRe g i o no ft h eNo r ma l Ma p

18

4 . 4 . 3 . 2 . Tr a n s f o r m Co l u mn

The Transform column controls are related to navigating around the model.
Rotate, Scale, Move: Rotate

is the default option, and if chosen, all of the various methods for viewing the object described in section 4.4.1,Navigating Around the Model, apply. If either of the other two options is selected then any of the actions described in that section cause the model to be scaled or moved, as appropriate to the selected setting. How you use these settings will depend on how often you use ZMapper, and your preference for remembering shortcuts vs. explicitly selecting actions with the UI. If you prefer the speed of the shortcuts described in section 4.4.1, always leave Rotate selected. If instead you prefer the simplicity of using just one type of action for all transforms, simply select the appropriate transform and then click and drag to perform it.

4 . 4 . 3 . 3 . Me s h Co l u mn
The Mesh column contains various options having to do with viewing the mesh:
Faceted or Smooth: Models are normally displayed using standard polygon smoothing, but choosing Faceted disables polygon smoothing in some (not all) render modes.

This allows you to see the exact relationship of an underlying area (such as a UV texture group) to the polygons it covers. Figure 7 gives an example. Fi g u r e7 .M e s h Fa c e t e d Di s p l a y .

Spin:

When on, the model will rotate continuously in the preview window. You can control the direction and speed of the rotation by dragging the mouse on the model or background. (The Transform mode must be Rotate for this to apply; see 0 above.) The speed and direction of the spin will be set by the mouse motion at the time you release the mouse button. Causes the model to be reset to its initial position on the screen. Repeatedly clicking this button will cycle between viewing angles.
19

Recenter:

Diffuse Intensity:

Slider allowing selection of the intensity of the diffuse (ambient) light source. When Local Light is on, controls the brightness of the local light.

4 . 4 . 3 . 4 . Mo r p hM o d e sCo l u mn

The Morph Modes column allows the model to dynamically morph between different representations.
Morph 3D:

Causes the model to cyclically morph between its initial geometry and a predefined morph target, if such a morph target exists. (Morph targets can be defined while modeling in ZBrush.) If no morph target exists, nothing will happen. This can be useful for seeing the interaction between an animation (as simulated by the morph cycle) and the normal map. This may reveal artifacts without the necessity of transferring all of the data over to the next 3D application in your workflow. The screenshots below try to give some idea of the effect of this very interesting tool. Basically, this morph dynamically unwraps the 3D model surface onto a 2D texture plane so that you can easily see how various parts of the model correspond to the UV mapping. Not only does show where texture seams are, but it can help you to more easily spot ways in which the UV mapping might be responsible for artifacts in the normal map.
The unwrapping of the troll below shows how various areas of the normal map correspond to areas on the model itself.

Morph UV:

Fi g u r e8 .S e r i e so fi ma g e sf r o m M o r p h UVs e t t i n g .

20

The normal map for the head below was set up using adaptive UV tiling ("AUV ! tiling) in ZBrush, which UV maps small sections of the model to appropriately sized rectangles in the normal map, ensuring minimal distortion. Compared to more standard mappings such as for the troll above, this makes more efficient use of the texture map, but gives little control over the positions of seams.

21

Freeze At Target:

When one of the two morph modes is on and this switch is activated, the morph cycle is suspended and only the other endpoint of the morph is displayed. For example, if Morph UV were on, the normal map unwrapped onto the texture plane would be shown. Controls the speed of the morph cycle.

Morph Speed:

If one of the two morphs modes is active and you want to turn off all morphing, simply click on the active morph switch.

4 . 4 . 3 . 5 .Wi r e sCo l u mn
The Wires column controls various display properties of the model by imposing lines (wires) on the rest of the model. All of these options can be toggled independently.

PolyFrame:

Shows the borders of polygons. If groups are defined, border colors reflect

this.

22

Fi g u r e9 . Po l y Fr a me M o d e l Vi e w.

TanFrame:

Shows the polygon tangent and bi-tangent1 vectors used in generating the normal map as red and green lines.

Fi g u r e1 0 . Ta n Fr a me M o d e l Vi e w.

NormFrame:

Shows blue lines giving polygon normal directions.

The bi-tangent is also called the bi-normal vector. It is (subject to adjustment during map generation) the vector orthogonal to both the normal and tangent vector at that point.

23

Fi g u r e1 1 . No r mFr a me M o d e l Vi e w.

4 . 4 . 3 . 6 .S c r e e n Co l u mn

The controls in the Screen column allow the creation and saving of screenshots showing multiple views of the same model in different poses, or with different rendering options. To obtain such snapshots: 1. Render and place the model on the screen as desired. Activate Snapshot. This will place a copy of the model on the screen background; when the model is next moved, the copy will remain. 2. Repeat step 1 as desired, to build up a screen with multiple snapshots. 3. Activate Save to prompt for a file save dialog, or Dispose to clear the screen background. Snapshots require additional video card resources, and may result in slower performance on some hardware. Below is a screenshot of two views of the troll model, one showing the normal texture and the other showing normal shading, composed into the same screen using the snapshot functionality. You can see how this would be useful for constructing thumbnail arrays for comparing poses, texturing, and so on.

24

Fi g u r e1 2 . Mu l t i p l ev i e wsc a u g h twi t hS n a p s h o t .

4 . 4 . 3 . 7 . Di s p l a yCo l u mn

The Display column, on the top right side of the control panel, allows viewing the model in various ways and also controls whether a normal map will be generated in object or tangent space
Display

slider: Changes the perspective of the model. Low intensities present the model as if it being viewed from afar with a high-powered zoom lens. High settings make it appear as if it were viewed from nearby with a wide-angle lens.
Increasing values change the shot from a distant zoom shot to a close-up wide-angle shot.

Fi g u r e1 3 . Ef f e c t so fDi s p l a y s l i d e r .

25

Object space N.Map:

Causes the model to displayed using the associated texture (if any) as an object-space normal map. As well, any normal map created while this option is on will be an object-space normal map. Causes the model to displayed using the associated texture (if any) as a tangent-space normal map. In addition, pressing Create NormalMap (Found in the first tabbed page of the interface) while this is on will cause the generated normal map to be a tangent-space normal map.

Tangent space N.Map:

Fi g u r e1 4 . Mo d e l a si two u l da p p e a rwi t hat a n g e n t -n o r ma l ma pv i e we du s i n gt h e t a n g e n ts p a c eo p t i o n , o rwi t ha no b j e c t -n o r ma l ma pv i e we d wi t ht h eo b j e c t s p a c eo p t i o ns e t .

It is possible to view a tangent-space map using the object space option, or an objectspace map with the tangent space option, but theres no point in doing so, except perhaps for curiosity.
Normals:

Shows as colors the object-space normals of the low-resolution surface as applied to the low-resolution surface. In the figure below, the upper side is green, yellow, and orange, while you can see the traces of blues and purples that are the predominant colors on the lower side. This full spectrum range is characteristic of the RGB representation of normals over the surface of an object when the normals are calculated in object space.

26

Fi g u r e1 5 . Mo d e l wi t h Normals r e n d e ro p t i o no n .

Tangents: Tangents

Same as Normals, except that the vectors calculated and displayed are the tangent vectors used in calculating the normal map.

does not display the colors of the normal vectors of a tangent space normal map. It displays the color representation of the tangent vectors themselves, where the tangents vectors are lines tangent to the surface, on which calculation of the normals depends. Fi g u r e1 6 . Mo d e l wi t h Tangents r e n d e ro p t i o no n .

UV Seams:

Uses colors to show how different areas of the model map to different areas of the normal map texture. The borders between areas of different colors correspond to seams in the normal map texture. The colors are arbitrary and do not represent vectors of any sort.

27

Fi g u r e1 7 . Mo d e l wi t h UV Seams r e n d e ro p t i o no n .

Groups:

Displays the model with its different groups shown in different colors. Groups may have been generated in ZBrush, or may have been defined in a model imported from another application.

Fi g u r e1 8 . Mo d e l wi t h Groups r e n d e ro p t i o no n .

Texture:

Shows the model with the normal map (whether tangent or global space) applied as a colored texture. This is the best way of seeing how colors in a normal map relate to the appearance of bumps on the surface.

28

Fi g u r e1 9 . Mo d e l wi t h Texture r e n d e ro p t i o no n .
This displays the color of the generated normal map. The bluish color of the map below indicates it was built in tangent space. An object-normal map would display a full spectrum of colors.

4 . 4 . 3 . 8 . Co n f i g u r a t i o na n d Pr e v i e w Co n t r o l s
Open Configuration:

Allows loading a predefined configuration file that will set options appropriate for an external program you use in conjunction with ZBrush normal maps. Configuration files can be saved for later reuse (see below), or one of many predefined files included with ZMapper can be used. When you first choose Open Configuration, youll be presented with a file selection dialog showing the contents of ZMappers standard configuration files directory. Configuration files shipping with ZMapper indicate their uses by file name.

Different 3D applications can interpret details of a normal map in different ways. In other words, while the concept of a normal map is the same across applications, there is no industry standard defining how the value of a pixel in a normal map precisely affects a final rendered image. ZMappers predefined configuration files can ease the task of finding appropriate settings for use with your own applications, and no doubt further configuration files will become available as users develop them. The list of configuration files shipping with ZMapper as of this writing can be seen below.

29

Fi g u r e2 0 .Pr e d e f i n e dCo n f i g u r a t i o nFi l e si nZM a p p e r

Save Configuration:

Use this button to save ZMapper configurations youve found particularly suited to your needs or favorite applications, and then reload them at a later date with Open Configuration.

If youve found a configuration that you think might be useful to other ZBrush users, please post it on the ZBrushCentral forum!
Preview High Resolution Level:

Superimposes a rendering of the ZBrush models highlevel mesh over top of the model in the ZMapper screen. The ZBrush model will be displayed with whatever texture is assigned to it, which will be the normal map if one has been generated. This allows easy comparison of the appearance of the sculpted mesh with the effect of the normal map on the base mesh.

4 . 4 . 3 . 9 .S u b p a n e l Ta b s(s e eb o t t o ml e f to fFi g u r e4 )
These control access to subpanels of the ZMapper interface. Those subpanels are described later. The subpanels themselves are accessed simply by clicking on the appropriate tab. In addition, Shift-clicking on a tab will open that subpanel without closing any currently open subpanels; this makes it possible to have the entire ZMapper control panel visible at one time.

4.4.4. Normal & Cavity Map Tabbed Panel


This section describes the normal map creation options found under the Normal & Cavity Map tab. These are the settings youll most commonly use to affect a generated normal map. (The Save Configuration and Open Configuration buttons were discussed previously).

30

Flip Image Vertically:

The generated normal map texture will be flipped top to bottom. Some external programs or renderers will need to use vertically flipped normal maps. Vertically flips just the red channel of the normal map. Vertically flips just the green channel of the normal map.

Flip Red Channel:

Flip Green Channel:

Switch Red and Green Channels:

Switches the red and green channels of the normal map. This is used with programs or renderers that switch the x-y coordinate space mapping of the color channels opposite to the usual way of doing things. If you find artifacts when rendering using a ZMapper normal map, increasing the Blur value may eliminate these artifacts. Try this particularly if you find black speckles in the model when displayed using the created normal map. (This has to do with limitations inherent in the process of mapping 3D geometry to a normal map representation, and will be encountered in some form in all normal map creation programs that employ the high-resolution/low-resolution subdivision correspondence used by ZBrush.) Inverse of RGB Blur. This is another control that may allow you to change the final map to be of higher quality. When renderers are processing normal map information (or almost any other type of map information, for that matter), they need to handle UV seam issues. These issues arise because adjacent polygons in the model may be mapped to areas of the normal map that are not adjacent. A renderer that in some sense averages nearby map pixels in its calculations may need to go outside the actual group/polygon area of the map in these cases. As a result, some maps (including normal maps) may need to have valid map information outside of and around the borders of the map areas actually corresponding to points on the model. This option controls how many pixels outside of a map area such information may be written. You can try increasing it to handle artifacts that appear at UV seams.

RGB Blur:

RGB Sharp:

Seam Overpaint:

While overpainting seams, ZBrush will not overpaint a map area used by another group. As a result, group areas close together on the map may not have their borders overpainted to the degree indicated by this setting. This applies particularly when using ZBrushs AUV tiles mapping, which maps into closely spaced rectangles. For optimal flexibility with seam overpainting, use it with a UV mapping that leaves larger amounts of space between group edges.
Samples, Subdivide:

These affect the quality of the final map. Higher values are likely to produce higher quality, at the expense of increased map generation time.

31

Inflat Hires Mesh Details

and Inflat Bumpmap Details: Both of these exaggerate the bumps or wrinkles in the mesh by inflating them, depending on the intensity of the settings. The first control causes inflation before any bumps have been processed into the models geometry, and so causes inflation of only geometric details; the second causes inflation after bumps have been processed into the models geometry, and so inflates both geometric and bump details. Both may be used at the same time, but doing so will often lead to artifacts. Using these settings is definitely a matter of artistic judgment. Some screenshots are shown in Figure 21 to try to give an idea of what the settings do.

If there is no bump map, then the Inflat Bumpmap Details setting will not be used. Fi g u r e2 1 . Cl o s e -u p so fe f f e c t so fI n f l a tHi r e sM e s h De t a i l s a n dI n f l a tBu mp ma p De t a i l s c o n t r o l s .
Frame 1: Inflat Hires Mesh Details = 0, Inflat Bumpmap Details = 0. This is the base model. Frame 2: Inflat Hires Mesh Details = max, Inflat Bumpmap Details = 0. Notice that the headband and some folds around the eye are more prominent, but that the headband dots (which are bump map details) are unchanged from frame 1. Frame 3: Inflat Hires Mesh Details = 0, Inflat Bumpmap Details = max. Now not only the geometric details, but also the bump map details, have been inflated. Frame 4: Inflat Hires Mesh Details = max, Inflat Bumpmap Details = max. Artifacts are clearly visible.

Sharpen Bumpmap Details:

Allows elements of the bump map to be presented more clearly, but possibly with a more pixilated effect. This is shown below.

Fi g u r e2 2 . El e p h a n te a rr e n d e r e da tl o wa n dh i g hv a l u e so fS h a r p e n Bu mp ma p .

32

Sharpen Hires Mesh Details:

Similar to the previous setting, but applies to mesh rather

than bumpmap details.


Cavity Intensity:

One commonly used technique to achieve realistic or dramatic renders is the idea of ambient occlusion, where recessed areas of a surface become darker, even if a model is lit only with diffuse light. Cavity shading is a way of simulating this effect, and of incorporating it into the generated normal map. Cavity Intensity controls the degree of this effect; higher settings will result in darker cavities. If this setting is 0, no cavity shading will be done.
The portion of the troll model shown below will be used to illustrate how the different cavity settings affect the final cavity map. This area was chosen because it has both wrinkled areas, flat areas, and blends between the two.

Fi g u r e2 3 . S e c t i o no ft r o l l u s e dt oi l l u s t r a t ec a v i t yma p p i n g .

When viewing a normal-mapped model with standard shading, its difficult to separate the effect of cavity shading from the effect of standard shading. Accordingly, in the examples below we have presented the cavity effects with cavity mapped models, rather than with normal-mapped models. Cavity maps may be created with the Create CavityMap button, described later.

33

Fi g u r e2 4 . Ef f e c t so fCa v i t yI n t e n s i t y s e t t i n g .
The three images below show the effects of rendering a cavity map with the cavity intensity set to #, $ , and % of its maximum value, respectively. Other cavity-related settings held constant. Higher settings will result in darker cavities in final rendered images.

Cavity Coverage:

Affects what is considered a cavity. In practical terms, you can think of the cavity ratio of a recessed area as the ratio of the depth of the recess to its width. The higher this ratio, the more of a cavity a recess is. As cavity coverage is increased, more recesses that are shallow in relation to their width will be considered and shaded as cavities. In particular, note the effect of this setting on the wrinkles in the relatively smooth area under the trolls collarbone.
Cavity maps rendered with cavity coverage set to approximately $, %, and maximum of full intensity, respectively. Other cavity-related settings were held constant. Higher settings will result in more geometry being affected by cavity darkening in final rendered images.

Fi g u r e2 5 . Ef f e c t so fCa v i t yCo v e r a g e s e t t i n g .

Cavity Blur:

Use this to compensate for artifacts that might appear when using cavity shading, or to cause an effect that does not follow the contours of the model as closely as it otherwise would.

34

Fi g u r e2 6 .Ef f e c t so fCa v i t yBl u r s e t t i n g .


Cavity maps rendered with a blur setting #, and % of maximum, respectively. Other cavity-related settings were held constant. Higher settings will cause cavities to appear softer and larger in final rendered images.

Raytrace, Interpolate:

Normal map generation is done somewhat differently depending on which of these modes is on. Map generation times will differ somewhat between modes. More importantly, the different generation modes may have an effect on the final appearance of the normal-rendered low-resolution mesh, depending on the tools and techniques you used when refining the model in ZBrush. (Using tools such as Nudge, which cause a vertex in the high-resolution model to be displaced significantly across a surface, compared to the same vertex in the low-res model, will be most likely to produce visible differences using these modes.) Often, the results using one method will be effectively identical to the results using the other method. Inspecting renders whose normal maps have been generated in each way is the best way to see which mode fits with your workflow.

35

Fi g u r e2 7 . No r ma l ma pg e n e r a t e d wi t hi n t e r p o l a t e dmo d e .
Details around the eyes are not quite as desired.

Fi g u r e2 8 . No r ma l ma pg e n e r a t e d wi t hr a y t r a c e dmo d e .
Note how the eyes are slightly rounder, compared with the previous picture.

Create NormalMap:

Create a normal map using the specified settings, and write it to the texture chosen when ZMapper was started. (If no texture was chosen, or one of the built-in textures was chosen, a new texture will be created with a default size.) The model will be displayed in ZMapper using the generated map, once the map is complete. Like Create NormalMap, except that a grayscale map showing the calculated cavity intensities is produced (and will be available as a texture after quitting ZMapper). This can be useful in a number of ways. Looking at the cavity map in ZMapper makes clear what effect the cavity settings have on where shading takes place, which is not obvious from inspecting a normal mapped surface. A
36

Create CavityMap:

cavity map can also be produced separately from a normal map, and modified by hand to produce other effects, before being included in the rendering pipeline.

4.4.5. Projection Tabbed Panel


The Projection panel controls projection of a normal map from one mesh to another of the same shape but with different topology. This process is discussed in section 3.

We wont describe all of the controls in detailmany of them will normally be set in the predefined configuration files that ship with ZMapper. The most important ones are:
Capture Current Mesh:

This is normally the first button activated when projecting a normal map. It sets the currently selected ZBrush subdivision model as the source mesh from which a normal map will be calculated and projected. Once the source mesh has been captured, you should exit ZMapper, choose the target mesh in ZBrush, and come back into ZMapper to project the mesh. This is used after the source mesh has been captured and a target mesh has then been selected. It calculates the normal map for the source mesh, and then projects it onto the target mesh. Once youve created your projected normal map, use this to set the captured mesh to none. This will restore the ZMapper display area and let you view the finished model. Sets the maximum distance ZMapper will cast rays from the source mesh as it tries to find a matching point on the target mesh. You may need to increase this if some parts of your models are not closely fitted. At least one of these must be set. They control visibility of the target and source (captured) mesh, respectively. If one if these is turned off, then ZMapper will not raycast out/in as it tries to match points on the source and target mesh. This may be useful if some points on the source surface can map to points on the target by both casting in and out. However, chances are that if that happens, your mesh has become folded in a way you didnt intend. At most one of these may be set. If raycasting in both directions is allowed, then setting one of these tells ZMapper that the favored direction should be used if two target points are found, regardless of distances.

Create Projected Normal Map:

Release Captured Mesh:

Raycasting Max Scan Distance:

ShowMesh, ShowCap:

Allow Out, Allow In:

Favor Out, Favor In:

The other controls set how rays are projected. There should be little need to use these, but you can experiment if the default Normal setting does not provide satisfactory results.

37

4.4.6. Expert 1 Pass and Expert 2 Pass Tabbed Panels


If youre looking at these controls, youre getting deeply into normal maps. Different applications can use normal maps in subtly different ways, and the expert options allow finetuning of normal maps to achieve exactly the desired result. Its more likely that these options will be set via configuration files than by hand. Fi g u r e2 9 . No r ma l ma p p i n ge x p e r tp a n e l s .

The expert options will not be described in detail in this document, but the next few paragraphs give an idea of some of the issues involved.

4 . 4 . 6 . 1 . Ex p e r tOp t i o n Pa s s e s
First, notice that many of the controls in the first panel also appear in the second, and vice versa. The expert options are actually applied in two passes. The Expert 1 Pass panel defines options applied in the first pass, and Expert 2 Pass defines options applied in the second pass. The duplication of some of the controls allows certain effects to be applied before or after other effects, as a matter of choice.

4 . 4 . 6 . 2 .S u r f a c eNo r ma l I n t e r p o l a t i o n
If you look at Figure 84 that illustrates the raycasting process, youll notice that the rays projected out from the low-resolution surface are not projected perpendicularly to each polygon in the low-resolution surface. Instead, the ray directions are typically interpolated in some manner, using either surface normals or vertex normals in the low-resolution surface, in order to account for the fact that the polygons are normally intended as an approximation of a smooth surface2. Casting rays straight out from each low-resolution polygon would not take into account this implied smoothness. At the same time, not all polygons or polygon boundaries should be smoothed. Some of them really do represent flat faces or sharp edges. Standard mesh file formats do not have an agreedupon method for indicating where smoothing should and should not occur, so normal map generation programs often provide options to allow heuristics during the map generation process. For example, you might wish to indicate that polygonal borders sharper than a given angle
2

Similar interpolations are also done for basic lighting of untextured polygonal models, and have been around in the graphics field for a very long time. Reading up on basic lighting models such as Phong or Blinn will lead you into methods of interpolating surface normals.

38

should be considered as sharp edges, while less sharp borders should be considered as smooth edges. In addition, polygon groups often indicate sections of a model that have sharper boundaries with respect to adjacent groups, making it desirable to allow different heuristics at group borders than at polygon borders. This may also be true at UV seam borders. A number of the expert options, such as the various PreSmooth... and PostSmooth... options relate to these issues.

4 . 4 . 6 . 3 . Ma p Di s t o r t i o nI s s u e s
Given the amount of translation that is being done from one space (such as the xy coordinates of a normal map texture) to another (such as the tangent space coordinates on the surface of a polygon), it would be surprising if angles in one space always translated into equivalent angles in another space. However, the definition in tangent space of the tangent, normal, and binormal vectors is such that they are supposed to be perpendicular to one another. In order to account for these stretching and distortion affects, adjustments to calculated vectors may be necessary during the normal map generation process. Expert options in ZMapper relating to this include the Orthogonalize... and Derive... options. If you play with these options, youll often find that changing one changes another, because there are interactions between them.

4 . 4 . 6 . 4 . Ex p e r tOp t i o n sS u mma r y
The expert options panel in ZMapper exists to compensate for the fact that other 3D applications will interpret the subtleties of normal maps in different ways. This is likely to be a general crossapplication difficulty, until standards for normal maps have been agreed on and published. This whole section on expert options was intended to help satisfy the curiosity of those who may be wondering about all of these additional controls, and to give some indication to those who may need to use expert options as to what the options relate to. Few people should need to actually get this far into normal mapping details, however. ZMapper comes with a large number of configuration files (see section 4.4.3.8) that will appropriately set all options for use with many other 3D programs. More configuration files will become available on the Pixologic website and in the ZBrushCentral forums in the future.

4.4.7. Misc Tabbed Panel


This final panel contains a few simple options that arent commonly used, or that dont fit in with the other subpanels.

Wireframe: Normal vector length

and Wireframe: Tangent vectors length: Controls the length of vector lines drawn when the corresponding view in the Wires column of the upper part of the control panel is active.
39

Activate MipMap Preview:

When active, ZMapper will calculate and use mipmaps while displaying the model. This allows you to rotate and scale the model to see if any artifacts are generated by the interplay of the mipmaps.

40

5. ZMapper Examples
This section is an introduction to ZMapper by example. It doesnt cover all of the features of ZMapper (see the reference sections for that), but it does provide detailed walkthroughs so that you can quickly and easily understand and use ZMapper on your own projects.

5. 1. Vi ewi ng a Fi ni shed M odel


ZMapper is distributed with a detailed elephant model that well use to show off many of the ZMapper features. This section covers loading a finished version of the elephant, and examining it in ZBrush and ZMapper. As well as showing how much detail can be achieved, this will serve as a good introduction to the ZMapper interface. Later sections will talk about how to construct models like this. Use these instructions to view the elephant model: 1. Start up ZBrush and make sure the ZMapper plugin is loaded, using one of the two methods detailed in section 4.1. 2. Using the Tool:Load button (i.e. the Load button located in the Tool palette), load ZMapper_Elephant_Posed.ZTL. 3. Enter ZMapper by pressing the ZMapper button. (By default it appears in the Zplugin palette.) 4. If your elephant is showing different shades of color, it means ZMapper is showing it in a display mode that does not use the normal map for shading. Press Tangent Space N.Map in the ZMapper interface. (This displays the model assuming the pre-existing normal map is in tangent space coordinates, which it should be.) At this point you should be viewing the image shown in Figure 30.

41

Fi g u r e3 0 . No r ma l Ma p p e d El e p h a n t
This is the normal-mapped, low-resolution elephant model displayed in ZMapper. The model consists of approximately 11,000 polygons.

5. Use the other features of ZMapper (rotating, spinning, etc.) to show the full detail of the elephant. (See section 4.4.1 for details on how to navigate around the model in ZMapper.) 6. Exit ZMapper and, if youd like, draw an instance of the elephant on the screen to view its geometry. As you can see, it is a relatively light model (for something of its complexity), with only about 11,000 polygons. The rest of the complexity seen in ZMapper came entirely from the normal map. You cannot generate normal maps from this model. It is intended purely for display purposes.

5. 2. Const r uct i ng a Nor m alM ap f r om a Fi ni shed M odel ; El ephant


In this section, well cover how to actually generate a normal map from a finished model. The instructions below come in two sets. The first set describes how to load a multiple-resolution model and create a normal map from it. The second set continues from where the first left off, and shows how to incorporate a high-resolution bump map into normal map creation. To create a normal map from a high-resolution/low-resolution model:

42

1. Restart ZBrush (to make sure nothing else that might have been done in it will affect the demonstration), and load ZMapper. 2. Load the tool ZMapper_Elephant.ZTL. Unlike the model used in the previous section, this model has multiple levels of subdivision. 3. In Tool:Geometry, make sure the subdivision level (SDiv) is set to 1. As was discussed in section 4.2, ZMapper creates a normal map for the models geometry at this subdivision level. Setting SDiv to 1 ensures that the normal map will be created for the lowestresolution version of the model, by comparing it to the highest-resolution version. 4. Using the Texture palette, create a new blank texture with width and height both set to 2048, and make sure the new texture is selected as the current texture. This will become the normal map3. 5. Start ZMapper. You will see a low-resolution elephant, probably with what appears to be a plain gray surface. 6. Use the ZMapper Open Configuration control to open the configuration file ZMapper_Elephant.zmp. (This gives a good set of values for creating the elephant normal map. You might want to later experiment with the various values to see the effects.) 7. Press Create NormalMap. Normal map calculations will be displayed graphically as they occur. Click OK on the report dialog that comes up after the calculations are done, and you'll see the normal mapped elephant displayed. 8. Exit ZMapper. The generated normal map is selected in the Texture palette, ready for export. This normal map was created simply by comparing the high-resolution and lowresolution versions of the elephant model. This concludes the first part of the normal map generation instructions, which illustrate how to generate a normal map by comparing differing subdivision levels of a model. This elephant isn't as detailed as the one shown in Figure 30, because the details from the bump map haven't yet been incorporated. Use of a bump map is shown in the remaining steps. To incorporate a bump map into the normal map: 9. Empty the generated normal map texture using Texture:Clear. This isnt strictly necessary, but is a good reminder that the normal map created in the previous steps isnt actually required when incorporating a bump map. Generation of a normal map using both high-resolution/low-resolution comparison and a bump map is done at the same time, and weve split the instructions into two parts simply to present the highresolution/low-resolution comparison generation method (above) independently of the use of bump maps (below).
3

The elephant is a very detailed model intended for viewing at high resolutionsin my case, full screen on a 1600x1200 display. A model taking up a smaller area of the screen will require a smaller normal map. For example, a model intended to occupy only about a sixteenth of the screen area might require a normal map of 512x512 pixels or 256x256 pixels (depending on desired detail).

43

10. From the Alpha palette, import the file ZMapper_Elephant_Bump.PSD. This is a bump map that applies to the elephant model. Well talk about how to generate such a bump map using ZBrush a bit later. If you want to examine the bump map more closely, you can bring it in as a texture (don't do this while following these instructions) and fill the canvas with it, or simply view it using Photoshop. 11. In Tool:Displacement, set Intensity to 0.05. (In general, you will likely keep this slider to small values, say below 0.1. This is highly dependent on the program producing the bump map.) This controls how strongly the height and depth of the bump will be displayed on the model, based on the intensity levels in the alpha. The appropriate value depends on both the bump map imported in the step above, and how strongly you wish the bump effect to be displayed. Some experimentation may be required in your own work4. 12. Enter ZMapper, select Tangent Space N.Map, and create a normal map. This time all of the details will be present. 13. Exit ZMapper. The finished normal map is the currently selected texture, and can be exported for use. 14. (Optional.) If you wish, draw a copy of the elephant onscreen, and then press 't' (so you'll be able to rotate it as a 3d model). Choose any of the small predefined textures as the current texture, then in the Texture palette press Clear to get a plain white texture. (This removes the coloring given to the elephant by the normal map texture.) You should now be able to see the bump map details on the elephant model. By setting the subdivision level to its highest, you can also see all of the detail that comes from the sculpting. Assuming a reasonably shaped low-resolution mesh, viewing both the bump details and the geometric details of a model in ZBrush will give you a very good idea of what the final, low-resolution, normal-mapped model will look like. Some examples of ZBrush renders of the elephant model using this technique are shown below.

One of the nicer features of normal maps is that once a normal map has been created, there is no longer a need to adjust intensity settings such as are used with bump or displacement maps.

44

Fi g u r e3 1 . El e p h a n tRe n d e r s
Elephant renders in ZBrush, with the subdivision level set to its highest level and a bump map applied. You can get a very good idea of the final appearance of the model as you work interactively in ZBrush, with only occasional use of ZMapper to check results.

5. 3. Const r uct i ng a Nor m alM ap f r om a Fi ni shed M odel ; Tr ol l


In addition to the elephant, a high-quality troll model called ZMapper_Troll.ZTL has been included with ZMapper, and you can use it to build and view normal maps in much the same way as with the elephant model. You will also find a ZMapper_Troll.zmp configuration file with which to set optimal control values for generating the normal maps. An image of this model is given below. (Note that the troll has no accompanying bump map.)

45

Fi g u r e3 2 . No r ma l Ma p p e d Tr o l l

5. 4. Cr eat i ng Bum p M aps f orZM apper


If you decide to incorporate a bump map into the normal map generation process, its likely youll look to ZBrush as one way of creating such a bump map. Below is a description of ways this can be done. ZBrushs Projection Master will be the prime tool well use to do this, so you should already be familiar with it. Projection Master has a series of tutorials built into it, which can be accessed by pressing the question mark icon in the lower right corner of the Projection Master panel. You can also find a great deal of tutorial information and documentation concerning Projection Master on the ZBrushCentral site. The basic workflow for constructing a bump map to use with ZMapper is quite simple, and goes something like this. 1. Create or select a blank texture of appropriate size. It will become the bump map. 2. Drop your sculpted, high-resolution model onto the canvas by activating Projection Master, with just the Colors option checked.

46

3. Paint a texture onto the dropped model. Color is irrelevant; it is the darkness or lightness of colors that matters. Pick up the model, rotate and drop it to paint another area, and repeat until the map is complete. 4. Press Texture:Make Alpha to create an alpha map from the texture map. ZMapper will use this alpha map as the bump map when calculating normals. 5. Set Tool:Displacement:Intensity to a value that indicates the physical height represented by the difference between pure black and pure white in the bump map. Values close to zero make bumps appear shallow, values farther from zero make them more pronounced. If you leave this value at zero, then your alpha map will not actually result in bumps on the model. 6. Create or select a texture to which the normal map will be written. Dont change the alpha map. 7. Set the model to its lowest subdivision level and start ZMapper. Create the normal map. On exiting ZMapper, the selected texture will contain the normal map, including the effects from both the low-resolution/high-resolution model comparison and the bump map. While this is not difficult, there are a few complexities we should talk about. These are more tips that will make the process easier and avoid certain problems, than they integral details of the bump map creation.

5.4.1. Viewing the Bump Map as you Create


Its often desirable to see the painting done on the bump map as bumps, rather than as a grayscale texture. There are two ways to accomplish this. For the first method, make sure that Tool:Displacement:Intensity is set appropriately. This tells ZBrush to take the alpha map into account as a bump map when it is rendering the model onscreen. (ZMapper uses the same setting in the same manner, but ZBrush and ZMapper use the value independently of one another.) Then, whenever you wish during your work, copy the texture to the alpha map. The changes made since the last such copy will appear as bumps on the surface of your model. One undesirable side effect of this approach is that the texture is also painted on the model (as a normal texture), in precisely the same places as the bumps from the alpha. This may make it difficult to properly see the bump effect. An alternative way of viewing bumps as you draw the bump map is to use the special bump map viewer material. With the Material:Load button, load BumpViewerMaterial.zmt, which can be found in the ZMaterials subdirectory of the ZBrush application main directory. This material is a special shader that interprets the grayscale level of the current texture as a bump map, rather than as a normal texture. The texture itself will not be shown, but as you paint the model the overall intensity of the colors being painted will show up as bumpiness.

47

5.4.2. Tips and Tricks for Creating Bump Maps


The following points may help in the bump mapping process. If something isnt working as you expect, come back and go through them to make sure all of the settings used in the process are appropriate. If you are using the BumpMapMaterial to view the bump map as you draw it, make sure the alpha map is blank during the painting (or that Tool:Displacement:Intensity is set to 0). Otherwise, you will get one bump effect applied on top of another, which is likely to show a view that will not be representative of the final result. Ensure that Alpha:Depth Factor setting is exactly 0 when creating bump maps. If it is not, bump effects will not show in ZMapper regardless of the value of 5 Tool:Displacement:Intensity. See the footnote for details . If you wish to create a bump map that shows effects of both coming up above the background surface and of being cut down into it, initialize the bump texture to a 50% grayscale background when starting6. Light areas will appear to rise from the background, and dark areas will appear cut into it. ZBrush by default uses black to indicate a lower area in the bump map, and white to indicate a higher area. If you wish to reverse this to suit your own preferences or needs, adjust Tool:Displacement:Intensity to a negative rather than a positive value.

5. 5. An Exam pl ef r om I ncept i on t o Com pl et i on


The following shows the creation of a simple normal-mapped model, from start to end. The result is no artistic breakthrough, but the intent is to document each step thoroughly, so that if you encounter any difficulty in normal-mapping your own model you can use these detailed

There are actually two intensity settings that can affect the normal map produced by ZMapper. The basic principle is that you should use only Tool:Displacement:Intensity to change the apparent depth of the bump map, but this deserves a bit of explanation. In addition to Tool:Displacement:Intensity, the Alpha:Depth Factor will have the same bump map effect in ZMapper, and if nonzero, will actually override any value in Tool:Displacement:Intensity. However, Alpha:Depth Factor in ZBrush affects (as might be expected) only the alpha map itselfit does not indicate how the alpha map should be applied. In ZBrush, the alpha map does not apply just to depth. It also affects, for example, intensity of a paint brush, or the degree to which masking is applied. ZMapper expects the alpha map to indicate a bump map, and so incorporates the alpha depth factor into its calculations, just as it would for the displacement intensity factor. In the main ZBrush renderer, the alpha depth factor gives no indication that the alpha map should be applied as a bump map, and so does not cause a bump effect. In addition, since it overrides any value in the displacement intensity setting, that setting will not cause a bump affect, no matter what it is set to. The displacement intensity, on the other, obviously indicates to ZBrush that a displacement effect should be applied (the use of the alpha map for this is implicit). So long as the alpha depth factor is zero, this intensity will be used as bump intensity when it is rendering.
6

Simply ensure that the primary "foreground! color in the color picker is set to gray before creating the texture. Refer to the ZBrush manuals or online help for instructions on setting colors.

48

instructions as a reference and checklist. The model will be a simple plane, with a Z drawn on it using a high-resolution model, and then a few bump patterns applied.

5.5.1. Creating the Geometry


In this section, well create the model, and apply all of the subdivision modeling that will be used. 1. Start ZBrush, or reset it using Preferences:Init ZBrush. 2. Choose the Plane3D model from the Tool palette. The default initialization settings for this tool specify a plane of 1024 polygons, which is fine for our purposes.

3. Create a polymesh version of this tool by clicking Tool:Make PolyMesh3D.

This is necessary because the Plane3D tool is a parametric object, and so cannot have multiple levels of subdivision. Polymesh tools can have a subdivision history, and this history is necessary so ZMapper can compare a low-resolution version against a highresolution version. 4. Creating the polymesh object does not automatically select it, so in the Tool palette select the new PM3D_Plane3D tool. 5. Click Tool:Geometry:Divide three times. This will give our polymesh tool four levels of subdivision, with the highest level containing approximately sixty-five thousand polygons. 6. Draw an instance of the tool on the canvas, and then hit the t key to put ZBrush into 3D edit mode. For those who are new to ZBrush, make sure to hit the t key. If you dont, ZBrush will remain in 2.5D painting mode, and none of the following will work, as the plane just drawn on the canvas will be treated as a paint stroke, and not as a 3D model to be edited.

49

ZBrush screen after plane drawn and "t! key (3D edit mode) activated.

7. Ensure that Tool:Geometry:SDiv is set to 4, so we are working with the highest-resolution version of the model. 8. Choose Transform:Layer as the geometry deformation mode.

9. Set Z Intensity to about 50 and Draw Size to about 40.

10. Stroke out a Z on the plane, like so:

And thats it for the geometry! If you want, switch to subdivision level 1 and save the model, so you can come back and complete the steps in the next section some other time.

5.5.2. (Continued) Create a Bump Map


Continuing from the last step of the previous section, do the following. (If you saved your model and just reloaded it, make sure it is set to its highest subdivision level.) 11. Set Texture:Width and Texture:Height both to approximately 256.

The odd sizes above were chosen to emphasize the fact that the bump map texture dimensions are not constrained to be powers of two, unlike the normal map texture dimensions. In a real model, the bump map width and height would almost certainly be

50

much larger than this, and would probably be between one and two times the normal map dimensions. See section 4.3. 12. Create a new texture map with Texture:New. This is the bump map texture. 13. Click Material:Load, and then navigate to the ZBrush application main folder. Go into ZMaterials and load BumpViewerMaterial.zmt.

Well be using the bump viewer material to view the bump effects in real time as we create them. 14. Press g to drop the model into Projection Master. Leave the Colors option checked.

15. Set Alpha to Brush08 (or something similar), and Stroke to Dots. Set Draw Size to about 20.

16. Draw a smaller Z inside the previous one. The result will look something like this:

51

17. Press g to pick up the object and exit Projection Master. Dont change any of the options in the Projection Master dialog. You may notice that the bumps applied in Projection Master do not look as sharp once the object has been picked up. This is due to an error on the part of your author in choosing dimensions, but I decided to leave it in since it points out an important aspect of bump maps. This is discussed in more detail in section 4.3, which you might want to skim through right now. 18. After the above, youll see a displayed texture as shown on the left below. Click Texture:MakeAlpha to transfer it to the Alpha palette, as shown on the right below.

Just to make clear whats going on here, no bumps have yet been painted. Instead, a simple grainy grayscale Z has been painted inside the previous Z. The effect of the bumps comes from the use of the BumpViewerMaterial shader as the material, applied to the created texture. The alpha has been created but has not yet been usedit will be used as the bump map by ZMapper.

5.5.3. (Continued) Create a Normal Map


These steps take up after finishing the bump map and putting it into the Alpha palette, as described previously. 19. Next, create a new texture of size 256x256. ZMapper will write the finished normal map into this texture. This illustrates a point discussed earlier, that the bump map and normal map are not the same textures, and dont even need to have the same dimensions. In fact, you probably want to make sure that you dont use the same textures for the bump texture and the normal map texture, so that you can easily go back to your bump texture and modify it. However, do note that the normal map height and width must be equal, and must be powers of two (256x256, 512x512, 1024x1024, etc.). 20. Set Tool:Displacement:Displacement Intensity to about 0.05. This lets ZMapper know the intensity of the bumps indicated by the bump map in the Alpha palette.

52

21. Enter ZMapper and open the Normal & Cavity Map tab. You may want to turn off Spin, and turn on Opaque, as shown below, to allow you to see more clearly what is going on. Select Tangent Space N.Map (this will generate a tangent space normal map). 22. Click the Create NormalMap button. Once the normal map has been generated, you will be presented with a summary dialog, and after closing that will see a preview of the normal map applied to the low-resolution model. Both are shown below.

23. On exiting ZMapper, the finished normal map will be in the texture palette. The effects of the normal map generated in this example are pretty crude (blocking is visible at the edges) because very low-resolution maps were used. This allows you to experiment with settings and very quickly re-render. It is left as an exercise to the reader to try this with higher-resolution textures to see the results.

5. 6. Pr oj ect i ng a Nor m alM ap Ont o Di f f er entTopol ogy


In this example, well see how a normal map can be generated from a sculpted ZBrush model, and then projected onto a topologically different version of the same form. This includes descriptions of how to correct for rotational and scaling mismatches.

5.6.1. Projection Example


We start with a basic, sculpted head in ZBrush. Below, the model is shown at both low and high Tool:Geometry:SDiv settings. This model is included as an example in the ZMapper distribution as FaceOriginal.ZTL.

53

Fi g u r e3 3 .Or i g i n a l Me s ha tBo t hLo wa n dHi g hRe s o l u t i o n s

With this model selected in the Tool inventory, to into ZMapper, open the Projection tab, and press the Capture Mesh button. The display will look like this, with the lines indicating the direction that rays will be cast when doing the projection. Fi g u r e3 4 .Or i g i n a l Me s hi n ZM a p p e rAf t e rPr e s s i n gCa p t u r eM e s h

After capturing the mesh, exit ZMapper. In the tool inventory, select the polymesh tool (six-pointed star) or any non-3D tool, and then use Tool:Import to import the new mesh. You need to do this because if you import a tool with a custom tool selected, the imported tool replaces the custom tool. For this example, you can find a head with a different topology in the ZMapper distribution, called FaceNewTopology.OBJ.

54

Below you can see a polyframe view illustrating the different topologies of the two head models. Fi g u r e3 5 .Or i g i n a l a n d Ne w He a d To p o l o g i e s

With the imported mesh still selected, start up ZMapper. Youll see something like this.

55

Fi g u r e3 6 .Ba c ki n ZM a p p e r , Or i g i n a l a n dI mp o r t e dM e s hS u p e r i mp o s e d

Both meshes (the original captured mesh, and the imported selected mesh) are overlaid, and since they match one another very closely, they look like one mesh. However, they are drawn with different hatchings, and if there is a mismatch, itll be obvious. Well give an example of this in a bit. Now press Open Configuration in the ZMapper panel. From the list of options, select the one that most closely matches the program and settings youre using. Click Create Projected NormalMap. The figure below shows the computed result, and compares it with the mapping on the original model.

56

Fi g u r e3 7 .Pr o j e c t e dNo r ma l Ma pa n dOr i g i n a l No r ma l Ma p


In the projected map on the left, slight differences are visible in the forehead wrinkles. This may be due to a lower polygon count in the imported mesh, in that area. Adjusting ZMapper settings may reduce or eliminate this difference, and we encourage you to consult the forums at www.ZBrushCentral.com for more information on this.

As you can see, the new projected normal map is a very close match to the normal map on the original mesh, even though the projected normal map has been built on a model that is both different in topology, and much lower in resolution (as can be seen by the head silhouettes). After exiting ZMapper, this normal map will be available in the Texture inventory.

5.6.2. Projection Troubleshooting


Here is how to diagnose and fix unusual occurrences you may encounter when using ZMapper.

5 . 6 . 2 . 1 .S c a l i n gPr o b l e ms
In the figure below, a scale mismatch shows up as the models not matching up. Its not apparent at first glance, but in fact one model is so much larger than the other that the structure with the red rays on the left is actually an ear of the larger model, which completely encloses the smaller.

57

Fi g u r e3 8 .S c a l i n gM i s ma t c h wi t hOn eM o d e l Mu c h La r g e rt h a nt h eOt h e r

To fix this, import your new model through a clone of the original model, as described in section 3.1.4. An example of this is given in section 5.6.2.4.

5 . 6 . 2 . 2 . Ro t a t i o n a l Mi s ma t c h e s
Below, weve zoomed out the view of the previous figure, and can see that not only was there a scale mismatch, but also an orientation problem; the larger head is flipped. Fi g u r e3 9 .Ro t a t i o n a l Mi s ma t c hi nAd d i t i o nt oS c a l i n gM i s ma t c h

58

To fix this, use the Tool:Preview pane, as described in section 3.1.3. An example is given in section 5.6.2.4.

5 . 6 . 2 . 3 . Te x t u r eM a p Pr o b l e ms
Below is an image typical of what youll see if you attempt to project a normal map on a model that does not have a valid UV mapping assigned to it. This will also be apparent in the generated texture map, shown in the thumbnail. Fi g u r e4 0 .Pr o j e c t i o nDo n eW i t h o u tAs s i g n e d UVs , a n d Re s u l t i n gTe x t u r eTh u mb n a i l

If you encounter such a problem, either fix the UV mapping in your external modeling program, or use Tool:Texture:AUVTiles or Tool:Texture:GUVTiles to assign new UVs to the model.

5 . 6 . 2 . 4 . Pr o j e c t i o n Ex a mp l e Fi x i n gPr o j e c t i o n Pr o b l e ms
In the previous projection example (5.6.1), the model came in without any alignment problems; if you run the example on the heads included with ZMapper, all should work smoothly as well. In the following example, the imported head was altered to have both a scaling and a rotational mismatch. (You dont have a copy of the misaligned head in the ZMapper distribution). Below are the extra steps needed to identify and correct these problems We start as with the example in 5.6.1. Everything proceeds as before (i.e. the original mesh is successfully captured in ZMapper), but the first problem is noticed when we import the new topology:

59

Fi g u r e4 1 . I mp o r t i n gt h eNe wMe s h
The new topology is inverted in the thumbnail after import.

Given the thumbnail appearance, this might lead us to suspect theres an alignment problem, so lets go into ZMapper and take a look: Fi g u r e4 2 . S e e i n gt h ePr o b l e mi nZM a p p e r

In this case, its obvious that we have not just a rotational mismatch, but a scaling mismatch as well, so lets fix both. In order not to have too many heads floating around, well start with a clean slate, so first exit and restart ZBrush, load in the original high res tool, and capture that mesh in ZMapper. Now exit from ZMapper back into ZBrush, and press Tool:Clone to create a copy of the original head. Make sure that copy is selected.

60

Fi g u r e4 3 .Cl o n eo fOr i g i n a l i sS e l e c t e d(g r a y e do u t )

Once the clone has been selected, open Tool:Geometry, set SDiv to 1, and press Del Higher. This creates a tool consisting only of the base mesh, with the same scaling as the original mesh. Fi g u r e4 4 .Ge o me t r yS u b p a l e t t eBe f o r ea n d Af t e rPr e s s i n gDe l Hi g h e r
After pressing "Del Higher!, the copy of the original mesh has only one subdivision level, the lowest level of the original mesh.

With the clone still selected, use Tool:Import to import the newer mesh with the changed topology. The imported mesh will be scaled using the same scaling factor as the copy, and will replace the copy. This fixes the scaling problem. Time to fix the rotation. First, look at the original mesh in the Preview pane. Its looking straight at us. Fi g u r e4 5 . Or i g i n a l Me s hi nPr e v i e w Pa n e

Now select the imported mesh and look at Tool:Preview. In this case, the mesh is flipped.

61

Fi g u r e4 6 .I mp o r t e dM e s hi nPr e v i e w Pa n e

So, click on the background of the preview plane, hold down the Shift key, and rotate the imported mesh until its facing forward. Then, click Tool:Preview:Store to store that position with the mesh as its global orientation. Fi g u r e4 7 .Co r r e c t i n gRo t a t i o no ft h eI mp o r t e dM e s h
On the left, we!re rotating the preview window (click-drag on gray plane) without holding down the Shift key. In the middle, the mesh has been snapped to a forward orientation by holding down the Shift key while rotating. Finally, press the "Store! button under the Preview pane to finalize the new orientation of the imported mesh.

That fixes the rotation problem. Now lets make sure you dont run into texture problems. You need to make sure the imported mesh has a UV mapping assigned. If one wasnt assigned previously, click Tool:Texture:AUVTiles or Tool:Texture:GUVTiles. Fi g u r e4 8 .As s i g n i n gaUV M a p p i n gt ot h eI mp o r t e dM e s h
You do not need to do this is your imported mesh already has a valid UV mapping.

With the imported mesh still selected, start up ZMapper. Now the meshes align, as they did in the first projection example.

62

Fi g u r e4 9 .Ba c ki n ZM a p p e r , Or i g i n a l a n d Ne wMe s h e sNo w Al i g n e d

The next steps are the same as in the original example; open a configuration file, create the projection, and exit ZMapper. Done!

63

6. Non-ZMapper ZBrush Normal Mapping Tools


So far weve focused on ZMapper, and only used ZBrush for a bit of simple bump map creation. But dont forget what you can do with normal maps using ZMapper with the full power of ZBrush behind it, or just with ZBrush alone. In this chapter, well give you a couple of ideas. Everything after that is up to you.

6. 1. Cr eat e Enhanced Det ai l i ng wi t h ZBr ush 2D, 2. 5D and 3D Tool s


Part of the power of ZBrush's pixol-based technology is just how easy it becomes to create highly realistic detail in far less time than would be possible through standard pixel-based programs. Rather than using various paintbrushes and layer filters to try and simulate the depth and shading inherent in richly textured surfaces, ZBrush makes it possible to paint such details through the use of 2D, 2.5D and even 3D tools. Aged dungeon walls, deck plating on a spacecraft, elaborately inlaid wood panels, aged and intricately carved jade, chain mail, dragon hide and many, many more effects are all easily created as both texture and normal mapsthe possibilities are only limited by one's imagination. Sometimes using ZMapper isnt even necessary to produce great normal maps using ZBrush ZBrush by itself is already well suited for producing normal maps for flat or gently curving surfaces. In the following example, we've created a seamless texture and normal map that could be used in any situation that calls for an aged wall of rough-hewn stone: dungeons, castle or hedge walls, etc. For a normal map on a gently curved surface (such as the outer wall of a castle turret), wed just apply the texture to an appropriate UV unwrapping. Fi g u r e5 0 .Co mp l e xS h a d i n g , S i mp l eCo n s t r u c t i o n

64

In spite of the apparent complexity of the finished product, its really just a single polygon, and the procedure for generating the normal map is a lot simpler than you might think, thanks to the rest of the ZBrush toolkit. Heres what we did: 1. First, a Cube3D was deformed to look like a stone block. Giving it different dimensions and details on each side made it possible to use the same block repeatedly, yet still look like many different blocks. 2. The blocks were drawn on a 2048x2048 canvas to create a seamlessly tiling pattern. (The key to achieving a seamless tiling is to only paint in the center of the canvasbeing careful to never touch the edgesand then hold down the tilde key while dragging the canvas to bring the blank edge areas to the center. By repeating this a few times, the entire canvas can be filled, and the edges will wrap perfectly. (This is discussed in more detail in section 6.2 and in the ZBrush2 Practical Manual.) The Basic Material was used in order to have access to the cavity shading features later. 3. A new layer was created and filled with the Basic Material, then the bump brush was used to build the grout in between the stones. Because the stones were on a different layer, setting the Picker palette to Active instructed ZBrush to ignore the blocks while painting on the current layer. Different alphas could be used to create the gritty appearance. 4. Once the depth was fully painted, the two layers were merged. Appropriate colors were painted with Zadd turned off and Rgb active so that only color and not depth or material would be painted. 5. All that was left at this point was to adjust the lights so as to create a non-directional effect (which can be achieved with multiple light sources along with ZMode and Unified options in the Light:Shadow menu) and alter the material modifiers to give good cavity shading. A best render was performed with the Shadows option enabled, and when satisfied with the results the canvas was captured as a texture by pressing Texture:GrabDoc. The result is a highly detailed texture with properties similar to ambient occlusion. 6. In order to create the normal map, the NormalRGBMat material was loaded from the ZMaterials folder included with ZBrush 2. It immediately replaced the material already present on the canvas, creating the shading necessary for a normal map. Texture:GrabDoc was pressed again to capture the canvas as a normal map. Thats all! The images were then ready to be tested in ZMapper or exported to an external renderer. In the illustration, the view of the wall on the right is a single quad polygon, but thanks to high quality texture and normal maps created in ZBrush, it appears to be a highly complex surface. It will also seamlessly tile, making it perfect for games. All of this was achieved with the integrated use of ZBrushs abilities3D modeling, 2D and 2.5D painting, materials, lighting, and renderingto achieve a realistic effect with little effort.

6. 2. Cr eat i ng Seam l ess Al phas and Pai nt i ng Bum p M aps


How many times have you wanted to duplicate a real-world surface, only to spend hours trying to find a satisfactory grayscale image of it to stamp as a bump map? Thanks to ZBrushs depthenabled canvas, its actually faster and easier to create your own high-quality alphas, which can be modified on the fly and used in a variety of ways; change the shape of your paint brush, paint
65

through as a stencil, stamp onto portions of your texture, or paint seamlessly to cover wider areas. Skin folds, pock marks, rough bark, wooden shingles, corrugated metal, rust, and exotic hides are all possible. ZBrush makes it easy to create any alpha that you might need for your texturing work and thanks to the tilde-scrolling feature, these alphas can be created to tile seamlessly. In this example (see Figure 51), a scale was quickly sculpted from a Sphere3D object. The Tool:Initialize menu was used to shape a low polygon sphere, which was then converted to a polymesh. Within minutes, the polymesh was reshaped, divided, and sculpted to be a simple reptilian scale. Fi g u r e5 1 . Ma k i n gs e a ml e s st e x t u r e s .
The upper right shows constructing of a scale from sphere. The numbered screenshots show how the scale was used to produce a seamless tile.

The scale was then snapshot repeatedly to a 1024x1024 canvas, being careful to stay away from the edges. When the center was filled with scales, the tilde (~) key was pressed and the canvas dragged so that the sides became the new center. This was filled with more scales, and the process was then repeated to fill in the remaining space. You can see this happening in squares 1 through 5 of the figure above. The result was a seamlessly tiled canvas, with depth that could be sampled by pressing Alpha:GrabDoc. Such an alpha can easily be modified using the features in the Alpha palette. For example, the AlphaAdjust curve can modify the levels to enhance details, or the Radial Fade (Rf) slider can be used to create a falloff at the edges for texture stamping.
66

Nearly any alpha imaginable can quickly be created in this manner. For example, the canvas can simply be filled (Ctrl+F) and then a few wrinkles drawn with Zsub active and using the tildescrolling technique. Such an alpha might look like this example:

In this case, the alpha was simply converted to a texture using Alpha:Make Tx. Projection Master was used to drop the model to the canvas, and the Deco brush was selected with the TileTexture modifier active. The nice thing about using a texture converted from a seamlessly-tiling alpha is that your brush strokes can follow the contours of the object that you're texturing, which makes it easy to paint believable details for your textures or bump maps. Another feature that ZBrush offers is the BumpViewerMaterial, which is included with ZBrush 2 in the ZMaterials folder. This material hides any color that you paint and instead displays it as bump, with the height of the bump depending on the grayscale intensity of the underlying color. In Figure 52, the Deco brush was used to paint the scales onto a spiral. The top left shows what you see when the BumpViewerMaterial is used. On the bottom right is the actual grayscale texture that was painted. Obviously, the BumpViewerMaterial makes it a pleasure to paint bump maps, since you can see the real results as you paint your model rather than trying to guess what effect each grayscale value will have.

67

Fi g u r e5 2 . Pr e v i e wi n gBu mpM a p swi t ht h eBu mpM a pM a t e r i a l


The upper left part of the image shows what you would see as you created a bump map using the BumpViewerMaterial. The bottom right of the image shows how this would render. The BumpViewerMaterial allows interactive creation of bump maps while closely representing their final appearance.

6. 3. Det ai l ed Tut or i al : Usi ng Zbr ush!s Canvas t o Cr eat e Nor m aland Bum p M aps
With this tutorial we will be using a photographic reference to create a normal map, a bump map, and a texture map that we can apply to any model.

68

Fi g u r e5 3 . Re f e r e n c ep h o t o .

Special Thanks to Clint G. Reagan who took this photo in Melbourne, Australia while working as a Pre-Visualization artist on Ghost Rider.

1. Click Texture:Import and locate and import your reference photo.


2. 3.

Click Material:Flat Color Material. Click Texture:Crop and Fill.

4. In the Layer palette: Click the orange tab at the top of the layer icon to turn off its visibility in other layers. 5. Click Layer:Create. This will create a new layer.
6.

Click Tool:Cube.

7. Set Tool:Initialize:HDiv = 16. 8. Set Tool:Initialize:VDiv = 16. 9. Press Tool:Make Polymesh. This creates a Polymesh3D copy of the parametric cube that was defined by the previous several steps. This is necessary because while parametric objects can be modified with great flexibility by varying their parameters, they cannot be edited as arbitrary meshes. 10. Select Tool:PM3d_Cube3DCopy1 (the name may be different if you had other Polymesh cubes in the tool palette). This is the polymesh tool that was created in the previous step. 11. Draw the cube on the canvas. 12. Enter edit mode by pressing t or by clicking the Edit icon on the top part of the shelf. 13. Press Tool:Geometry:Divide. This gives the new polymesh cube an additional level of subdivision, multiplying its polygon count by four. 14. In the Transform palette, turn on full XYZ symmetry by turning on the >X<, >Y<, and >Z< buttons. 15. Shape the cube into a brick:

69

Once the bricks basic form is created you might want to add details but I would wait till later to this. The idea is that we just get a basic form that we can adjust later. 16. When done modeling the brick, drop it to canvas by exiting edit mode and then pressing Ctrl+N to clear the canvas or clicking Layer:Clear. 17. In Layer turn on Layer 1 by clicking in the top left area the triangle used to be in. You may have to click twice to get this to happen. 18. Also in Layer: click Layer 2we will be working in layer 2, not layer 1. 19. Draw the brick on the canvas to the general size of the bricks in your photo reference. 20. Enter edit mode. (Press t or the Edit icon on the top part of the shelf). 21. Rotate, scale and translate the brick into position. 22. Click Transform: Move and adjust the shape of the brick to the size of the one in your reference. 23. Click the camera icon on the right of the interface or press Shift+S to drop a version of your model to the canvas. (These are both ways of invoking the Snapshot command.) 24. You can now move your model to the next brick and adjust its size while in Transform: Move mode. Snapshot it again when you are ready. 25. Continue to adjust the shape of your model and snapshot it to the canvas until all the reference bricks are covered.

When done with all the bricks, it is time to create the fill between the bricks. To do this: 26. Press Layer:Create.

70

27. In Layer, click the orange tab at the top of the layer 1 icon to hide Layer 1. 28. In Layer, choose Layer 3, then click Layer:Fill to fill that layer with one uniform level of depth. 29. Now we must adjust the fill layer to fit the bricks better. To do this, set Layer:Displace Z to about -30 and check to see if this has brought it forward too much or not enough. If it has brought it too far forward it will cover the bricks and we will not see them. A setting of -40 was necessary for this photo. If it still covers some or all of your bricks, just move it back along the Z axis with further adjustments. Positive Z moves a model back in space, Negative Z moves a model forward in space 30. Set all of the following: Tool:Single Layer Brush; Stroke:Spray Stroke; Alpha:Brush 07; and Z Intensity = about 8. 31. Turn Zadd on, and make sure that M, Rgb, and Mrgb are all off. 32. Start sculpting the fill area a little bit by creating pock marks and such. 33. Use Document:Save As to save this as file Brick_comp.zbr. You will want to keep a copy of this, with your different layers on it, in case something needs to be redone later. 34. Select Tool:Simple Brush; set MRGB on and Zadd on; and set RGB Intensity and Z Intensity to 100. 35. Click Layer:Mrg to merge the fill layer and the brick layer together. 36. Select Tool:Single Layer Brush and begin adding damage to the bricks. You can also use the smudge brush to blur the union of the brick and its fill area. 37. Save this as Brick_mrgd.zbr.

You now, have a working document with the depth you need for a bump map. Lets see what we can do with it. First, we can convert it to a normal map very easily. 38. Choose Material:FastShader 3. 39. Press Material:Load and navigate to C:\Program Files\Pixologic\ZBrush2\ZMaterials. Find the NormalRGB material and click Open. 40. Select Tool:Single Layer Brush.
71

41. In the Shelf turn on M for material and turn Zadd off. 42. Paint the material on the canvas and watch your canvas turn into a normal map just like that!

43. To capture the information, Tool: MRGBZ tool 44. Click and drag across the canvas from top left to bottom right. This will capture a bump map in your alpha palette and a normal map in your texture palette. 45. Export each of these to save them on your hard drive.

Now, lets say we need to clean up our texture because it doesnt quite fit the bricks we modeled. First, clone the photo from Layer 1 onto the merged Layer 2 46. Layer: Click Layer 1 and make it visible.

72

47. Layer: Click Layer 2 to work in that layer.


48. Tool:Clone Tool.

49. Tool:Clone. 50. Tool:Modifiers:Layers Mode set to on, everything else in Tool:Modifiers to off. 51. Draw:RGB on, turn Zadd off. 52. Draw:RGB Intensity = 100. 53. Brush the Clone Tool on the canvas to clone from the layer below it. Fill the entire canvas with the photograph below it. Fi g u r e5 4 . Cl o n i n gt h eo r i g i n a l p h o t oo n t oa n o t h e rl a y e r .

Now lets clean up the areas that dont match our model. 54. Select Tool:ClonerBrush . Set Tool:Modifiers:Layers Mode to off.

55. On the canvas, press Ctrl and click on the canvas to choose an area to clone from, then click and paint that area onto another part of the canvas. Do this to clean up the texture as much as possible. Now, to capture the texture that we have painted, we need to first make sure there is no double shading. 56. Set Light:Ambient higher until the canvas matches the original photograph you cloned from. 57. Texture:Grab Doc. 58. Texture:Export to save this texture to disk.

73

Done! You have just used a photograph to create a normal map, texture map, and bump map. Another advantage to this technique is that you can use a texture that heavily relies on tiling and within the canvas move things around to make it less repetitive. The image we worked from could as well have been tiled and we would have built our own tileable texture and normal map.

74

7. Concepts Behind Bump, Displacement, and Normal Maps


This section isnt about ZBrush or ZMapper, though they are mentioned a few times. Its purpose is to provide an explanation of the basic conceptual concepts of the normal mapping process, including how it relates to other types of rendering techniques such as bump and displacement mapping.

7. 1. Bum p M aps
Bump mapping is a technique that allows a flat polygon to presented as if it had more geometric detail. This is accomplished by applying a grayscale texture map to the polygon. The intensity of a mapped pixel is interpreted as a height above the polygon, up to a certain maximum. For example, a pure white pixel might indicate the surface of the polygon, a pure black pixel might be used to specify a height of 1/10 above the surface of the polygon, and so a 50% gray pixel would mean 1/20 above the polygon7. For various reasons, 8-bit grayscale images are usually used for bump maps. Bump maps provide far more realism than simple textures which have been just been painted to appear bumpy, since the bump map will correctly reflect light sources from any angle, while the simple texture map always appears to be lit from one angle. Bump maps give the appearance of features on a surface, but the geometry of the surface is not changed. This is apparent when a bump-mapped polygon is viewed from the side. Even though the bump map might cause the polygon to appear to have quite pronounced surface bumps or grooves when viewed head-on, the profile of the polygon viewed from the side will be completely flat. In addition, bump maps do not generate shadows. For these reasons, bump maps are best used to provide detail that is already very flat, such as the dimples in an orange.

7. 2. Di spl acem entM aps


Displacement maps can be thought of as extended bump maps. Like bump maps, they are grayscale images, with the intensity of a pixel indicating height above the polygon surface. Other things being equal, a single grayscale image used as either a bump or a displacement map while building a model will probably produce very similar images when viewed using a real time renderer. The result is different when a final render is done. At this stage, the displacement map is used to actually change the geometry of the model. Conceptually, new polygons or pixels are produced where the displacement map indicates height deviations from the polygon surface, and then this new geometry is pushed up to reflect the height of the bump map8. This new, higher-resolution model is then rendered. As a result, displacement mapping can produce renders which show both correct silhouettes and shadowing of displaced geometry, something which cannot be done by bump maps. Displacement mapping is well suited for surfaces containing complex detail that
7

There are a great many technical differences in the way different packages do this, such as using white rather than black to indicate height, but conceptually, they are all the same.
8

Remember, this is only a conceptual model of displacement mapping. The graphics industry has come up with many clever and subtle ways of speeding up these types of processes. The actual techniques used to accomplish displacement mapping may differ from the ideas presented here.

75

would be difficult and expensive to model with polygons, but where the displacement is large enough that bump maps would obviously appear fake. There is currently little hardware support for displacement maps, so they are typically used with software renderers. (This may change in the future.) Bump maps and normal maps are both well supported by modern video cards. Any of these tools can provide very realistic effects in cinematic and other non-real-time renders, allowing both decreased overall render times, and greater ease of model construction. Fi g u r e5 5 . Co mb i n e dma p s(t h r e ei ma g e s ).
ZBrush was used to create a normal map, displacement map, and diffusion map for this figure. Rendered with Maya!9/Mental Ray!10:
Credits: ZBrush Forum member "sunit!, see http://206.145.80.239/zbc/showthread.php?t=21774 for details.

The high-resolution mesh was 1.5 million polygons in ZBrush:

Maya is a registered trademark of Alias, Inc. Mental Ray is a registered trademark of mental images, Inc.

10

76

The low-resolution model was just a little over 7000 polygons. (Shown in Maya):

77

7. 3. Sur f ace Nor m al s and Li ght i ng


A surface normal for any flat surface is simply the arrow (or direction) that points directly out from that surface. The angle between that arrow and any line drawn on the surface from the starting point of the arrow is exactly 90 degrees. Put a piece of thin white cardboard on a desk, put the eraser end of a pencil on the cardboard, and point the pencil straight up. The pencil is now a pointer in the direction of the cardboards surface normal. Fi g u r e5 6 . S u r f a c en o r ma l f o rah o r i zo n t a l p i e c eo fc a r d b o a r d .

If a flat surface is oriented so that its normal points towards a light, that surface will be lit brightly by the light. If the surface is turned so that the normal points farther away from the light, it will become darker. If the surface normal points more than ninety degrees away from the light, the surface will not be lit at all. The white cube below shows this. Fi g u r e5 7 . S u r f a c en o r ma l sa n ds u r f a c eb r i g h t n e s s .
Interaction of light direction with the surface normals of a white cube. The normal of the top surface points close to the light, and so that surface is the most brightly lit. The normal of the right surface points farther away from the light, and is less brightly lit. The normal of the front side points more than 90 degrees away from the light, so it is dark.

When a renderer calculates how brightly a light illuminates a surface, it (almost always) does it with a simple mathematical calculation involving the angle between the surface normal and the direction of the light. All of this may seem obvious, but theres an important point here: Lighting calculations are done using the direction of the surface normal, not the orientation of the surface. This makes no difference as long as the surface normal does in fact point straight out from the surface. But if we simply give to the renderer a different value of the surface normal, we can change the apparent intensity with which the surface is lit, and hence the apparent orientation, without changing the
78

actual surface orientation at all. This is the basis of normal mapping, and is discussed in detail in the next section.

7.3.1. Surface Normals with Specular and Reflective Lighting


The previous explanation actually applied to just one type of lighting model, diffuse lighting, where the surface being lit is assumed to scatter incoming light equally in all directions. Another common type of lighting model is specular lighting, which produces the highlights on smooth or semi-smooth surfaces such as the bright spots on a billiard ball. Specular lighting is a model that assumes light is reflected with some degree of directionality, rather than scattered perfectly in all directions. We wont go into details, but surface normals can also be used to calculate specular lighting. Basically, the specular brightness depends on the angle between the surface normal and the average of the direction between the light and the camera. This average direction is easy to visualize. Imagine you are on a stage, being lit by one spotlight, with one person in the audience. Now point halfway between the person and the spotlight. Thats the average direction between your viewer and the spotlight. Reflective lighting is a special case of specular lighting. Its specular lighting having no (or negligible) scattering. Images reflected in a mirror or off the surface of a still pond are examples. For realism, reflections are often computed differently than specular lighting, with the aid of a reflection map. Again without going too much into details, this can be handled with normal maps. From a point on the surface, the direction to the camera is flipped (rotated 180 degrees) around the surface normal, and the new direction is used to look up the color and brightness in the reflection map.

7. 4. Sur f ace Nor m alPer t ur bat i on


As stated earlier, a surface normal at a point is defined to be the direction pointing directly away from the surface at that point. But for the purposes of calculating surface brightness, we can perturb a surface normal at any point on a polygon. This simply means that we can pretend the surface normal at that position points in a direction different from the true surface normal. A perturbed surface normal can point in any direction at all. To do this, the direction of the surfaces true normal at each point on the polygon is altered using the information from the normal map. The precise mathematical meaning of the phrase surface normal is whats been given and used previously in this section (i.e. the direction pointing directly away from the surface), but in graphics surface normal usually means whatever direction is used when doing lighting calculations. From now on, well use the graphics meaning, not the mathematical meaning, and in other sections of the paper, the phrase is also used in its graphics, not its mathematical, form. This process can be illustrated by taking the top face of the cube from the Figure 57, dividing it into four smaller sections, and changing the surface normal in each section. Each section appears with greater or lesser brightness as a result.
79

Fi g u r e5 8 . No r ma l p e r t u r b a t i o na n de f f e c to nl i g h t i n g .
The surface below is a single flat quadrilateral, divided into four areas. The surface normal in each area for the purposes of lighting calculations (shown by the arrows) is a perturbation of the true surface normal for the quadrilateral. As a result, each area is lit with a different intensity, since brightness is calculated as a function of the angle of the normal to the light direction. In a rendered image, this can give the illusion that different areas of a surface are at different angles, even though the surface is completely flat.

7. 5. Bum p M aps and Sur f ace Nor m al s


Lets talk a bit about surface normals as they relate to bump maps. Bump maps are actually converted to normal maps (invisibly, either by hardware or software) before being drawn on screen, If you understand this process, you understand normal maps. To see this in action lets look at a single row of pixels from a bump map. The following examples will use lighter colors to indicate higher areas on the bump map, but some applications may do exactly the opposite. The concept is still the same. The steps below are a conceptual presentation of how bump maps are converted to surface normals. Renderers or hardware may accomplish this in different ways. Also, the example below creates two-dimensional normals (pointing in the x-y directions). A full two-dimensional bump map would result in three-dimensional normals. Fi g u r e5 9 . Pi x e l r o wf r o mb u mpma p .
A row of pixels from a bump map, looking down. Lighter colors represent higher elevations in this map.

80

Fi g u r e6 0 . Co n v e r t i n gb u mp i n t e n s i t yt ob u mph e i g h ta n dn o r ma l s .
The same bump map, viewed from the side. This shows how (in concept) pixels are raised in height according to their color. A curve is fitted to the resulting profile, and at each coordinate, the normal to that curve is calculated.

Fi g u r e6 1 . Re s u l t i n gn o r ma l sa s s i g n e dt op i x e l l o c a t i o n s .
The resulting surface normals associated with each pixel, viewed from the side. Once these have been calculated by the hardware or software, the bump map height information is discarded, and the normal directionswhich are all that matter for lighting calculationsare retained. The lengths of the normals are not meaningful in this example.

Its often easier to create a bump map via painting than to model the detailed geometry with polygons. In addition, bump maps significantly speed the rendering process, compared to rendering a model with a polygon count high enough to represent the bumps geometrically. In the case of hardware, this can allow the presentation of bumpy surfaces while still animating in real time.

7. 6. Nor m alM aps


From the preceding section, we know that a bump map is processed by calculating a surface normal at every point on the mapped polygon, using the heights given by the bump map. This normal then interacts with light sources to produce the illusion of bumps or other surface irregularities, even though the polygon is perfectly flat. A normal map is just a map (texture) where the values given are the surface normals at each point, rather than the bump height value. Were taking out the middleman, so to speak. Instead of having graphics software or hardware calculate surface normals from the bump map, these normals are pre-calculated and stored into the normal map, and then used directly by the processor. The figure below shows this. It is a cross-section of a normal map, 16 pixels wide. No height is shown because the normal map does not store any height information. It just stores directions to be used as surface normals when lighting calculations are done.
81

Fi g u r e6 2 . A Ro wo fPi x e l si naNo r ma l Ma p .
Cross-section of a normal map sixteen pixels in width. No height information is contained in the normal map, only normal directions. Adjacent normals are completely independent of one another.

This makes things slightly easier for the graphics processor, though that isnt usually important. More importantly, normal maps have certain technical advantages over bump maps, which in many instances can lead to better surface detail. In particular: Bump or displacement maps require a specification of the world unit dimension indicated by the map intensity. (In other words, the height displacement between the maximum and minimum values of a bump map must be specified in world coordinates such as inches, and this must be done for every bump map.) This may require adjustments when transferring such maps from on program to another. This is not necessary for normal maps, since they do not refer to absolute world distances. Because the normal at each pixel in a normal map is completely independent from its neighboring normals, normal maps can produce effects not possible with bump maps, while still being able to do everything that can be done with bump maps.

On the other hand, bump maps can be created (somewhat) easily by hand using a 2D paint application, which is not case with normal maps. (See below.) You will find each useful in your creations, depending on requirements.

7.6.1. Representing Normal Maps as Textures


A normal is just a direction in spacea vector with three coordinates, usually called the x, y, and z coordinates. To create a normal map, we need to store these three coordinates at each pixel in the map. Instead of defining a new file format just for this, a simple trick is used. Standard 32-bit images (such as used in many image processing programs) contain four channels of data; one for the red component of the pixel, one for the green, one for the blue, and one for the alpha (which is usually used for transparency). Each of these channels is 8 bits wide, meaning each of them can store one of 256 distinct values. The x, y, and z coordinates of a vector at a given point can simply be stored in the red, green, and blue channels of the pixel at that point. When used in this way, the alpha channel is ignored. Now every point in the image has a normal direction associated with it, and normal direction is indicated by color in the normal map. This is quite different from bump maps, where normal direction is given by the intensity difference between nearby pixels. One result of this is that normal maps are not suited for creation by hand. In a normal map, the general shape of what will appear on the rendered surface is apparent, but visualizing the exact effect or constructing the map by hand is difficult because of the interplay of the color channels.
82

Constructing a bump map by hand is at least possible, as the grayscale intensities correspond to bump heightthough it is very difficult to visualize the exact effect without a render. To see this, look at Figure 63. The left wall is a normal map of a brick surface, the right wall is an equivalent bump map, and the center cube shows how surfaces would render when either map is applied. The normal map actually shows the grain of the brick surface much better than the bump map, but the necessity of getting the right color at each pixel makes it almost impossible to paint by hand. The small differences in bump height over small areas make the bump map look smooth, but it could still be painted with an appropriate brush to give an almost invisible graininess to the texture. Fi g u r e6 3 . No r ma l a n dBu mp M a pTe x t u r e sa n dRe n d e r
Normal map (bluish) on the left, bump map on the right, cube mapped with either in the center. (Both the normal map and the bump map will produce the same visual result when rendered.)

7.6.2. Normal Map Generation


This section discusses various ways of generating normal maps. Raytracing is the dominant conceptual model of normal map generation and is the focus of many of the normal mapping tools that have appeared recently. ZBrushs multiple subdivision level editing can also be used to generate normal maps in a different manner, with more accurate results.

7 . 6 . 2 . 1 . Co n v e r t i n gFr o m aBu mp M a p
One of the easiest ways to generate a normal map is to calculate it from an existing bump map. There are various tools to do this, and we wont go into them here. As well as being very simple when it is applicable, this method allows you to use existing bump maps, instead of taking the time to construct new normal maps. There may seem little reason to do this, but as was mentioned before, one advantage that normal maps have compared to bump maps is that while bump maps require additional information describing how the bump intensity range maps to global space distance units, normal maps do not. If you are finding this to be a disadvantage when working with bump maps, converting to normal maps may well make sense.

83

There are disadvantages as well, in normal maps through simple conversion of bump maps. Bump maps cannot express as much directional information as a normal map of the same resolution, and so the visual effects available from a converted bump map may not be as striking as those available from a normal map constructed directly. Normal maps also contain implicit information about object space, tangent space, and the like. Bump maps do not carry such information. As a result, conversion of bump maps is likely to be easy only when the map is one for a flat surface, such as a wall. Other cases may be more problematic.

7 . 6 . 2 . 2 . Ra y t r a c i n g /Ra y c a s t i n g
A useful way of thinking about normal map generation is the idea of raytracing, or raycasting. (Both words are often used in describing this particular technique for normal map generation. The terms come from the raycasting and raytracing methods of rendering, to which they are similar.) The raytracing method projects rays (the thin solid arrows below) from the surface of the lowresolution mesh (thick lines) to the surface of the high-resolution mesh (thin curve). The normal direction at the end of each ray is used as the normal vector value in the normal map UV coordinate at the start of the ray. Fi g u r e6 4 . Ra y t r a c i n g
Rays (solid arrows) are projected from the low-resolution surface to the high-resolution surface. At each point a ray intersects the high-resolution surface, the normal (perpendicular) to the highresolution surface is calculated at that point, and then applied to the low-res surface as the surface normal at the origin of the initial ray.

Conceptually, this is fairly accurate, but it leaves out a great many details. The most important of these is how points on the low-resolution surface are associated with points on the highresolution surface. One way of doing this is to simply create two otherwise unrelated meshes having the same shape as each other, and to fit the low-resolution mesh inside the highresolution mesh to generate the map. This may involve ensuring that the mesh rotations are completely identical, that all parts of the low-resolution mesh are inside the high-resolution mesh, and so on, depending on the tools used to do this. Achieving this degree of conformance can be extremely difficult for meshes with any type of shape complexity, such as arms with hands and fingers.

84

ZBrush can use the raycasting method (see section 3), but normally uses a different scheme to map points from the first mesh to the second. The subdivision relationship between the highresolution mesh and the low-resolution mesh is used in matching areas of the surface. This reduces and in many cases eliminates the problems described in the previous paragraph.

7.6.3. Normal Maps in Tangent and Object Space


A normal map specifies the direction of surface normals at points on polygons throughout the model. Direction is relative, however; if we say a normal is pointing up, do we mean up towards the top of the model, or up away from the surface of the polygon? In normal mapping, maps can be created using either type of direction. A normal map which assumes that up is straight up in the model coordinate space is said to be in object space, while a normal map which specifies directions relative to the faces of the polygons to which it is applied is called a tangent space normal map. Figure 65 and Figure 66 show the effect of this when a (very simple) mesh with assigned surface normals is deformed11. In the first case (using object space normals), even as the rightmost polygon changes its orientation, its brightness does not change, because its normal direction does not change with the polygon. This is not what you would expect with real world lighting, and illustrates why object space normal maps are not what you want to use if your mesh will deform. The second figure shows how tangent space normals will change direction along with their surfaces, and give the expected changes in surface brightness. Fi g u r e6 5 . Ef f e c to fDe f o r ma t i o no nLi g h t i n gwi t hOb j e c tS p a c eNo r ma l s
On the left of this figure, two adjacent squares are on the same plane, making a flat surface. For lighting purposes, each is assigned a different object space surface normal, so intensity with which each is lit is different. On the right of the figure, the square with the normal labeled "B! has been rotated clockwise. Because both normals are defined in object space, their directions remain the same with respect to the object (which itself has not been rotated), and so to the light source. The lighting intensity on each surface remains the same, regardless of the rotation of the right polygon.

11

This example assigns just one normal to each polygon. In actual use, normal maps will assign many normals of differing directions to various points on a polygon. The principle remains the same. Object space normals will not rotate along with their surface, while tangent space polygons will.

85

Fi g u r e6 6 . Ef f e c to fDe f o r ma t i o no nLi g h t i n gwi t hTa n g e n tS p a c eNo r ma l s


As in the previous figure, one of the two squares has been rotated clockwise. In this case the normals are defined in tangent space, meaning that whenever a surface changes orientation its associated normal changes direction along with it. The result is that the light intensity on the rotated surface changes as one would expect.

One interesting effect of these two different interpretations of the normal map coordinates is that tangent space maps always appear bluish in color, while object space maps typically exhibit a full spectrum of colors. The reason is that in either type of map the normal will point away from the polygon, as a normal pointing behind the polygon would have no meaning. But in a tangent space map, away from the polygon means that the z coordinate at that point will always be a positive number. Since the z coordinate of a normal map is stored in the blue channel of the normal map texture, blue becomes the dominant color.

7 . 6 . 3 . 1 . Ob j e c tS p a c eM a p Us e s
Object space normal maps can be applied to any object in which the orientation of the polygons relative to the model does not change. This typically means any rigid model. The model may be moved, scaled, or rotated, but not deformed12. Terrain, furniture, bas-reliefs, dueling swords or a door swinging open could be shown very effectively with an object space normal map, using the normal map to generate the details of the blade and pommel of the sword, or gouges or wood grain in the door. Object space normal maps are easy to generate, and will likely require little if any tweaking to achieve the desired effect and to remove artifacts. They are also computationally quite efficient. Generating an object space map using ZBrush is simply a matter of selecting the appropriate option in the ZMapper plugin. Details are given in other sections.

12

You may see references to a third type of normal map called a world space map. World space maps are similar to object space maps, except that they are defined in the global (world) coordinate system rather than in the object coordinate system, meaning they cannot be used with rotating objects. In practice, the difference between world space and object space normal maps is a simple calculation involving little computational cost, so there is seldom a reason to use world space maps.

86

7 . 6 . 3 . 2 . Ta n g e n tS p a c eM a p Us e s
Tangent space normal maps can be applied to any object, but are required with models that might be animated or deformed (other than through simple scaling). Given how commonly ZBrush is used for organic modeling and how often these models will be deformed, you will likely be generating mostly tangent space normal maps. This is simply a matter of choosing the relevant option in ZMapper. Compared to world space normal maps, tangent space normal maps require significantly more computational power to render (though its difficult to predict how much this will affect performance in practice). In addition, they may require quite a bit more tweaking to give you the desired end effect in other applications or renderers. This is more a matter of the fact that working with deforming meshes is always more complex than working with rigid meshes than it is of the conceptual differences between the two types of normal maps or differences in the way they are handled by ZBrush.

7 . 6 . 3 . 3 . Ho w Do e sYo u rAp p l i c a t i o n Di s t i n g u i s h Be t we e n Ta n g e n ta n d Ob j e c tS p a c eNo r ma l Ma p s ?


Theres a simple answer to this one; your application doesnt. A normal map is just a 2D picture where colors represent directions. Its usually easy to distinguish the two visually (a tangent space map will be predominantly blue in color, while an object space map will usually have a full range of colors), but even this is no guarantee. Certain object space maps could look bluish in the same way as a tangent space map. Instead, you will simply generate whichever type of map is most appropriate for your model, and then inform your application how to interpret that map relative to the object it is applied to. Depending on the application, this may involve using different shaders, setting a checkbox, or various other methods.

7 . 6 . 3 . 4 .S u mma r yo fOb j e c tS p a c ea n d Ta n g e n tS p a c eNo r ma l Ma p s


Theres nothing in this section you havent seen before, but you may find it a convenient summary. Tangent space and object space normal maps are simply 2D images where colors are interpreted as directions. A major advantage of normal maps over bump maps is that normal maps are not given in terms of distance, and hence do not require adjustment for changes in distance units from one application to the next. In a tangent space normal map, the direction indicated by a pixel in the map is taken to be relative to the surface of the polygon to which that pixel applies. In an object space normal map, the direction indicated by a pixel is given in terms of the objects coordinate system. Tangent space normal maps can be used with either rigid or deformable objects, but have a higher computational overhead than object space normal maps. Object space normal maps are only useful with rigid bodies (unless you are trying for some truly

87

psychedelic effects), but are faster to render than tangent space normal maps. Youll normally generate object space normal maps for rigid models. You may see references to world space normal maps. These are simply object space normal maps where the object is the entire world. The computations needed to use a world space map as an object space map are trivial, and generally there is no need to use world space maps. Humans can usually visually distinguish object maps and tangent maps (tangent maps will appear bluish), but to rendering software or hardware they are simply maps. Youll specify explicitly in your application whether a map should be applied as an object space map or a tangent space map.

7.6.4. Cavity Shading


Well briefly mention one more rendering aspect here, since it can be incorporated into normal maps by ZMapper. It is cavity shading. Cavity shading is a method for implementing an ambient occlusion effect, and ambient occlusion is in turn the visual effect that we all see (but rarely notice) when looking into shallow crevices; theyre darker. It isnt really shadowing, since it occurs even in diffuse light where shadows arent cast. It has more to do with the fact that as light is reflected into a recess, and then back out, the intensity of the light becomes lower due to absorption by the surface of the recess. This has nothing whatsoever to do with normal maps, except that it turns out to be easy to modify normal maps to include this effect. Or, to put it another way, if cavity shading is calculated at the same time a normal map is generated, then the data necessary to accomplish the cavity shading can be put directly into the normal map. Rendering it later will require no more data, and no more time, that would rendering with a normal map that did not include cavity shading. The mathematical details are of interest only to the analytically inclined13. From an artistic viewpoint, it is much more important that ZMapper does include cavity shading as an option, and this is discussed more thoroughly in the ZMapper instructions.

13

Such as your author, who would dearly love to explain the details, but will restrain himself as he understands that sentences like, "renderers generally assume that a surface normal is pre-normalized, so using a non-unit vector in a normal map can affect the final light intensity,! do not necessarily inspire fascination in the user community.

88

8. ZMapper Cheat Sheet


8. 1. Cont r olPanel s
All of the ZMapper control panels are shown below. Shortcut keys are indicated by yellow key identifiers within or beside a control name. (You may need to refer to the reference below to see shortcut keys that are already highlighted in yellow.)

8. 2. M odelNavi gat i on wi t ht he M ouse


Rotate Model: Click and drag on the model or display background. If the Spin button in the control panel is on, the model will continue to rotate in after the mouse button is release, in the direction of the drag. The speed of the rotation corresponds to the speed of the mouse at the end of the drag. Move Model: Hold down the space bar and click and drag the mouse on the model or background. Zoom Model: Right-click and drag on the model or background. These actions may also be accomplished by activating the Rotate, Scale, or Move buttons and then dragging on the background.

89

8. 3. Keyboar d Shor t cut s


Ac t i o n Ge n e r a l
Exit Hide Opaque x or Esc Tab q

Ke yo rS h o r t c u t

Mo d e l Na v i g a t i o n See also Model Navigation with the Mouse above.


Rotate Scale Move Spin Recenter r e w i w

Me s h Vi e wi n g
Smooth Faceted h d

PolyFrame TanFrame NormFrame

f a m

Object Space N.Map Tangent Space N.Map

1 2

The two options above also control what type of normal map will be generated.

Normals Tangents UV Seams Groups Texture

3 4 5 6 7

Activate MipMap Preview

Shift-K

90

Ideally, if this is activated, you will see nothing different in your model. When this is activated, OpenGL mipmaps are generated internally and used, so you can see if they might result in artifacts in final use. Mo r p hM o d e s
Morph 3D Morph UV Freeze at Target p u z

If the morph speed slider is set to 0 and the Morph UV view is activated, the display will show a fully unwrapped (i.e., flat) map. Li g h t i n g
Local Light l (ell)

If the local light is on, then the Diffuse Intensity slider controls the intensity of the local light. Click and drag the light (yellow cube), or shift-click and drag anywhere on the screen, to move it. Co n f i g u r a t i o nFi l e s
Save Configuration Open Configuration s o

Ma p Cr e a t i o n
Create NormalMap c

If a mesh is currently captured, c creates a normal map via projection.


Create CavityMap t

91

2005 Pixologic, Inc. All rights reserved. Pixologic and the Pixologic logo, and ZBrush and the ZBrush logo, are registered trademarks of Pixologic, Inc. All other trademarks are the property of their respective owners

92

Вам также может понравиться