March 2013
Intermediate to advanced
984 pages
26h 18m
English
Primitives are produced in the geometry shader with the two special built-in functions, EmitVertex() and EndPrimitive(). As already discussed, a single geometry shader invocation must call EmitVertex() and possibly EndPrimitive() to produce output primitives. If the geometry shader does not call these functions, no output geometry is produced, and the inputs to the shader are essentially discarded. This is culling. On the other hand, if the geometry shader calls EmitVertex() many times, it can produce more output than it receives at its input, amplifying the geometry.
Another unique feature of geometry shaders is that they can have a different primitive type for their output than they do for their input. This can be used ...