You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

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:  

  • Volumes, motion blur, and DOF do not currently work with the toon shader.
  • toon edges can be jaggy if the pixel intensity is greater than 1.0 (for example, when incorrectly combining a Background shader with skydome camera visibility). This can be fixed by clamping the Camera (AA) samples.

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.

1. Edge (requires Contour Filter)

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.

2. Stylized Highlight

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.

3. Specular/Base Tone Mapping

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.

4. Rim Lighting

Connect a ramp here to create a rim lighting effect. A light can be specified to create the rim lighting effect.

Toon Shader Visibility

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).

Pixel Art Style

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. 

UberNoise.osl -> toon.mask_color

Toon tutorials 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. 





Pepe model by Daniel M. Lara (Pepeland). Mery model by Jose Manuel Garcia,

  • No labels
Privacy settings / Do not sell my personal information / Privacy/Cookies