I want to write a cell shaded renderer. Im breaking this into 2 parts. As far as I can see to get a proper cell shaded effect you need to limit the tones. For example a smooth gradient would become one solid colour. And secondly to add black outlines to the rendered result like you would see in a hand drawn "cartoonish" or "anime'ish" picture.
The first step seems the easiest. For diffuse lighting I was thinking of simply rounding (or maybe ciel) the NDotL to the nearest 0.1 or 0.2 or whatever. Asuming that the models textures dont contain any gradients this should be it for step 1
Now step 2. for creating the black outlines i was thinking of writing depth values to an FBO in the first pass while also drawing the entire screen to the backbuffer (simple forward rendering since i dont think alot of light sources would work with cell shading anyway). Then il just render a fullscreen quad directly onto the backbuffer using the depth fbo and for every fragment il check the difference in depth between it and surrounding fragments and based on that either make the fragment black or disgard it (or maybe even blend between if it will look better for edge cases).
So far this seems pretty straight forward. Is there any other methods I should be considering? or maybe even more steps altogether.
Thnx in Advance!
Edited by Wilhelm van Huyssteen, 26 July 2012 - 05:48 AM.








