_ Render only filled front faces with toon texture.
_ Render only back faces in wire frame with size of 10 for example in black.(this render the silhouette)
With two pass, the algorithm works well.
Now, i try to render the scene in one pass!
I set the toon texture with GL_MODULATE.
In the vertex program, i put white color in the register for front face color
and black color in the register for back face color and then render the scene(front filled face and back face in line).
The problem is that back face(in line) are in toon shading and i want them black(for the silhouette).
When did back face color are used in OpenGL?
Do i have to activate an extension or OpenGL lighting system??
actually twosided lighting isn’t the right way to do siluette detection for toon rendering.
on new hw i would use fp’s for this task (take a look at the NPR-demo from the ATI-website)
when you want to remain compatible with “old” hw below dx9 level, i suggest detecting the siluette edges on the cpu, and draw the siluettes only.
take a look at the stencil-shadow-volume extrusion alogrithm. simply use the viewport position instead of the lightposition to determine the siliette edges and then simply draw them using GL_LINES or - more sophisticated - with screenaligned quads.