This tutorial shows you how to create a 'stylized' cartoon shading effect using Arnold. We will use the facing_ratio in combination with a variety of other utility and color shaders to fine tune the effect.
The shader used in this tutorial can be downloaded here.
The original Maya scene files for this series of tutorials can be downloaded from Autodesk's Hyperspace Madness production.
- Create a standard_surface shader and assign it to the geometry. In this case, two standard_surface shaders have been assigned to the Juggernaut model (Gray and Blue).
- Create a Ramp shader. Create four colors for the Ramp: Black (for the outline), dark gray, light gray, and white. We will use a color_correct shader, later on, to add individual colors to the gray and blue parts of the model. That way we only need to have one ramp in the scene that controls all of the toon shading.
In this case, a standard_surface shader was used. Alternatively, you could also use a utility shader and set the shade_mode to flat.
- Create a color_correct shader and connect it to the emission_color of the standard_surface shader. Increase emission to 1. Decrease base and specular_weight to 0 as we will not need these attributes for our toon shading. Connect the Ramp to the input of the color_correct.
- Delete the 2d texture of the Ramp and connect a facing_ratio shader to the U parameter of the UV Coords in the Ramp (ensure that the Ramp Type is set to U also).
Out Value of Ramp connected to uCoord of Ramp
A utility shader (shade_mode set to nodoteye) connected to a ramp can also be used to create a similar facing ratio effect. You could also try experimenting with some of its color modes to produces different toon shading effects. Note that the ndoteye shading does not appear in specular reflections.
- We will use the color_correct shader to add color to the ramp and can also use it to fine-tune the toon shading effect.
- Change the multiply color to the color that you want the shading to be (in this case blue).
Blue color added to multiply of color_correct shader
- Repeat this process for all of the shaders in your scene.
Multiple shaders connected to the same Ramp and facing_ratio shader
The facing_ratio shader can be used to add more control over the appearance of the cartoon shading effect. Below are the results when adjusting the bias and gain attributes.
The range shader can also be used to fine-tune the cartoon shading effect by remapping the input values of the ramp.
range shader connected to emission_color. Roll over image to see without it.
That concludes this tutorial on cartoon shading. Why not try these shading techniques using some of the freely available models from Autodesk's Hyperspace Madness production.
You can use this node to change shading based on any lights in the environment. In the example below, the Surface Luminance shader is used to drive the V Coords of a ramp that is connected to the base_color of a standard_surface shader.
SurfaceLuminance shader connected to V Coord of Ramp