It is better to use the Toon shader for this type of shading effect.
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. Rollover 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