How to do this: Cartoon rendering effect

Started by Klaudiusz, August 23, 2007, 09:55:55 PM

Previous topic - Next topic

Klaudiusz

Hi,

I would like to show You how to do some easy and nice trick like cartoon rendering.

What is cartoon rendering? It's a rendering with black outlines on the edges:




How to do this?

All what we have to do is:

1) Clone the source object
2) Scale a littlebit the cloned object
3) Move the clone a littlebit away of the camera
4) Colorise the cloned object to be black.

That's all. Since now cloned object should be like a shadow. Shoud be translated and rotated together with source object and always should be a littlebit away of the camera.

The executable file and complete source code could be find there:
http://www.jpct.net/others/cartoon.zip


That's all! Hope You like it. Enjoy!

Thanks Egon for the support.


Mizuki Takase

#1
Hi~! I always wanted to do the cartoon render effect! Although I am quite skeptical of this algorithm, I must admit that the screen shot does look nice. When I did research on cartoon rendering, the algorithm was insanely impossible for me to do. Anyway, I am definitively going to download this and try it out. I would be completely dumbfounded if this works just as good. Thank you!

[edit] Holy crap~! I am convinced that this algorithm works quite well!! Out of curious-ity, are you familiar with the mesh ripping scene? That mesh looks like it came from the source game.

Klaudiusz

Thanks:) This is fast method for low poly objects.

When Your scene has more poligons and You want to do toon render on the whole framebuffer, better make something like toon pixel shader. Normal algorithm is a little complicated indeed, but drawing the outline should be easy to do (check the nearest pixels in the Z-buffer, if the difference is high - put the black pixel). I don't know, wheater it is possible to do with JPCT +OpenGL on graphics memory, but with software mode drawing the pixels should be fast.

The object has been downloaded from somewhere by e-mule:)

cyberkilla

http://futurerp.net - Text Based MMORPG
http://beta.rpwar.com - 3D Isometric MMORPG