March 2013
Intermediate to advanced
984 pages
26h 18m
English
The following are some tips for using geometry shaders wisely. This will help you obtain the best possible performance from a program using geometry shaders. These aren’t hard-and-fast rules, but if followed should allow you to use geometry shaders effectively in your programs.
If you have work that is to be done per-vertex, do it in the vertex shader (or tessellation evaluation shader, if present). When rendering triangle strips or fans, each triangle is presented individually to the geometry shader. Performing per-vertex work in the geometry shader will result in it being done multiple times per vertex. Likewise, if you have work that is to be done per-face (such as calculating the values ...