public class ARBOcclusionQuery
extends java.lang.Object
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.5.
| Modifier and Type | Field and Description |
|---|---|
static int |
GL_CURRENT_QUERY_ARB
Accepted by the
pname parameter of GetQueryivARB. |
static int |
GL_QUERY_COUNTER_BITS_ARB
Accepted by the
pname parameter of GetQueryivARB. |
static int |
GL_QUERY_RESULT_ARB
Accepted by the
pname parameter of GetQueryObjectivARB and GetQueryObjectuivARB. |
static int |
GL_QUERY_RESULT_AVAILABLE_ARB
Accepted by the
pname parameter of GetQueryObjectivARB and GetQueryObjectuivARB. |
static int |
GL_SAMPLES_PASSED_ARB
Accepted by the
target parameter of BeginQueryARB, EndQueryARB, and GetQueryivARB. |
| Modifier and Type | Method and Description |
|---|---|
static void |
glBeginQueryARB(int target,
int id)
Creates a query object and makes it active.
|
static void |
glDeleteQueriesARB(int id)
Deletes named query objects.
|
static void |
glDeleteQueriesARB(int[] ids)
Array version of:
DeleteQueriesARB |
static void |
glDeleteQueriesARB(java.nio.IntBuffer ids)
Deletes named query objects.
|
static void |
glEndQueryARB(int target)
Marks the end of the sequence of commands to be tracked for the active query specified by
target. |
static int |
glGenQueriesARB()
Generates query object names.
|
static void |
glGenQueriesARB(int[] ids)
Array version of:
GenQueriesARB |
static void |
glGenQueriesARB(java.nio.IntBuffer ids)
Generates query object names.
|
static int |
glGetQueryiARB(int target,
int pname)
Returns parameters of a query object target.
|
static void |
glGetQueryivARB(int target,
int pname,
int[] params)
Array version of:
GetQueryivARB |
static void |
glGetQueryivARB(int target,
int pname,
java.nio.IntBuffer params)
Returns parameters of a query object target.
|
static int |
glGetQueryObjectiARB(int id,
int pname)
Returns the integer value of a query object parameter.
|
static void |
glGetQueryObjectivARB(int id,
int pname,
int[] params)
Array version of:
GetQueryObjectivARB |
static void |
glGetQueryObjectivARB(int id,
int pname,
java.nio.IntBuffer params)
Returns the integer value of a query object parameter.
|
static int |
glGetQueryObjectuiARB(int id,
int pname)
Unsigned version of
GetQueryObjectivARB. |
static void |
glGetQueryObjectuivARB(int id,
int pname,
int[] params)
Array version of:
GetQueryObjectuivARB |
static void |
glGetQueryObjectuivARB(int id,
int pname,
java.nio.IntBuffer params)
Unsigned version of
GetQueryObjectivARB. |
static boolean |
glIsQueryARB(int id)
Determine if a name corresponds to a query object.
|
static void |
nglDeleteQueriesARB(int n,
long ids)
Unsafe version of:
DeleteQueriesARB |
static void |
nglGenQueriesARB(int n,
long ids)
Unsafe version of:
GenQueriesARB |
static void |
nglGetQueryivARB(int target,
int pname,
long params)
Unsafe version of:
GetQueryivARB |
static void |
nglGetQueryObjectivARB(int id,
int pname,
long params)
Unsafe version of:
GetQueryObjectivARB |
static void |
nglGetQueryObjectuivARB(int id,
int pname,
long params)
Unsafe version of:
GetQueryObjectuivARB |
public static final int GL_SAMPLES_PASSED_ARB
target parameter of BeginQueryARB, EndQueryARB, and GetQueryivARB.public static final int GL_QUERY_COUNTER_BITS_ARB
pname parameter of GetQueryivARB.public static final int GL_CURRENT_QUERY_ARB
pname parameter of GetQueryivARB.public static final int GL_QUERY_RESULT_ARB
pname parameter of GetQueryObjectivARB and GetQueryObjectuivARB.public static final int GL_QUERY_RESULT_AVAILABLE_ARB
pname parameter of GetQueryObjectivARB and GetQueryObjectuivARB.public static void nglGenQueriesARB(int n,
long ids)
GenQueriesARBn - the number of query object names to be generatedpublic static void glGenQueriesARB(java.nio.IntBuffer ids)
ids - a buffer in which the generated query object names are storedpublic static int glGenQueriesARB()
public static void nglDeleteQueriesARB(int n,
long ids)
DeleteQueriesARBn - the number of query objects to be deletedpublic static void glDeleteQueriesARB(java.nio.IntBuffer ids)
ids - an array of query objects to be deletedpublic static void glDeleteQueriesARB(int id)
public static boolean glIsQueryARB(int id)
id - a value that may be the name of a query objectpublic static void glBeginQueryARB(int target,
int id)
target - the target type of query object established. One of:SAMPLES_PASSED | PRIMITIVES_GENERATED | TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN | TIME_ELAPSED |
TIMESTAMP | ANY_SAMPLES_PASSED | ANY_SAMPLES_PASSED_CONSERVATIVE |
id - the name of a query objectpublic static void glEndQueryARB(int target)
target.target - the query object target. One of:SAMPLES_PASSED | PRIMITIVES_GENERATED | TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN | TIME_ELAPSED |
TIMESTAMP | ANY_SAMPLES_PASSED | ANY_SAMPLES_PASSED_CONSERVATIVE |
public static void nglGetQueryivARB(int target,
int pname,
long params)
GetQueryivARBpublic static void glGetQueryivARB(int target,
int pname,
java.nio.IntBuffer params)
target - the query object target. One of:SAMPLES_PASSED | PRIMITIVES_GENERATED | TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN | TIME_ELAPSED |
TIMESTAMP | ANY_SAMPLES_PASSED | ANY_SAMPLES_PASSED_CONSERVATIVE |
pname - the symbolic name of a query object target parameter. One of:QUERY_COUNTER_BITS_ARB | CURRENT_QUERY_ARB |
params - the requested datapublic static int glGetQueryiARB(int target,
int pname)
target - the query object target. One of:SAMPLES_PASSED | PRIMITIVES_GENERATED | TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN | TIME_ELAPSED |
TIMESTAMP | ANY_SAMPLES_PASSED | ANY_SAMPLES_PASSED_CONSERVATIVE |
pname - the symbolic name of a query object target parameter. One of:QUERY_COUNTER_BITS_ARB | CURRENT_QUERY_ARB |
public static void nglGetQueryObjectivARB(int id,
int pname,
long params)
GetQueryObjectivARBpublic static void glGetQueryObjectivARB(int id,
int pname,
java.nio.IntBuffer params)
id - the name of a query objectpname - the symbolic name of a query object parameter. One of:QUERY_RESULT_ARB | QUERY_RESULT_AVAILABLE_ARB |
params - the requested datapublic static int glGetQueryObjectiARB(int id,
int pname)
id - the name of a query objectpname - the symbolic name of a query object parameter. One of:QUERY_RESULT_ARB | QUERY_RESULT_AVAILABLE_ARB |
public static void nglGetQueryObjectuivARB(int id,
int pname,
long params)
GetQueryObjectuivARBpublic static void glGetQueryObjectuivARB(int id,
int pname,
java.nio.IntBuffer params)
GetQueryObjectivARB.id - the name of a query objectpname - the symbolic name of a query object parameter. One of:QUERY_RESULT_ARB | QUERY_RESULT_AVAILABLE_ARB |
params - the requested datapublic static int glGetQueryObjectuiARB(int id,
int pname)
GetQueryObjectivARB.id - the name of a query objectpname - the symbolic name of a query object parameter. One of:QUERY_RESULT_ARB | QUERY_RESULT_AVAILABLE_ARB |
public static void glGenQueriesARB(int[] ids)
GenQueriesARBpublic static void glDeleteQueriesARB(int[] ids)
DeleteQueriesARBpublic static void glGetQueryivARB(int target,
int pname,
int[] params)
GetQueryivARBpublic static void glGetQueryObjectivARB(int id,
int pname,
int[] params)
GetQueryObjectivARBpublic static void glGetQueryObjectuivARB(int id,
int pname,
int[] params)
GetQueryObjectuivARBCopyright LWJGL. All Rights Reserved. License terms.