This extension defines a mechanism whereby an application can query the number of pixels (or, more precisely, samples) drawn by a primitive or group of primitives.
The primary purpose of such a query (hereafter referred to as an "occlusion query") is to determine the visibility of an object. Typically, the application will render the major occluders in the scene, then perform an occlusion query for the bounding box of each detail object in the scene. Only if said bounding box is visible, i.e., if at least one sample is drawn, should the corresponding object be drawn.
The earlier HP_occlusion_test extension defined a similar mechanism, but it had two major shortcomings.
TRUE/FALSE result, when in fact it is often useful to know exactly how many samples were drawn.This extension solves both of those problems. It returns as its result the number of samples that pass the depth and stencil tests, and it encapsulates occlusion queries in "query objects" that allow applications to issue many queries before asking for the result of any one. As a result, they can overlap the time it takes for the occlusion query results to be returned with other, more useful work, such as rendering other parts of the scene or performing other computations on the CPU.
There are many situations where a pixel/sample count, rather than a boolean result, is useful.
Promoted to core in OpenGL 1..
| Modifier and Type | Field and Description |
|---|---|
| public static final int | GL_CURRENT_QUERY_ARB
Accepted by the |
| public static final int | GL_QUERY_COUNTER_BITS_ARB
Accepted by the |
| public static final int | GL_QUERY_RESULT_ARB
Accepted by the |
| public static final int | GL_QUERY_RESULT_AVAILABLE_ARB
Accepted by the |
| public static final int | GL_SAMPLES_PASSED_ARB
Accepted by the |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description | |||||||
|---|---|---|---|---|---|---|---|---|
| public static native void | glBeginQueryARB(int
the target type of query object established. One of: target, int
the name of a query object id)Creates a query object and makes it active. | |||||||
| public static void | glDeleteQueriesARB(IntBuffer
an array of query objects to be deleted ids)Deletes named query objects. | |||||||
| public static void | ||||||||
| public static void | ||||||||
| public static native void | glEndQueryARB(int target)
Marks the end of the sequence of commands to be tracked for the active query specified by | |||||||
| public static void | glGenQueriesARB(IntBuffer
a buffer in which the generated query object names are stored ids)Generates query object names. | |||||||
| public static int | ||||||||
| public static void | ||||||||
| public static int | glGetQueryiARB(int target, int
the symbolic name of a query object target parameter. One of: pname)
Returns parameters of a query object target. | |||||||
| public static void | glGetQueryivARB(int target, int
the symbolic name of a query object target parameter. One of: pname, IntBuffer
the requested data params)Returns parameters of a query object target. | |||||||
| public static void | ||||||||
| public static int | glGetQueryObjectiARB(int
the name of a query object id, int the symbolic name of a query object parameter. One of: pname)
Returns the integer value of a query object parameter. | |||||||
| public static void | glGetQueryObjectivARB(int
the name of a query object id, int the symbolic name of a query object parameter. One of: pname, IntBuffer
the requested data params)Returns the integer value of a query object parameter. | |||||||
| public static void | glGetQueryObjectivARB(int
the name of a query object id, int the symbolic name of a query object parameter. One of: pname, long
the requested data params)Returns the integer value of a query object parameter. | |||||||
| public static void | ||||||||
| public static int | glGetQueryObjectuiARB(int
the name of a query object id, int the symbolic name of a query object parameter. One of: pname)
Unsigned version of | |||||||
| public static void | glGetQueryObjectuivARB(int
the name of a query object id, int the symbolic name of a query object parameter. One of: pname, IntBuffer
the requested data params)Unsigned version of | |||||||
| public static void | glGetQueryObjectuivARB(int
the name of a query object id, int the symbolic name of a query object parameter. One of: pname, long
the requested data params)Unsigned version of | |||||||
| public static void | ||||||||
| public static native boolean | glIsQueryARB(int
a value that may be the name of a query object id)Determine if a name corresponds to a query object. | |||||||
| public static native void | nglDeleteQueriesARB(int
the number of query objects to be deleted n, long ids)Unsafe version of: | |||||||
| public static native void | nglGenQueriesARB(int
the number of query object names to be generated n, long ids)Unsafe version of: | |||||||
| public static native void | ||||||||
| public static native void | ||||||||
| public static native void |
| GL_CURRENT_QUERY_ARB | back to summary |
|---|---|
| public static final int GL_CURRENT_QUERY_ARB Accepted by the | |
| GL_QUERY_COUNTER_BITS_ARB | back to summary |
|---|---|
| public static final int GL_QUERY_COUNTER_BITS_ARB Accepted by the | |
| GL_QUERY_RESULT_ARB | back to summary |
|---|---|
| public static final int GL_QUERY_RESULT_ARB Accepted by the | |
| GL_QUERY_RESULT_AVAILABLE_ARB | back to summary |
|---|---|
| public static final int GL_QUERY_RESULT_AVAILABLE_ARB Accepted by the | |
| GL_SAMPLES_PASSED_ARB | back to summary |
|---|---|
| public static final int GL_SAMPLES_PASSED_ARB Accepted by the | |
| ARBOcclusionQuery | back to summary |
|---|---|
| protected ARBOcclusionQuery() | |
| glBeginQueryARB | back to summary | |||||||
|---|---|---|---|---|---|---|---|---|
| public static native void glBeginQueryARB(int target, int id) Creates a query object and makes it active.
| ||||||||
| glDeleteQueriesARB | back to summary |
|---|---|
| public static void glDeleteQueriesARB(IntBuffer ids) Deletes named query objects.
| |
| glDeleteQueriesARB | back to summary |
|---|---|
| public static void glDeleteQueriesARB(int id) Deletes named query objects. | |
| glDeleteQueriesARB | back to summary |
|---|---|
| public static void glDeleteQueriesARB(int[] ids) Array version of: | |
| glEndQueryARB | back to summary | |||||||
|---|---|---|---|---|---|---|---|---|
| public static native void glEndQueryARB(int target) Marks the end of the sequence of commands to be tracked for the active query specified by
| ||||||||
| glGenQueriesARB | back to summary |
|---|---|
| public static void glGenQueriesARB(IntBuffer ids) Generates query object names.
| |
| glGenQueriesARB | back to summary |
|---|---|
| public static int glGenQueriesARB() Generates query object names.
| |
| glGenQueriesARB | back to summary |
|---|---|
| public static void glGenQueriesARB(int[] ids) Array version of: | |
| glGetQueryiARB | back to summary | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| public static int glGetQueryiARB(int target, int pname) Returns parameters of a query object target.
| ||||||||||
| glGetQueryivARB | back to summary | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| public static void glGetQueryivARB(int target, int pname, IntBuffer params) Returns parameters of a query object target.
| ||||||||||
| glGetQueryivARB | back to summary |
|---|---|
| public static void glGetQueryivARB(int target, int pname, int[] params) Array version of: | |
| glGetQueryObjectiARB | back to summary | ||
|---|---|---|---|
| public static int glGetQueryObjectiARB(int id, int pname) Returns the integer value of a query object parameter.
| |||
| glGetQueryObjectivARB | back to summary | ||
|---|---|---|---|
| public static void glGetQueryObjectivARB(int id, int pname, IntBuffer params) Returns the integer value of a query object parameter.
| |||
| glGetQueryObjectivARB | back to summary | ||
|---|---|---|---|
| public static void glGetQueryObjectivARB(int id, int pname, long params) Returns the integer value of a query object parameter.
| |||
| glGetQueryObjectivARB | back to summary |
|---|---|
| public static void glGetQueryObjectivARB(int id, int pname, int[] params) Array version of: | |
| glGetQueryObjectuiARB | back to summary | ||
|---|---|---|---|
| public static int glGetQueryObjectuiARB(int id, int pname) Unsigned version of
| |||
| glGetQueryObjectuivARB | back to summary | ||
|---|---|---|---|
| public static void glGetQueryObjectuivARB(int id, int pname, IntBuffer params) Unsigned version of
| |||
| glGetQueryObjectuivARB | back to summary | ||
|---|---|---|---|
| public static void glGetQueryObjectuivARB(int id, int pname, long params) Unsigned version of
| |||
| glGetQueryObjectuivARB | back to summary |
|---|---|
| public static void glGetQueryObjectuivARB(int id, int pname, int[] params) Array version of: | |
| glIsQueryARB | back to summary |
|---|---|
| public static native boolean glIsQueryARB(int id) Determine if a name corresponds to a query object.
| |
| nglDeleteQueriesARB | back to summary |
|---|---|
| public static native void nglDeleteQueriesARB(int n, long ids) Unsafe version of:
| |
| nglGenQueriesARB | back to summary |
|---|---|
| public static native void nglGenQueriesARB(int n, long ids) Unsafe version of:
| |
| nglGetQueryivARB | back to summary |
|---|---|
| public static native void nglGetQueryivARB(int target, int pname, long params) Unsafe version of: | |
| nglGetQueryObjectivARB | back to summary |
|---|---|
| public static native void nglGetQueryObjectivARB(int id, int pname, long params) Unsafe version of: | |
| nglGetQueryObjectuivARB | back to summary |
|---|---|
| public static native void nglGetQueryObjectuivARB(int id, int pname, long params) Unsafe version of: | |