March 2013
Intermediate to advanced
984 pages
26h 18m
English
The simplest possible geometry shader is a culling geometry shader. The shader does absolutely nothing. We already gave an example of a simple geometry shader earlier in this chapter. The pass-through geometry shader is possibly the simplest geometry that actually does anything. However, Example 10.5 contains a perfectly legal geometry shader.
Example 10.5. A Geometry Shader that Drops Everything
#version 330 corelayout (triangles) in; layout (triangle_strip, max_vertices = 3) out; void main() { /* Do nothing */}
However, this isn’t particularly useful—it doesn’t produce any output primitives and using it in a program will result in absolutely nothing being rendered. Now, consider that the geometry ...