Meaning of geometry shader input primitive when using tessellation shaders

I have been experimenting with tessellation and geometry shaders while updating an older, non-shader OpenGL program for non-photorealistic landscape rendering. I now have a working test program that takes a grid elevation model, tessellates it on viewpoint distance, and renders the surface with a simple normal shading model. I am thinking about adding a geometry shader to do wireframe rendering of the tessellation (mainly for debugging) but possibly for some other effects later.

When using a geometry shader with TCS and TES shaders, I assumed (wrong, I’m guessing) that the geometry shader would be invoked once for each tessellated triangle (that is, an output triangle from the primitive generator following the TCS). Instead, I’m getting linework that looks like its based entirely on the untessellated patch vertices (I’m drawing with vertices in gl_in[] in the geometry shader). This seems to be implied by this paragraph in :

“After vertex transformation and tessellation, a geometry shader is executed on each individual point, line, triangle, or patch primitive, if one is active. It can read the attributes of each transformed vertex in the primitive, perform arbitrary computations, and emit new transformed vertices. These emitted vertices are themselves assembled into primitives according to the output primitive type of the geometry shader.”

So, finally, the big question: Does the geometry shader ignore the tessellated triangle vertices and just use the patch vertices? Or should I be looking for bugs in my program? I’m using #version 410 for all shaders and use layout(triangles) in in the geometry shader.

Thanks for any insights.


Never mind–I didn’t zoom in close enough to see the tessellations. If anyone cares, the geometry shader is indeed getting the tessellated primitives. Whoops.

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