C.4. Cull Unseen Geometry
If your application is geometry limited, a good way to avoid bottlenecks, or at least reduce their effects, is to send less geometry to OpenGL in the first place.
Performance-conscious applications commonly perform
In some instances, geometry is inside the view volume but still not visible. Imagine an automobile design application rendering a model of a car, in which the engine is
OpenGL provides the occlusion query feature for this situation, which appendix A, "Other Features," describes in brief. Note that occlusion queries return data to the application. This in itself can be the cause of performance problems. To avoid stalling the rendering pipe, issue occlusion queries during rendering, but obtain
Another popular technique for optimizing occlusion queries is to arrange your geometry so that frames are rendered in front-to-back (or outside-to-inside) order. This maximizes the chance for occlusion to occur.
C.5. State Changes and Queries
In general, modern OpenGL graphics hardware
Avoid unnecessary state changes with the following tips:
Obviously, OpenGL implementations set state in the underlying graphics hardware, but they also keep a shadow copy of many state values in host RAM. Querying a state item stored in shadow state requires only a data copy and, therefore, is relatively inexpensive.