Box Modeling and Precision Texturing
From ZBrush Info
Contents |
Introduction
This page contains three related minitutorials:
- The first gives an example of box/edge loop modeling.
- The second uses the model from the first example to show how "sharp-edged" textures may then be generated for renders in ZBrush.
- The final shows to to paint your models to ensure that your textures will render with clear edges in other 3D programs.
Box and Edge Loop Modeling (Build an Airplane)
This tutorial is going to illustrate how to create and texture a cartoon-like airplane similar to the one that Hiroshi Yoshii posted inthis thread. For the record, I don't know what technique Hiroshi himself used to model the airplane. It might be the same as mine, or he might have done something different. Also, he did not texture his airplane like we will. Instead, he snapshot it to the canvas in the final position for his picture and then painted the color in 2.5D with the Single Layer brush. So we're not going to create an exact replica of it; just something similar. Along the way, we'll cover some little-known topics such as box modeling with ZBrush 2's Edge Loops feature and how to get really clean lines in your textures.
"Box Modeling" is a term that comes from points-modeling programs. The premise is that you start with a simple cube and through a series of extrusions create a cage mesh. Although this low poly cage looks really chunky, placing it inside of a hyperNURBS will smooth it out to create a nice, organic shape. What a lot of people don't realize is that ZBrush 2 is capable of doing exactly the same thing! What's more, under the right circumstances this technique is faster and easier than using ZSpheres or another modeling technique. This was one such case (for me, anyway).
Creating a Cube
First, box modeling requires that you start with a cube. Also, the Edge Loop command is only available for polymesh objects. So you can't just take a Cube3D parametric object and go to town. It's not a polymesh, and its polygon structure is unsuitable for box modeling (the poles would create problems). To create the cube that you will actually model with, follow these steps:
- Select the Cube3D
- Set Tool>Unified Skin>Resolution to 8 (the lowest value).
- Set Smt to 0 (to activate cubical skinning).
- Press the Make Unified Skin button. This creates a new model in the Tool palette called Skin_Cube3DCopy1.
- Draw the new cube on the canvas and activate the Polyframe view. As you can see, it is now a polymesh object and the poles are gone. The only catch is that it has too many polygons.
- Press Tool>Geometry>Reconstruct Subdiv. This will add a new subdivision level to the cube below the current level. Press the Lower Res button to go to that level. The cube now has half the number of polygons, and the Reconstruct Subdiv button is once again available.
- Repeat the previous step a few more times until you're left with a cube made up of one polygon on each side.
- We no longer need the higher subdivision levels, so delete them by pressing Del Higher.
We're now ready for box modeling! Before proceeding, though, take a moment to save your cube. That way, you'll have a pre-made starting point for your own box modeling projects.
The Edge Loop Command
Now that we have our starting cube, let's take a quick look at the Edge Loop command. Under normal circumstances, this command creates a loop of polygons around the perimeter of the visible mesh. This is known in most other software as an Inner Extrusion and is shown below in figure 1.
What a lot of people don't realize is that the same command can add polygons to your mesh another way, as well. How this works is that if you move any points on a partially hidden mesh before pressing the Edge Loop button, ZBrush will create new polygons to fill the gap between the original position and the new one!
- Moving just one point will create triangles. As you can see in figure 2, By moving one corner of the polygon, ZBrush has filled in the space between that point's original position and the new one.
- Moving two adjacent points will create a quad and triangles, both (figure 3).
- Moving an entire face will result in all quads (figure 4).
As the rest of this tutorial will show, this technique is a very powerful way to quickly build geometry. Let's put it to work.
Modeling the Airplane
Back Half
We'll begin by creating the back half of the airplane.
- To do this, select one of the cube's polygons, which will also hide the rest of the cube (1).
- Be sure that you're in Edit:Move mode, and set your Draw Size to 1. This allows you to move individual points. Here, I have X and Z symmetry active so that I can move all four points together (2).
- Click and drag far to the right, moving the polygon away from its starting position as part of the cube. At the same time, it's size is reduced (3).
- Now, pressing the Edge Loop command results in four new quads being added to the mesh. These fill the space between the polygon's original position and its new position (4).
- Here's the cube with visibility restored (5). If, when you restore visibility you find that the points aren't right where you want them (which will often be the case), just move them now with the mesh fully visible. You can move points at any time, even if you later find that you need to make changes. The Edge Loop command only adds geometry if points have been moved on a partially visible mesh
- Repeat the process with the same polygon, to add the tail section (6). And once more to give the tail a softer end.
- Now let's simulate placing the model in a HyperNURBS object. We do this simply by pressing the Divide button a few times (7).
- In this case, I feel that the body is a little too small in relation to the tail. Press undo a few time to delete the higher subdivision levels. Then move the body points to make that part of the plane larger (8).
Cockpit
Next up is the cockpit.
- Begin by selecting just the polygon that forms the top of our original cube (1).
- We want the cockpit to be set in a bit from the sides of the plane, so doing an inner extrusion by pressing the Edge Loop button (2).
- Hide the outer ring by Ctrl+Shift+Clicking on one of the outermost corners. Since all of the polygons of the outer ring belong to the same group, they will disappear and leave you with only the inner polygon (3).
- You may notice at this point that you can only get a single axis of symmetry to work (you'll certainly see it in later steps). Anything else leaves points "flying in the wind," so to speak. You have two choices at this point. You can simply work with pairs of polygons across the X axis, or you can press the S.Pivot button on the right shelf. This button resets the model's pivot point to be the center of the visible mesh. With only one polygon visible, that means that the pivot point will be the center of that poly. Since symmetry is based off the pivot point, you can now use two axes of symmetry to move all four points together. This can be a very handy trick at times! To restore the mesh's original pivot point, just press the C.Pivot button when you're done.
- Now move the entire polygon up a bit and then press the Edge Loop button again (4).
- Once again, hide the group of new polygons by Ctrl=Shift+Clicking on one of the lower corners (5).
- Add another Edge Loop to the one remaining polygon (6).
- Hide the outer ring (7).
- Move this polygon down and then add another Edge Loop (8).
- Restore full visibility by Ctrl+Shift+Clicking on the canvas. You should now have a structure that looks like the illustration (9).
- When the mesh is divided, this gives us a nicely-smoothed cockpit area (10).
Wings and Tail
- Delete the higher levels again and select the polygons making up the sides of the body. Without moving them, add an Edge Loop. Since the polygons are non-contiguous (they don't connect to each other), each will receive its own ring of new polygons (1).
- Restore visibility, and then move the points for the inner polygon to become the base of the wings (2).
- Repeat the process for the sides of the tail (3).
- And again for the top of the tail (4).
- While we're at it, go ahead and add an edge loop to the front as well, for what will become the nose (5).
- As you can see when the model is smoothed (6), these new edge loops also have the effect of adding definition to the model's shape.
- Select just the wing polygons. For these polygons, we'll use a deformation to move them. Take note of the axis of symmetry that you use to affect both sides of the plane. In my case, it's X. Open the Tool>Deformation menu. Next to the Size slider, the XYZ switches are all on. Turn off the ones that don't match your axis of symmetry by clicking on them (7). Now move the slider all the way to the right a couple of times. This has the effect of moving the polygons away from the center of the model. Since only the axis of symmetry was selected, they won't be enlarged at all.
- Do another Edge Loop. You'll now have wings (8).
- Hide the new polygons, leaving only the ends of the wings, then add a regular Edge Loop (9).
- Hide the outer ring, then do another Size deformation with a value of about 5. Do not perform an Edge Loop again, but instead just restore the visibility. Your wings will now rounded ends (10).
- Repeat the process for the sides of the tail (11), but don't move the polygons out as far as you did for the wings. Since the tail is narrower than the body, you'll probably have to do four size deformations for the first time rather than two.
- For the top of the tail, select the center polygon of that edge loop. Change the switch in the Size slider to move the polygon vertically and perform the deformation a few times. Do the Edge Loop command, then add a cap to the tail like you did with the wings (12).
- Stylize the shape of the wings and tail a bit by moving points around while the mesh is fully visible. For example, I made the top of the tail longer and swept the wings back a little.Here's the progress so far, with the mesh smoothed (13). Next up, we'll work on the nose.
Nose
- Enlarge the center polygon and move it forward a little (1).
- Hide all except that polygon, then move it farther forward. Do an Edge Loop (2).
- Hide the new polygons, then repeat the process while also making the polygon center a little smaller (3).
- Add a regular edge loop to the front polygon. Hide the outer ring, then move the central polygon back into the body of the plane and do another Edge Loop. You'll have something like the illustration (4). What we want, though, is a flanged nose. Fortunately, you can also add polygons to the middle of a structure.
- Select just the main body of the nose (5).
- Add an Edge Loop to that (6).
- Hide the outer rings.
- Scale the remaining part larger, then add another Edge Loop (7).
- We now have a flange, but it's not long enough (8). It's possible to painstakingly move all of the points, but that would be a waste of time when other options are available. Select just the points that need to be moved forward (in illustration 8, it's everything forward of–but not including–the large blue polygons). Using the Offset deformation, you can move the points as a group. When visibility is restored, you should have something like this (9).
- Now all that's left is to smooth the front of the nose a bit (10).
You're now done with the box modeling. If you'd like to download my version to check yours against, click the thumbnail at the bottom of this post. You could actually place it within a HyperNURBS object in your favorite animation package to get results that are very close to the divided ZBrush mesh.
The Propellor Nose Cone (Using Projection Master)
It's still missing the nose cone for the propeller. Projection Master will come in handy for that.
- Divide the model a few more times. I pushed mine up to subdivision level 7, which is a little over 500,000 polygons. To speed up feedback with the interface (and keep parts of the mesh that you want left alone from being affected), hide all but the nose (1).
- Rotate to the front view (hold Shift to snap it in place), and then Alt+Click on the canvas to enlarge and center it. Activate Projection Master. Turn off Colors and Fade, turn on Deformation, and turn off Normalized (2). It's important to have Normalized off because we only want the deformations to come toward the canvas, rather than inward from the sides of the nose cone area. When ready, drop the mesh.
- Select the Cone3D tool. The problem is that it has too sharp of a point, so we'll take a moment to change it for our needs. Open the Tool>Initialize menu then set HDivide and VDivide to 8. At the top of the Tool palette, press Make PolyMesh3D.
- Select the polymesh tool that it will create and draw that on the canvas. Rotate it to the side, then move the tip point down to make it more blunt (4).
- Divide the cone a few times to smooth it out (5).
- Now all you need to do is position it where you want it (6).
When you pick the model up again using Projection Master, the cone will be incorporated into the mesh.
Here's the finished airplane, ready for texturing. As you can see, box modeling is very effective for certain projects, and ZBrush 2 makes it really easy work in this way.
Texturing the Airplane
Time now to move on to texturing the model. The purpose of this part of the tutorial is to demonstrate several tips and techniques for creating textures with really crisp, clean details.
The first thing to keep in mind when you want really fine or crisp detail is texture size. What it boils down to is that the more pixels per polygon, the more room you have for detail. So for the sharpest edges at the greatest magnification, use the largest texture size (4096x4096). The farther your object will be from the camera, the less detail will generally be required, and the smaller your textures can be. Don't waste RAM where it's not needed.
- To begin with, I've started with a texture of 4096x4096 and my base color of orange. For the record, the UV mapping that I've used is GUVTiles, which gives the least possible distortion of any mapping method and only takes a click of the mouse to apply.
- There are several ways to get really smooth lines when texturing. For the cockpit, I elected to use the simplest method of all -- the geometry of the mesh. By turning off the texture (Select Texture>None) and activating the polyframe view, we can see the mesh geometry. Using the partial mesh visibility controls, it only took a few clicks to hide everything that's not part of the cockpit (2).
- The model was rotated to the top view, and Projection Master was activated. For sharp lines no matter where on the model your paint might land, it's important to turn the Fade option off (3). (This option is meant for use when you want various drop and pickup routines to smoothly blend together, so it doesn't apply here.)
- I then painted the visible mesh black and used Projection Master to pick the model back up again (4). The edge of the black flows with the geometry perfectly.
- The nose used the same approach. I hid everything except for the nose area (5).
- I then painted the visible area black. For the cone itself, I used a Circle3D to apply the paint. By using Rgb in the Draw palette with Zadd turned off, I was able to draw a perfect circle and position it precisely (6). It works great every time you want a perfect geometric shape with crisp edges.
- On to the sides of the plane. The Double Sided option was activated since both sides of the plane needed to be the same (7).
- To paint the belly of the plane, I've shown the stroke settings that were used with the Simple Brush (8). The selected Alpha gives a very crisp edge to what it paints. Mouse Averaging is especially important for something like this, since it creates the smoothest brush strokes.
- After the belly was painted, another Circle3D was used. The gyro came in handy to stretch the circle out, then rotate and move it into position (9). I placed a marker so that ZBrush would remember that position later. I then pressed the Snapshot button to record a copy of it.
- The circles was again moved and rotated, and another marker was placed (10).
- Switching to white, I clicked the second marker to redraw the circle. Using the Edit>Scale, I resized it a little bit so that enough yellow showed (11).
- The same was done with the second marker (12).
- Finally, the Simple Brush was used again to paint the remaining white (13). The model was then picked up.
- After rotating the model to the top view, I alt+clicked on the canvas to center it. The Circle3D was again drawn, stretched and positioned. A marker was placed, the Snapshot button pressed, and I then used the Transform>Info to note how far off center the circle was positioned. It was then very easy to calculate a new value and type it into the slider to position the circle identically on the other side of the plane. Switching to Rotate, I added 90 to the value shown there so that the rotation would also match (14). Another marker was placed.
- Now it was just a simple matter of activating the markers...
- ...and resizing the circles for each additional color(15&16).
- Here, the Basic Material has been applied (17). As you can see from the full-sized view, the edges of the texturing are very smooth. But, like with the edges of the model itself, the fact that pixols are square causes some jagged edges.
- This is eliminated completely by pressing the AA Half button. This activates ZBrush's antialiased display mode, which cleans the edges up perfectly (18).
- Now all that was left was to add a little bit of noise and color bump to the material, adjust the lighting some, and do a Best render (19)!
This exercise has shown several ways to get really sharp edges in your texturing. Here's a recap:
- Use the right texture size for the amount of detail that you wish to paint.
- The model's geometry can in many cases be used for the easiest and best results.
- ZBrush's many 3D primitives can also be used to paint perfect geometric shapes. (Note: be sure to turn Quick 3D Edit off when drawing them unless you want a polygonal look.) Transform>Info can be used with the gyro to place these items with precision.
- When you need to paint by hand, use the right alpha for the job, and also turn on Mouse Averaging.
- AAHalf mode cleans up any edge jaggies.
- Don't forget that you can also use Stencils and Transparent textures in your detailing.See this tutorial.
One other note: When using Projection Master, always scale the model so that the area that you will be painting takes up as much of the screen as possible. This also contributes to the best possible edges when the texture is picked up again.
Getting Crisp Textures using Projection Master
Many people have asked how to get really clean texture transfers when working with Projection Master. By this I mean crisp, sharp edges that remain once the model has been picked up again from the canvas. The truth is that getting great results like this is a simple matter of understanding what is really happening at the fundamental level when you work with Projection Master.
This tutorial will take the mystery out of the process, while also providing an easy way to deal with those situations when you find yourself guessing. No more trial and error! These steps will give you great results every time.
How Canvas Resolution and Texture Resolution Relate
Let's begin by looking at what is happening when you use Projection Master. I'm not going to go into the technical aspects of what features it automates or any of that stuff. Instead, I'm going to discuss the topology of it. For those of you who are scratching your heads at this point, let's just say that Topology is the mathematics of surfaces. Your texture is nothing more than a flat plane that is getting wrapped onto the surface of your model. Of course, if you've ever tried to peel an orange into a single piece and then flatten it out onto the table top, you know that the 3D to 2D unwrapping process doesn't work too well. :-) There have to be breaks and/or distortions in order to get a complete unwrapping.
Projection Master takes as much of the topology (math) out of the picture as possible. The basic idea is that you paint what you want to see, and then ZBrush handles the process of applying all the math to make what you've just painted in 3D fit correctly onto the 2D texture map.
In order to make this work, ZBrush has to take a look at the pixols that you've painted on the canvas and then calculate how best to make that detail fit as pixels when projected onto the texture. "Projection" really is the perfect term for this, too. You have no doubt watched a movie in the theater at some point where the projector was out of focus until somebody complained and they fixed it. Modern movie projectors have a lot of great features to try and ensure a clean focus, but sometimes you still need human intervention. The same actually holds true for ZBrush, which has some really sophisticated routines to try and ensure an "in focus" projection when you pick the model up from the canvas. No matter how good those routines are, there are still some things that you can do to help ZBrush out. And that's what this tutorial will help you do. :-)
ZBrush's projection "focus" is based upon canvas pixols vs. texture pixels. If you have too many of one relative to the other, the result will be an out of focus, poor quality projection. To illustrate, I'm going to use Hiroshi's fun little model fromthis thread, onto which we'll be projecting the Pixologic logo.
For each use of Proejection Master, the only difference is the scale at which the model is being dropped to the canvas. Each of these gives us a different ratio of pixols-to-pixels, which gives different results when the model is picked up again. (Note: The ratios mentioned in the text beneath each illustration are approximate.)
Example: More Canvas Pixols than Texture Pixels
In this first example, we've zoomed way in on the chest (left view). As a result, the logo takes up a LOT of canvas pixols -- about 800 pixols across. On the other hand, the texture that the logo will be projected onto is only 2048x2048 in size. Relatively few of those are assigned to the chest. The result is that we have a large number of pixols being projected onto a relatively small number of texture pixels. Since there's no such thing as a 1/2 pixel (much less 1/5 pixel), ZBrush has to discard a lot of information from the canvas in order to make it all fit onto the texture. The results, as shown on the right, aren't great. Without the artist's eye to know what details are important and what aren't, the discarding gets applied uniformly across the canvas and the results are a lot of pixelation.
Example: Fewer Canvas Pixols than Texture Pixels
For the next example, we're going the other direction. The model is small on the canvas, which means that very few pixols are being painted. In this case, ZBrush actually has to supplement the information from the canvas, creating extra pixels on the texture based on guesswork from the minimal info that it has available to it. As you can see, it actually does a pretty good job (I told you ZBrush had some sophisticated routines for this. :-) ). But it's still not perfect.
Example: Correctly Matched Resolutions
Now in this third example, we're getting as close as possible to having one canvas pixol for every pixel of the texture that it will be projected onto. This means that ZBrush can simply calculate which pixol of the canvas is equivalent to which pixel of the texture. There's no need to discard or create data. It's a perfect, clean texture transfer.
So there's your focus control! By ensuring that each pixol that you paint on the canvas is equal to one pixel of your texture, you can guarantee perfect texture transfers every time. We can also see from the examples above that if you're not quite sure how big to draw the model on the canvas, it's better to go smaller than larger.
Figuring Out What Resolution to Use
Now let's say that you have a model and you're not sure how the texture pixels relate to canvas pixols, so you're not sure how big you need to draw the model to get the best results. Well, I've cooked up a pretty easy way to find out.
Once again, we're using Hiroshi's model. Because the model has been mapped with GUVTiles, it's not very easy to tell by looking at a texture template which part of the model goes with what part of the texture. For that reason, I've started with steps 1-2.
- The model is drawn onto the canvas and dropped using Projection Master.
- I used the Ring3D to draw a target in the center of the model (you can actually use anything - this is what works for me). The model is then picked up again.
- Exit Edit mode, clear the canvas, and select the Flat Color material. Press Texture>Crop And Fill to fill the canvas with the texture. Now pan the canvas to find your target. As luck would have it, mine wound up being split into pieces, but that doesn't matter.
- With the Plane3D, draw a small square on your canvas. With Transform>Scale active, set the Transform>Info sliders to 10. This gives a square that's 20 pixols x 20 pixols. And since the canvas is the same size as the texture, that means that you're also drawing 20 pixels x 20 pixels.
:-) When the square is drawn, press Texture>GrabDoc to capture the canvas as a new texture.Note: The first two steps are only necessary if you don't know where the model's UV's put the center of your object. If you did know, you could simply start by filling the canvas and placing the reference square where you know it should go. - Clear the canvas and resize it to something handy like 1000x1000. The exact size doesn't matter, so long as it gives you room to work. I prefer to have the canvas take up most of the screen. On the blank canvas, draw your rectangle again and use the Info sliders to scale it to 10. Also, switch to Move and set the Z slider to a close value like -1000. That way, the square will be well in front of your model.
At this point, we have a square on the canvas that's 20 pixols x 20 pixols. Our texture has a square on it that is 20 pixels x 20 pixels. I bet you can guess what's next. :-) - Select your model and then select the new texture that was created when you did the GrabDoc. Draw the model on the canvas. If you start your stroke on some blank part of the canvas, the model will be drawn behind the red square.
- Move and scale the model so that the red square on its texture is equal in size to or smaller than the red square that you drew on the canvas. (Remember what we determined earlier -- smaller is better than larger.) When you're happy, place a marker.
- Press Ctrl+N to clear the canvas. Since your model is in Edit mode, everything else on the canvas (in other words, the red reference square) will disappear. Drop the model and paint your texture.
- When the model is picked up again, you will have a high quality transfer. This is because the steps above ensured a ratio that's as close as possible to 1 canvas pixol for every 1 texture pixel.
If you accidentally resize your model, or if you have to draw it fresh on the canvas again for some reason, the marker will allow you to get the right size for this model and texture with a single click.
The more that you work withtexturing, the less you will probably need the steps shown above. You'll come to develop an eye for what your doing and be able to guage the proper size to draw your model at right away. But while you're still learning, these steps should prove a great help to getting the best results on your first try, every time.
Just for the record, if we were working with a texture that was 4096x4096, then the model would be able to be drawn larger on the canvas. This in turn means that more detail can be painted. It's all about what you need, and ZBrush has the flexibility to adapt to those needs.
I hope that you have found this tutorial helpful, and look forward to seeing the results in your own work! For now, here's my contribution the the Red Monster challenge. It's not much as far as art goes, but it was meant to demonstrate just how cearly the textures can be transferred. :-)
Happy ZBrushing!





