3D Graphics - OpenGL

Shader Techniques - Geometry Shader

URL Description
Adjacency informaiton
Easy wireframe display with barycentric coordinates

Sometimes it's required to display a wireframe of your model. The following post looks into how to do that in a flexible way. If you debug your WebGL program or if you have a need to display a wireframe of your model in WebGL, there is one traditional choice: gl.LINES. However this requires you to supply a separate mesh to the GPU independently of your model. This can be inconvenient and wasteful. An alternative to do this is using barycentric coordinates to figure out how close you are to an edge during fragment shading.

GLSL Core Tutorial - Geometry Shader
GPU GLSL Geometry Shader
Geometry Shader Examples
Geometry shader producing gaps between lines (mesh intersecting plane)

I wrote a geometry shader to compute the intersection contour of a mesh and a plane, but at the intersection points there are sometimes 1 pixel wide gaps between two lines.

Shader-Based Wireframe Drawing
Smooth thick lines using geometry shader

Discussion on how to draw nice thick smooth lines using the GLSL geometry shader.

Wireframe Overlay Shader