Maya's toon line tutorial will teach you how to do one type of line only. To convert a NURBS object to a polygon object, here are the magic settings that you will want to use: Modify > Convert> Nurbs to polygons (option).
Maya's toon line tutorial will teach you how to do one type of line only. To convert a NURBS object to a polygon object, here are the magic settings that you will want to use: Modify > Convert> Nurbs to polygons (option).
Maya's toon line tutorial will teach you how to do one type of line only. To convert a NURBS object to a polygon object, here are the magic settings that you will want to use: Modify > Convert> Nurbs to polygons (option).
Mayas Toon Line For those familiar with toon lines in Maya, you may skip ahead past this section. Those not familiar might find it useful to understand the basics of toon lines before going through a step- by-step tutorial that will teach you how to do one type of line only. Getting Help You can read the help section of Maya to find out many things about the toon shading portion of Maya. Click Help> Maya Help > Using Maya > Rendering and Render Setup > Toon Shading to see that documentation. Seeing Examples In Maya there are examples that you can load in as well. Click Rendering > Toon > Get Toon Example. This will open the visor menu directly to the Toon Example tab. Middle-click and drag an example to a viewport window and it will open. CarrotTop.ma is a cute example of a character with toon lines. If you need more, lets walk through toon shading together. Open the sample file. Open the file CoffeeCup_1.mb. Here you find two coffee cups. One is a NURBS coffee cup. The other is a Polygon coffee cup. Figure 3.17
Two coffee cups that we begin with.
Take Note To convert a NURBS object to a polygon objects, here are the magic settings that you will want to use: Modify > Convert> Nurbs to Polygons (option). Well, they arent magic. They will give you a nice polygonal version of your NURBS surface.
Copyright 2010 Elsevier Inc. All rights reserved. Type: Quads Tessellation Method: General U Type: Per Span #of iso params (the last selection in the dropdown) Number U: 3 (1 =Low resolution of a NURB, 3 =high resolution of a NURB) V Type: Per Span #of iso params (the last selection in the dropdown) Number V: 3 (1 =Low resolution of a NURB, 3 =high resolution of a NURB)
Figure 3.18
Converting NURBS to polygons.
Default Toon Line We will start with the toon lines. Select the coffee cups and click Rendering > Toon > Assign Outline > Add New Toon Outline.
Copyright 2010 Elsevier Inc. All rights reserved. Figure 3.19
Objects with Default Toon Line applied.
Trench Note Youll note that the polygonal object needs much more tessellation in order to have smooth toon lines. You can also convert the polygon object to a subdivisional object.
Types of Toon Lines The first thing to understand is that Maya is finding where to apply toon lines based on settings that you have control of. By default it is showing profile lines, crease lines, and border lines. The tricky part is knowing which part on your model is a crease, a profile, and a border. Lets take a real world example: these coffee cups. Assign Colors Select the toon line, and go to the Attribute Editor. Change the colors of the following: 1. Profile lines =Red 2. Crease lines =Green 3. Border lines =Black Copyright 2010 Elsevier Inc. All rights reserved. Figure 3.20
Object with colors for profile, crease, and border lines.
Profile Line The silhouette outline of the object is what Maya has painted red. This is the most straightforward of toon lines. Then why is the outline of the cup handle blue? Figure 3.21
Object with colors for profile, crease, and border lines.
Copyright 2010 Elsevier Inc. All rights reserved. Border Line These lines show up at the open edges of your object, an edge that belongs to only one face. If we move the CVs (control vertices) of the handle, youll see that there is an open seam in the NURBS handle and the same in the polygon. This is what is causing the handle to be a blue border toon line instead of a red profile line. Figure 3.22
Open edges in your object are borders.
NURBS surfaces will have border lines. You can turn off the display of toon border lines in the Attribute Editor under Common Toon Attributes.
Copyright 2010 Elsevier Inc. All rights reserved. Figure 3.23
Turn off the Border Lines feature if you cannot get rid of edges in your geometry.
You can easily close the borders of polygon objects (you should be in the habit of this already) by merging edges. Figure 3.24 shows the polygon handle with merged edges. Only the end of the handle is shown as a border. The bottom of the handle would be shown as a border as well if it were not pushed inside of the coffee cup. Well see why in a bit. Figure 3.24
Merge edges in polygon objects to get rid of unwanted border toon lines. Copyright 2010 Elsevier Inc. All rights reserved. Intersection Lines When two separate objects that have the same toon line interpenetrate each other, you get an area of intersection. This type of toon line is not on by default. At the top of the Common Toon Attributes, you can turn on the checkbox. In Figure 3.25, you see that the bottom of the coffee cup handle is pushed into the coffee cup and now displays an intersection line. Figure 3.25
The intersection line shows when two objects interpenetrate. It is not turned on by default.
Controlling the Lines Now that we know what types of lines there are, we can start to look at how to adjust the look of these lines. Take Note In writing this section Ive had to save often and sometimes reopen my Maya file when Maya stopped updating the toon line. Ive seen this before in class with students laptops. You might have issues like this with certain graphics cards. If the toon lines stop updating and you are sure they should be doing something, reopen your previously saved file. Global Changes One way to globally change the toon lines is to use the first section in the toon line attributes: the Common Toon Attributes. Like the name suggests, any changes made here will be for all of the toon line types that we learned earlier. The profile, crease, border, and intersection toon Copyright 2010 Elsevier Inc. All rights reserved. line tabs have some of the same attributes as well as their own individual attributes. That sounds easy enough. Figure 3.26
Common toon attributes.
Toon Line Type Changes The second area to adjust the toon line look is to work in the individual areas for the line types (now that you know which line type is which). Figure 3.27
Individual toon line type attributes. Copyright 2010 Elsevier Inc. All rights reserved. Adjusting the Attributes The great thing about Maya is the many ways you can adjust the attributes to get just the look you are wanting. This is no exception. The easiest way is to input numbers or use a slider to adjust attributes. You knew that one. For example, Figure 3.28 shows the Common Toon Line Attribute: Line Width. Give that slider a nudge, and you should see the overall width of your toon lines change. Figure 3.28
Sliders.
The next way to control attributes is to paint the attribute. Go to Rendering (submenu) > Toon > Paint Line Attributes, and you will see a list of the different attributes you can adjust using a paintbrush (Figure 3.29).
Copyright 2010 Elsevier Inc. All rights reserved. Figure 3.29
Attributes that can be adjusting using a paintbrush. For example, lets adjust your line width: 1. Select the surface of the object, the handle. 2. Select Rendering (sub menu) > Toon > Paint Line > Line Width. 3. It takes a moment at first to figure out what you should paint. You should paint on the surface of the object, not the toon line. You paint in gray scale: black =no toon line, white =full width. 4. In Figure 3.30, I painted a band around the handle. As you rotate your object, where any toon lines cross the black band they do not show. Did you get an idea that maybe you could paint out that border line on the NURBS handle? I did. Nope. That option is not there. Figure 3.30
Global Line Width attribute adjusted by painting. Copyright 2010 Elsevier Inc. All rights reserved.
Another not-so-obvious way to adjust your attributes is to add textures, expressions, keyframes, or Set Driven Keys to them even if they do not have the checkerboard icon (for example, the Line Width attribute). If you right-click on these attributes, you can choose from a list of options (Figure 3.31).
Figure 3.31
The menu that displays if you right-click on the sliders.
Trench Note If you read this youll save some time. If you want to add noise to your line width, youll have to add it via the Line Width Map, which applies across the whole surface. If you put it in just the Line Width attribute you will only get one number and one global size change. Figure 3.32
Noise added to the Line Width Map attribute. Copyright 2010 Elsevier Inc. All rights reserved. The Common Attributes The following is a visual cheat sheet of common attributes often used. You can find a lot more information in the Help documentation if you look up the pfxToonShape node. Most attributes should be self-explanatory, if you experiment with them. Here are some areas that might be tricky or will cost you some time when trying to figure them out on your own: Line Width (we saw that in Figure 3.28). This adjusts the overall width of the toon lines (all types). Line Width + Line Width Map. When you add a line width map, it multiplies the line width value. In Figure 3.33, you see that a gradient was added as a line width map. On the inner part of the handle, you can see the toon line is thinner. Where the image is white or (1), the toon line is made twice as big. Where the image is black or (0), the toon line is no longer visible. Gray (.5) will have no effect. So in a gradient, midgray will have no effect, but as the gradient moves toward black the toon line will get smaller, and as the gradient goes toward white the toon line will get larger. You can see that effect in the right side of Figure 3.33. For clarity, I assigned the width map to the color of the cup itself. The inner part of the cup handles line width map is in the darker part of the gradient, and the outer part of the cup handle is in the whiter part of the gradient. Figure 3.33
Line Width Map multiplies the line width.
Trench Note Did you think that you could avoid UV-ing your polygon object by using toon lines? Use NURBS if you dont like UV-ing. Line width maps are applied in UV space! Copyright 2010 Elsevier Inc. All rights reserved.
Line Offset. This sounds simple enoughit offsets the line. You can also type in negative numbers. Figure 3.34
Line Offset attribute.
Line Offset Map. J ust like the Line Width Map this multiplies the Line Offset except that it does not double the number like the Line Width Map. Again it needs a grayscale image: black (0) = no effect, gray (.5) =scales the line by half, white (1) =full value of what was set in Line Offset. Here in Figure 3.35 you see a checkerboard applied to the Line Offset Map attribute. Figure 3.35
Line Offset Map attribute with checkerboard applied. Copyright 2010 Elsevier Inc. All rights reserved. Line Edge Thinning. This attribute thins the ends of the toon lines. Profile line types usually will not show edge thinning because there is no visible end. However, it depends on your geometry. Here you can see the effects of edge thinning on the coffee cup handle. The slider defaults from 0 to 10. You can type in higher numbers. In Figure 3.36, we are using a value of 40. Figure 3.36
Line Edge Thinning attribute with a value of 40.
Line Extend. As with Line Edge Thinning, this attribute works on the ends of toon lines (if visible) and extends them. A combination of the two attributesLine Edge Thinning and Line Extendgives a nice look. Another attributethat we havent looked at that helps control this is Break Angle.
Take Note The Line Extend attribute is calculated on the facing anglethe edge facing the camera. That means if you camera moves, your line extend does as well. It can cause unwanted animation artifacts. Figure 3.37
Line Extend and Line Edge Thinning together on the coffee cup handle alone. Copyright 2010 Elsevier Inc. All rights reserved.
Line Opacity. This will not show up until you render; 1 =fully opaque, 0 =fully transparent. Figure 3.38
Line Opacity attribute. Im getting the shakes from all this coffee.
Line Opacity Map. Scales the number set in Line Opacity based on a grayscale texture map. (Yes, UVs are used. You are catching on.) Figure 3.39
Noise used for the Line Opacity Map.
Lighting-Based Width. This looks like a great feature in the help documentation. It varies the line width based on the diffuse portion of the light. Figure 3.40 shows our now overly familiar coffee cup with a flat toon shading on it (Toon > Assign Fill Shader > Solid Color). There is a spotlight with an intensity of 2. The documentation states that where the light is brightest, the line should be thinner than where the light falls off. You can invert the number, which gives an interesting effect (Figure 3.40).
Copyright 2010 Elsevier Inc. All rights reserved. Figure 3.40
Lighting-Based Width attribute.
Occlusion Width Scale. If your toon lines feel thick to you, you can take a look at the Occlusion Width Scale, which is by default turned on. If you uncheck this option, the part of the toon line that is hidden by the surface edge is not rendered. Youll note in Figure 3.41 how the toon line appears thinner with the option turned off.
Take Note This option only shows up when rendered and only works on paint effects profile lines. Figure 3.41
Occlusion Width Scale on and off. Copyright 2010 Elsevier Inc. All rights reserved. Line Type Attributes Each line type has its own attributes. However, there are a few that are the same for each. Line Width Each individual line type can have its line width adjusted. The global common attributes line width will work as an overall line width. Width Modulation This attribute varies the width across the toon line. It is meant to be used with Smooth Profile turned off. Being that it is created based on the viewing angle, it will move during animation. Figure 3.42
Width modulation used for profile lines.
Break Angle Toon lines are broken into line segments. Using break angle allows you to control at what degree the lines break. At these points, the lines have ends where normally they are connected. At 180, all segments are joined together. At 0, the lines are one segment long. To better show this effect, you can use the extend edge feature as shown in Figure 3.43. This example uses the profile toon lines break angle.
Copyright 2010 Elsevier Inc. All rights reserved. Figure 3.43
Profile break angle.
Depth Offset This useful attribute moves the toon lines perpendicular to the camera view. You can use it to clip unwanted parts internal jagged toon lines or pull toon lines on top of the object, as shown in Figure 3.44, by using negative numbers. Figure 3.44
Profile depth offset. Copyright 2010 Elsevier Inc. All rights reserved.
Much, Much More There is much more to learn about toon lines. You have enough now to get started. The next step is viewing different looks and learning a little problem solving. Later on well cover some neat techniques you can use with toon lines. Happy experimenting!