The toon shader is part of a non-photorealistic rendering (NPR) solution that is provided in combination with the contour_filter. There are some current limitations when using the toon shader. These are as follows: The diagram and accompanying text below describe the shading components that form the toon shader. Note that the appearance of the base_tonemap (using a ramp) appears very different with skydome lighting (soft gradation) compared to that of say a directional light (hard gradation). Rollover the image below to view the effect of lighting on the base_tonemap ramp.
Skydome lighting. Rollover image for directional lighting. The toon shader supports line_color and width_control. Both of these are useful for avoiding line clutter and changing the line stroke style. The edge detection also uses id, mask color, and texture UV discontinuity. To view the toon edge, you must change the filter_type (sampling settings) to contour. Note that increasing the contour_filter_width (sampling settings) value will increase render times. An arbitrary texture that can be used to create a highlight. A light must be specified for the stylized highlight. stylized_highlight requires subdivision with smooth_tangent enabled, otherwise, artifacts may be visible. The toon shader uses cell shading via ramp nodes for both base and specular. While it is recommended to connect ramp shaders to the tonemap attributes, any shader can be connected. Connect a ramp here to create a rim lighting effect. A light can be specified to create the rim lighting effect. The toon shader is visible in specular reflections (up to 3 bounces), transmission, and also works with displacement (ear uses geometric_normal, angle_threshold: 3). A pixel art style can be achieved by using negative Camera AA samples with the Toon shader. Toon with base and specular_tonemap (directional lighting) A cross hatching sketch style can be achieved by connecting an UberNoise.osl to toon.mask_color.
1. Edge (requires Contour Filter)
2. Stylized Highlight
3. Specular/Base Tone Mapping
4. Rim Lighting
Toon Shader Visibility
Pixel Art Style
Hatching
Tutorials about the toon shader can be found here.
A Toon example scene file can be downloaded from the Learning Scenes page. |
---|
Due to a large number of controls, the Toon shader is split up into several groups. The individual settings for each group are described in more detail in the pages below.
- Edge
- Silhouette
- Base (Toon)
- Specular (Toon)
- Stylized Highlight
- Rim Lighting
- Transmission (Toon)
- Sheen (Toon)
- Emission (Toon)
- Geometry (Toon)
- AOVs (Toon)
- Advanced (Toon)
Pepe model by Daniel M. Lara (Pepeland). Mery model by Jose Manuel Garcia, www.meryproject.com