Toon shading with custom meshes

I’ve just created a simple house via a custom mesh (i.e., just a couple of triangles for each wall, etc.).



Is it possible to use the toon shader to be able to draw the cartoonish edges on such a custom mesh? Or is it possible to draw edges at all?

By activating the Post Process Cartoon Edge Filter anything in you scene gets edges, no matter how it was made :wink:

There is other anotherway:

http://code.google.com/p/jme-glsl-shaders/downloads/list



There is a toon shader in ShaderBlow library. But post processor is better. @chototsu has written it. I mean much more fps with his shader than with JME postprocessor.



JME Post Processor - 1200fps

Chotorsu’s Post Processor - 2400fp

Only one model was used.

Thanks to both of you for your replies! Let me talk about the CartoonEdgeFilter first.



The following image shows that all the filter would do is draw edges based on where the camera is, as expected. Check it out:



http://i.imgur.com/iW1SL.png



So, I set the following properties:



[java]

cf.setDepthThreshold(0f);

cf.setDepthSensitivity(250);

[/java]



And now the result is as follows:



http://i.imgur.com/2w92e.png



This is better, but as you’ll notice from what I circled in red, the filter still detects edges based on the camera position that I no longer want drawn! Any thoughts about this?



Cheers.

I’m really still stuck on this one. Any idea as to what I need to do to get it to stop drawing extra edges?

I would recommend you to use edges only for characters. All cartoon games I saw used edges only for characters.