Professional Documents
Culture Documents
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
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.
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.
3.
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.
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.
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.
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.
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. 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. 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.
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.
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.
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.
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.
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.
13
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.
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.
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.
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:
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.
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:
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
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.
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
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.
30
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.
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
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.
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
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
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.
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.
ShowMesh, ShowCap:
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
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.
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
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.
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.
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.
45
Fi g u r e3 2 . No r ma l Ma p p e d Tr o l l
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.
47
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.
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.
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.
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.
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.
53
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
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 . 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
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
The next steps are the same as in the original example; open a configuration file, create the projection, and exit ZMapper. Done!
63
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.
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
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.
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
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. 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.
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.
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
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.
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.
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.
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.
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 . 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.
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
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.
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.
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
89
Ke yo rS h o r t c u t
Me s h Vi e wi n g
Smooth Faceted h d
f a m
1 2
The two options above also control what type of normal map will be generated.
3 4 5 6 7
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
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