Shaders (part 3)

Skip Ahead (or back):

Brazil Chrome
Brazil Glass
Brazil Advanced (carpaint)
Brazil Advanced (skin/wax)
Brazil Advanced (others)
Brazil Utiliy and Brazil Basic

Brazil Toon:

Brazil Rio has, amungst it's fun-filled new materials, a toon material. This toon material, while not as complex as some other dedicated toon renderers, has quite a bit of diversity in it, if you know where to look. On a basic level, the toon material has four different modes: Gooch, Multi-level Paint, Material Pass-Through, and Background. First let's go over each of these options and what they do, before getting into specific controls.

The Gooch shader has it's roots in technical illustration (siggraph '98 paper here) and is designed to show geometric detail, rather then accurate lighting. This means that the overall shading is meant to be in mid-tones, with warm-to-cool color transition based on lighting. The black lines and white highlights are there to aid in definition of the surface rather then aid in the portrayal of a realistic material. This being said, you know why this material is here (it's handy for technical stuff), but that doesn't mean that is what you have to use it for :) Gooch basically just gives you a smooth color gradation, with the option of leaving inking on, for those outlines.

The multi-level paint option gives you the more traditional 'toon' appearance, with bands of solid color showing lighting. This one has controls for the number of steps/bands of shading color, and, like gooch, can have a highlight. The inking controls are available here as well.

The material pass-through option is by far the most versatile of the bunch. This choice allows you to put any material you like in the place of the area which would be shaded, and still have the inking work around it. In my example images above, I've set a chrome material to be the base material on the left, allowing me to get toon inking on a chrome material. On the right i've layered up 3 toon materials, getting a 3 part inking in three different colors. Most all of the look of this material is determined by what you put in the pass-through slot, so experiment. Pretty much anything can go in there.

Finally, the 'background' option allows for the background color/map to show through. In my image above, we are seeing the grey gradient ramp that is still in my environment from the chrome material page.

If you get yourself a new toon material and open up the rollouts, you can follow along here as i talk a bit about what the various controls do.

Here we see the gooch controls. Fairly simple stuff here, the first color swatch is the material main color. By default it is locked to the second color. If you leave them locked together then the spinner below (one that says 70 by default) controls how much darker the second color is then the first. If it's set to 70 then the second color is 70% of the first (%30 darker). If you unlock the two colors, then the spinner becomes inactive, and you can control the two colors independantly. This allows you to have the material fade from, say, blue to red instead of blue to dark blue. These channels can, of course, be mapped if you like.

Next we have controls labeled 'gooch y' and 'gooch b'. These basicaly control the amount of yellow (gooch Y) added to the lit areas, and the amount of blue (gooch B) added to shadow areas. This can give you the warm-to-cool tone i mentioned earlier. There are also options for allowing the material to recieve shadows, and for how those shadows are blended in with the rest of the material.

If you change the type to multi-level paint, then the gooch stuff gets disabled, and the paint levels spinner becomes active. This spinner determines how many steps there will be in between the light and dark colors. As to those colors, they work the same way as in gooch, locked together by default, and mapable.

If you change the type to material pass-through, then everything gets disabled except for the big button for putting your pass-through material.

If you set the type to 'background' even the big button gets disabled.

The next rollout features all the basic inking controls. There is, of course, the toggle for turning inking on or off. The ink types are 'outlines', 'overlap', 'smoothing', and 'matID'. These are the settings for where you want to get inking. Having 'outlines' activated, tells brazil to ink the outline of an object. Overlap tells brazil to ink where an object overlaps intself. Smoothing makes it ink between smoothing groups and MatID has it ink the borders between material IDs. Pretty easy, eh?

The next control, overlap bias, basically determines how aggressively brazil inks edges, borders, etc. Lower settings will result in more inking, and higher settings should result in less ink.

There is a color swatch for the inking color, and it is mappable as well, so you can toss a map in there if you like. The next control is for ink width. Used by itself, the 'min' setting, will govern the width of the ink line. Used in conjunction with a map, the 'max' spinner becomes activated and the map determines the width of the ink between the min and max settings.

Finally, the sampling spinner determinse the number of samples used to create the inking. More samples generally makes for smoother inking, but i find that you don't usually have to go any higher then, say, 3 or so to get good quality.

The last rollout, the advanced toon controls, gets a little more complicated.

You can thank spongebob for this section. If i recall correctly, Blur studios was doing a ride-film for nickelodeon, involving Spongebob Squarepants (tm) which required alot of control over the toon shader. Since one of the programmers of Brazil happened to still be spending alot fo time at Blur, the advanced toon controls came to be, and eventually made it into the public release.

The advanced bias overloads sections give you overlaps bias controls over specific types of overlapping. These controls work pretty much likethe overlap bias control from the last section.

Rather then go through each one of these checkboxes, one by one, it's much easier for us both to just turn everything on, and then see where all the colors pop up. This is also why all the default color swatches are random loud colors. Anyhow, get yourself a nice, complex model toss the material on the whole thing, turn all the ink colors on and then give it a render.

Tada! As you can see, all those wierd colors get used somewhere in the rendering, so pick your own rendering apart and see which you can use to your advantage.

Keep in mind that the toon shader plays well with all of the other Brazil shaders, so you don't have to use it by itself. In the image below (click for a big one) The robot is a blend material, with a toon shader in one slot and a matte blue material in the other. the transition is based on a light-shadow falloff map. The toon material, was a multi-level paint with it's ink set to white and the ink thickness governed by a image of a bunch of scribbles. Lighting consisted of a single area light and the skylight. The groundplane and teapot were matte-shadow materials and the background set to black. Then the whole thing was composited over the image of cardboard in photoshop.

That pretty much wraps up the Toon shader. Now, on to the Car Paint shader:

>>>> Three down, four to go!! >>>>

--



All images, elements and content are property of nathan fariss and/or real media digital production. all rights reserved.