- Geometry shader
A geometry shader (abbreviated "GS") is a shader program model introduced with Shader Model 4.0 of
DirectX 10 [ [http://msdn.microsoft.com/en-us/library/bb509626(VS.85).aspx msdn: Shader Models vs Shader Profiles] ] .NVIDIA GeForce 8800 GPUs were the first providing hardware support for Geometry Shaders [ [http://www.nvidia.com/object/8800_faq.html NVIDIA GeForce 8800 FAQ] ] . This feature is supported in DirectX 10 (only available on Microsoft Windows Vista) and in OpenGL through an extension [ [http://developer.download.nvidia.com/opengl/specs/GL_EXT_geometry_shader4.txt OpenGL Geometry Shader4 Extension] ] .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 [ [http://msdn.microsoft.com/en-us/library/bb205123(VS.85).aspx msdn: Pipeline Stages (Direct3D 10)] ] .Geometry shader programs are executed after
vertex shader s. 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 apixel shader .Typical uses of a geometry shader include point sprite generation, geometry
tessellation ,shadow volume extrusion, and single pass rendering to acube 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.
A research program led by
Gernot Ziegler [ [http://www.mpi-inf.mpg.de/~gziegler/ MPG Germany, Ziegler Homepage] ] . developedHistopyramids which appear to give better performance than geometry shaders in a variety of situations [ [http://www.gpgpu.org/forums/viewtopic.php?t=4813 GPGPU Forums post] ] .Programming
Geometry shaders can be programmed in the following languages: assembly, Cg, Direct3D's HLSL (beginning with DirectX 10) and OpenGL's GLSL.
See also
*
Vertex shader
*Pixel shader
*Graphics pipeline
*Direct3D
*OpenGL References
External links
* [http://wiki.directxers.com/index.php?title=Tutorial_5:_Geometry_Shader Geometry Shader tutorial code at DirectXers.com Wiki site]
Wikimedia Foundation. 2010.