Jump to content

Geometry shader

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by EvanED (talk | contribs) at 17:03, 29 January 2008 (One more wording change). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

A geometry shader (abbreviated GS) is a shader program, normally executed on the graphics processing unit.

Function

A geometry shader can generate new graphics primitives, such as pixels, lines, and triangles, from those primitives that were sent to the beginning of the graphics pipeline.

Geometry shader programs are executed after vertex shaders. They take as input a whole primitive, possibly with adjacency information. For example, when operating on triangles, the three vertices are the geometry shader's input. The shader can then emit zero or more primitives, which are rasterized and their fragments ultimately passed to a pixel shader.

Typical uses of a geometry shader include point sprite generation, geometry tessellation, shadow volume extrusion, and single pass rendering to a cube map.

Programming

Geometry shaders can be programmed in the following languages: assembly, Cg, and Direct3D's HLSL beginning with DirectX 10. OpenGL's GLSL does not yet support geometry shaders, but the next version is expected to include support. Furthermore, although OpenGL does not support geometry shaders in its core functionality, some graphics cards offer extensions to GLSL to allow for the programming of geometry shaders.

See also

References