PDA

View Full Version : Writing a hand-drawn cel-shader



Curagea
05-13-2008, 08:56 PM
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!

S.Seegel
05-14-2008, 12:32 AM
The image you refer to is actually part of a tutorial. If you don't speak french, the author actually provides an english version (http://matthieu3d.free.fr/TutoVira2/tut2en.html) 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.

Curagea
05-14-2008, 11:06 AM
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.

S.Seegel
05-14-2008, 12:18 PM
There is nothing blender can do, what can't be done in opengl (because blender itself uses opengl in the end, right ? ;) ).

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.

ZbuffeR
05-14-2008, 01:52 PM
There is nothing blender can do, what can't be done in opengl (because blender itself uses opengl in the end, right ? ;) ).
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" :
http://www.jeux-france.com/Webmasters/Images/60011420071117_035104_6_small.jpg (http://www.jeux-france.com/images6_4_22788.html)

Curagea
05-15-2008, 09:15 AM
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.

Curagea
05-15-2008, 09:19 AM
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.