I have read about being able to dynamically adding vertices and faces in the shader. However, I don’t understand how it is done. I looked over some examples but the basic idea is clouded with unrelated issues (animation, blending, texture data structures…) I simply want to understand how to dynamically at runtime add verticies in the shader. Is there a simple example of how to do this or can someone explain?
As a basic example for learning, can you tell me how to do this:
I have 1 triangle face (3 vertices). I send each vertex to the vertex shader for processing (The CPU only knows about these 3 vertices). In the shader, add 1 vertex per edge which will make a total of 6 vertices and 4 faces, from the original 3 vertices and 1 face.
Not really intended as a general tessellator, but good for turning point and lines into quads, extruding shadow volumes, single pass rtt cubemap and such.
P.S. Looks like the GS has clinched a berth in the OpenGL 3.1 series