PDA

View Full Version : Toon/Cel Shading with Transparency



MichaelM
05-04-2011, 08:09 PM
Hi,

I've made a program that does toon/cel shading with outlining. I was wondering how I could make a toon shaded object transparent while maintaining the toon-style look and without revealing the "insides".

The Toon outline is done by drawing all the backfacing polygons with a thick black wireframe. So far I've tried the "screen-door" method using glPolygonStipple, which does give me transparency, but the issue is that I see all the polygons's outlined in the back.

Any ideas on how to get around this? I suppose at the heart of the issue is how to do the outlining with transparency. Please let me know whether my question is unclear.

Thanks.

ZbuffeR
05-05-2011, 04:49 AM
If you do the transluscent color pass before the edge pass, back edges will not be visible right ?

If you have screenshots it may be easier to see what is happening and what you want to achieve instead.

MichaelM
05-05-2011, 03:45 PM
I'm not too sure what you mean about the translucent color pass and edge pass.

Attached is a screenshot of a transparent shape on the left (with wireframe showing up in the back), and on the right is the normal "toon" shading. I'm trying to acheive something like on the right, but transparent, and without all the extra lines in the back - only the outlining.

ZbuffeR
05-05-2011, 04:19 PM
In this case, you will have to render the shape first without any color write with glColorMask(false,false,false,false); so as to fill in the depth buffer correctly. Then do your stuff as currently.