Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Meaning of geometry shader input primitive when using tessellation shaders

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2009
    Posts
    12

    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 http://www.opengl.org/registry/specs...ion_shader.txt :

    "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.

    Jim
    University at Albany
    Albany, NY USA

  2. #2
    Junior Member Newbie
    Join Date
    Sep 2009
    Posts
    12
    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.
    Jim

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •