Geometry shader
Geometry shader (abbreviation GS) is a shader program, normally excecuted on the Graphics processing unit.
Function
A geometry shader can generate new primitives from existing primitives like pixels, lines and triangles.
Geometry shader is executed after Vertex shader and it's input is the whole primitive or primitive with adjacency information. For example, when operating on triangles, three vertices are geometry shader's input. Geometry shader can then emit zero or more primives, which are rasterized and their fragments ultimately passed to Pixel shader.
Typical uses of a geometry shader include point sprite generation, geometry tesselation, shadow volume extrusion, single pass rendering to a cube map.
Programming
Geometry shaders are programmed in the following languages: Assembler, HLSL, GLSL.
Further reading
References
- OpenGL Shading Language – Documentation of Shader in OpenGL
- OGSL Tutorial (engl.)
- Quellcode examples