What is a query object in OpenGL?
I have found glBeginQuery function in the OpenGL SDK.
So, what is the query object and ho开发者_Go百科w is it used?
Look at occlusion query. It allows you to retrieve the number of fragments drawn.
A common usage for this extension is to draw bounding boxes of objects while color and zbuffer is in read only mode. Then, thanks to this query object you get the number of fragments that the bounding box would have drawn. If that number is bellow a certain threshold, you don't draw the corresponding geometry. That allows you to cull parts of the scene that is hidden by other objects (but still inside the frustum).
It's used to query properties of the object in the scene, eg. is it occluded
http://www.opengl-doc.com/Sams-OpenGL.SuperBible.Third/0672326019/ch17lev1sec3.html
精彩评论