Section A.2. Occlusion Queries


A.2. Occlusion Queries

Occlusion queries, added in OpenGL version 1.5, allow applications to determine efficiently whether geometry is visible. Applications use occlusion queries to avoid sending complex geometry to OpenGL when the geometry isn't visible.

To use the occlusion query feature:

  1. Generate a query object to hold the occlusion query result, typically at application init time.

  2. During rendering, initiate an occlusion query, render a simple bounding geometry, and end the occlusion query.

  3. Obtain the result from the query object, which is a count of the number of fragments (or samples, if using multisample) that passed the depth test.

  4. If the query result indicates that a significant amount of the geometry is visible, render the geometry in full; otherwise, skip it, thereby increasing performance by not rendering occluded geometry.

This overview of occlusion queries might not result in maximum performance. appendix C, "Performance," describes a more optimal approach.

For more information on occlusion queries, see Sections 4.1.7 and 6.1.12 of The OpenGL Graphics System.




OpenGL Distilled
OpenGL Distilled
ISBN: 0321336798
EAN: 2147483647
Year: 2007
Pages: 123
Authors: Paul Martz

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net