Writing a hand-drawn cel-shader

I’m not sure if this is the right section to post this question, but here goes:

I want to write, using GLUT, a cel-shader to render my models with a hand-drawn look. Something along the lines of this:
http://matthieu3d.free.fr/TutoVira2/tut_images/AO.jpg

While I can find resources on cel-shading in OpenGL, I have yet to find anything about making it look hand-drawn or sketch-looking. Anyone know good resources on these?

Thank you!

The image you refer to is actually part of a tutorial. If you don’t speak french, the author actually provides an english version too. Or you could try to google online translate it to a language of your choice.

If that has not been the problem or leaves any questions - feel free to ask.

I know. I got the idea of making a hand-drawn cel-shader from that tutorial. The tutorial, however, says how to render a model in such a style in Blender. What I’m interested in, is actually WRITING a renderer that does such a style.

There is nothing blender can do, what can’t be done in opengl (because blender itself uses opengl in the end, right ? :wink: ).

You need to understand which steps are taken to produce the given result, so you can reproduce them in opengl.

At a first glance i would suggest:

  • the input images (shadow, edge, ambient occlusion*) can be rendered-to-texture.
  • the effect textures (wood, cloud) can be pre-computed and loaded from file (alternatively implemented procedurally on gpu)
  • all the images combining work can be done by a shader
  • that one will most likely become the performance bottleneck

I hope this is of any help to you.

Yes and no. Yes, with GLSL, a bunch of texture, render to texture, oversampling, you can do almost everything blender does.
No, blender does not use GLSL for its rendering. It is pure CPU only. The realtime views actually use OpenGL but in a very basic way, this is being improved thanks to the game based on the Bick Buck Bunny movie, some hints here : http://apricot.blender.org/?page_id=14

For inspiration, here is some very nice realtime hand-drawn-like cell shading, from the Sega game “Valkyria Chronicles” aka. “Valkyrie of the Battlefield” :

Here’s my current plan:
Given an OBJ file, I want to render it with traditional toon shading, but outlines will be drawn “artistically”. I found this site: http://www.dgp.toronto.edu/~todd/isophote/ that talks about one way to have artistic lines. I’m actually pressed for time because it’s a class project due in a week. Don’t know if this is doable.

Here’s my current plan:
Given an OBJ file, I want to render it with traditional toon shading, but outlines will be drawn “artistically”. I found this site: http://www.dgp.toronto.edu/~todd/isophote/ that talks about one way to have artistic lines. I’m actually pressed for time because it’s a class project due in a week. Don’t know if this is doable.