Mesh contour geometry shader

dear shader wizards,

I am trying to draw silhouette lines with the geometry shader from the OpenGL4 cookbook. It works by checking the orientation of adjacent triangles. If one is facing away from the camera, it draws a billboard quad on that edge. And those quads should make up the silhouette line.

I seem to have trouble with the winding order. When using a triangle list with adjacency winding order should be (0,2,4). However I have to wind them backwards using 0,4,2, to make it look like above. (using backculling)

Either way seems like every 2nd triangle is missing. I would like to know why half of my triangles are disappearing. Regardless of orientation, the GS should draw each main triangle:


Any hints are welcome!

I have attached my v4 patch as well as the openGL source code. (9.0 KB)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.