Author Topic: How to do this: Cartoon rendering effect  (Read 4994 times)

Offline Klaudiusz

  • int
  • **
  • Posts: 75
    • View Profile
How to do this: Cartoon rendering effect
« on: August 23, 2007, 09:55:55 pm »
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.


Offline Mizuki Takase

  • int
  • **
  • Posts: 97
    • View Profile
Re: How to do this: Cartoon rendering effect
« Reply #1 on: August 27, 2007, 05:23:11 pm »
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.
« Last Edit: August 27, 2007, 05:25:59 pm by Mizuki Takase »

Offline Klaudiusz

  • int
  • **
  • Posts: 75
    • View Profile
Re: How to do this: Cartoon rendering effect
« Reply #2 on: August 28, 2007, 10:48:20 am »
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:)

Offline cyberkilla

  • float
  • ****
  • Posts: 413
    • View Profile
    • http://futurerp.net
Re: How to do this: Cartoon rendering effect
« Reply #3 on: September 08, 2007, 02:31:45 pm »
Well done! nice trick:P
http://futurerp.net - Text Based MMORPG
http://beta.rpwar.com - 3D Isometric MMORPG