I’m interested in learning how to write toon shaders in OpenGL Shading Language. I found a demo, but haven’t been able to get the demo running on my computer. The trouble I’m having is with writing an application which will use this shader. Could somebody please show me how to write a simple application which would use this shader? I’m using GLSL 1.2 (OpenGL 2.1) on Linux.
I’m interested in learning how to write toon shaders in OpenGL Shading Language. I
Share
Here is the main sketch:
Here is the GLSL class used:
And the GLSL code,
the vertex shader: toon.vs
And the fragment shader: toon.fs
If it helps, here is the zipped Processing project. Once you’ve installed Processing, unzip the file into the default Processing folder(~/Documents/Processing) and run Processing > it should show under File > Sketchbook
And here’s a screenshot:

HTH
Update
Processing now provides a nice PShader class and comprehensive tutorial.
It incluses a Toon shader:
ToonVert.glsl:
ToonFrag.glsl: