High Contrast Toon Shader With Silhouette


The title sums it! A simple and fast 2 color toon shader with a bit of silhouette. Inspired by the old school GLSL basic toon shader.

shader Toon(
    float Specular = 0.5,
    float Thickness = 0.2,
    output closure color CL = holdout()
    float Intensity = sqrt(dot(abs(P+I),abs(N)))*Specular;
    float Line = dot(I,N);
    color Clr = color(0);
    (Intensity > 0.95/Specular) ? Clr = color(1.0,0.0,0.0) : Clr = color(0.5,0,0.0);
    Line > 0.002 && Line < Thickness ? Clr = color(1) : Clr = Clr;
    CL = diffuse(N)*Clr*Intensity;

Wow, awesome! Thanks for posting. :slight_smile:

Well done, what’s the inputs of Specular and Thickness to make the effect of your screenshot above?

This is my setup, and the rendered result does not look like yours.