Jump to content

Geometry shader

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Ofbarea (talk | contribs) at 17:14, 3 August 2008 (Remove redundant "only" word.). 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 model introduced with Shader Model 4.0 of DirectX 10[1]. NVIDIA GeForce 8800 GPUs were the first providing hardware support for Geometry Shaders[2]. This feature is supported in DirectX 10 (only available on Microsoft Windows Vista) and in OpenGL through an extension[3].

Function

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

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.

A typical real world example of the benefits of geometry shaders would be automatic mesh complexity modification. A series of line strips representing control points for a curve are passed to the geometry shader and depending on the complexity required the shader can automatically generate extra lines each of which provides a better approximation of a curve.

Programming

Geometry shaders can be programmed in the following languages: assembly, Cg, and Direct3D's HLSL (beginning with DirectX 10) and OpenGL's GLSL.

See also

References