public class ARBSamplerObjects
extends java.lang.Object
In unextended OpenGL textures are considered to be sets of image data (mip-chains, arrays, cube-map face sets, etc.) and sampling state (sampling mode, mip-mapping state, coordinate wrapping and clamping rules, etc.) combined into a single object. It is typical for an application to use many textures with a limited set of sampling states that are the same between them. In order to use textures in this way, an application must generate and configure many texture names, adding overhead both to applications and to implementations. Furthermore, should an application wish to sample from a texture in more than one way (with and without mip-mapping, for example) it must either modify the state of the texture or create two textures, each with a copy of the same image data. This can introduce runtime and memory costs to the application.
This extension separates sampler state from texture image data. A new object type is introduced, the sampler (representing generic sampling parameters). The new sampler objects are represented by a new named type encapsulating the sampling parameters of a traditional texture object. Sampler objects may be bound to texture units to supplant the bound texture's sampling state. A single sampler may be bound to more than one texture unit simultaneously, allowing different textures to be accessed with a single set of shared sampling parameters. Also, by binding different sampler objects to texture units to which the same texture has been bound, the same texture image data may be sampled with different sampling parameters.
Promoted to core in OpenGL 3.3.
| Modifier and Type | Field and Description |
|---|---|
static int |
GL_SAMPLER_BINDING
Accepted by the
value parameter of the GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv and GetDoublev functions. |
| Modifier and Type | Method and Description |
|---|---|
static void |
glBindSampler(int unit,
int sampler)
Binds a named sampler to a texturing target.
|
static void |
glDeleteSamplers(int sampler)
Deletes named sampler objects.
|
static void |
glDeleteSamplers(int[] samplers)
Array version of:
DeleteSamplers |
static void |
glDeleteSamplers(java.nio.IntBuffer samplers)
Deletes named sampler objects.
|
static int |
glGenSamplers()
Generates sampler object names.
|
static void |
glGenSamplers(int[] samplers)
Array version of:
GenSamplers |
static void |
glGenSamplers(java.nio.IntBuffer samplers)
Generates sampler object names.
|
static float |
glGetSamplerParameterf(int sampler,
int pname)
Float version of
GetSamplerParameteriv. |
static void |
glGetSamplerParameterfv(int sampler,
int pname,
float[] params)
Array version of:
GetSamplerParameterfv |
static void |
glGetSamplerParameterfv(int sampler,
int pname,
java.nio.FloatBuffer params)
Float version of
GetSamplerParameteriv. |
static int |
glGetSamplerParameteri(int sampler,
int pname)
Return the integer value(s) of a sampler parameter.
|
static int |
glGetSamplerParameterIi(int sampler,
int pname)
Pure integer version of
GetSamplerParameteriv. |
static void |
glGetSamplerParameterIiv(int sampler,
int pname,
int[] params)
Array version of:
GetSamplerParameterIiv |
static void |
glGetSamplerParameterIiv(int sampler,
int pname,
java.nio.IntBuffer params)
Pure integer version of
GetSamplerParameteriv. |
static int |
glGetSamplerParameterIui(int sampler,
int pname)
Unsigned pure integer version of
GetSamplerParameteriv. |
static void |
glGetSamplerParameterIuiv(int sampler,
int pname,
int[] params)
Array version of:
GetSamplerParameterIuiv |
static void |
glGetSamplerParameterIuiv(int sampler,
int pname,
java.nio.IntBuffer params)
Unsigned pure integer version of
GetSamplerParameteriv. |
static void |
glGetSamplerParameteriv(int sampler,
int pname,
int[] params)
Array version of:
GetSamplerParameteriv |
static void |
glGetSamplerParameteriv(int sampler,
int pname,
java.nio.IntBuffer params)
Return the integer value(s) of a sampler parameter.
|
static boolean |
glIsSampler(int sampler)
Determines if a name corresponds to a sampler object.
|
static void |
glSamplerParameterf(int sampler,
int pname,
float param)
Float version of
SamplerParameteri. |
static void |
glSamplerParameterfv(int sampler,
int pname,
float[] params)
Array version of:
SamplerParameterfv |
static void |
glSamplerParameterfv(int sampler,
int pname,
java.nio.FloatBuffer params)
Float version of
SamplerParameteriv. |
static void |
glSamplerParameteri(int sampler,
int pname,
int param)
Set the integer value of a sampler parameter.
|
static void |
glSamplerParameterIiv(int sampler,
int pname,
int[] params)
Array version of:
SamplerParameterIiv |
static void |
glSamplerParameterIiv(int sampler,
int pname,
java.nio.IntBuffer params)
Pure integer version of
SamplerParameteriv. |
static void |
glSamplerParameterIuiv(int sampler,
int pname,
int[] params)
Array version of:
SamplerParameterIuiv |
static void |
glSamplerParameterIuiv(int sampler,
int pname,
java.nio.IntBuffer params)
Unsigned pure integer version of
SamplerParameteriv. |
static void |
glSamplerParameteriv(int sampler,
int pname,
int[] params)
Array version of:
SamplerParameteriv |
static void |
glSamplerParameteriv(int sampler,
int pname,
java.nio.IntBuffer params)
Pointer version of
SamplerParameteri. |
static void |
nglDeleteSamplers(int count,
long samplers)
Unsafe version of:
DeleteSamplers |
static void |
nglGenSamplers(int count,
long samplers)
Unsafe version of:
GenSamplers |
static void |
nglGetSamplerParameterfv(int sampler,
int pname,
long params)
Unsafe version of:
GetSamplerParameterfv |
static void |
nglGetSamplerParameterIiv(int sampler,
int pname,
long params)
Unsafe version of:
GetSamplerParameterIiv |
static void |
nglGetSamplerParameterIuiv(int sampler,
int pname,
long params)
Unsafe version of:
GetSamplerParameterIuiv |
static void |
nglGetSamplerParameteriv(int sampler,
int pname,
long params)
Unsafe version of:
GetSamplerParameteriv |
static void |
nglSamplerParameterfv(int sampler,
int pname,
long params)
Unsafe version of:
SamplerParameterfv |
static void |
nglSamplerParameterIiv(int sampler,
int pname,
long params)
Unsafe version of:
SamplerParameterIiv |
static void |
nglSamplerParameterIuiv(int sampler,
int pname,
long params)
Unsafe version of:
SamplerParameterIuiv |
static void |
nglSamplerParameteriv(int sampler,
int pname,
long params)
Unsafe version of:
SamplerParameteriv |
public static final int GL_SAMPLER_BINDING
value parameter of the GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv and GetDoublev functions.public static void nglGenSamplers(int count,
long samplers)
GenSamplerscount - the number of sampler object names to generatepublic static void glGenSamplers(java.nio.IntBuffer samplers)
samplers - a buffer in which the generated sampler object names are storedpublic static int glGenSamplers()
public static void nglDeleteSamplers(int count,
long samplers)
DeleteSamplerscount - the number of sampler objects to be deletedpublic static void glDeleteSamplers(java.nio.IntBuffer samplers)
samplers - an array of sampler objects to be deletedpublic static void glDeleteSamplers(int sampler)
public static boolean glIsSampler(int sampler)
sampler - a value that may be the name of a sampler objectpublic static void glBindSampler(int unit,
int sampler)
unit - the index of the texture unit to which the sampler is boundsampler - the name of a samplerpublic static void glSamplerParameteri(int sampler,
int pname,
int param)
sampler - the sampler object whose parameter to modifypname - the symbolic name of a single-valued sampler parameter. One of:TEXTURE_WRAP_S | TEXTURE_WRAP_T | TEXTURE_WRAP_R | TEXTURE_MIN_FILTER | TEXTURE_MAG_FILTER |
TEXTURE_MIN_LOD | TEXTURE_MAX_LOD | TEXTURE_LOD_BIAS | TEXTURE_COMPARE_MODE | TEXTURE_COMPARE_FUNC |
param - the value of pnamepublic static void glSamplerParameterf(int sampler,
int pname,
float param)
SamplerParameteri.sampler - the sampler object whose parameter to modifypname - the symbolic name of a single-valued sampler parameterparam - the value of pnamepublic static void nglSamplerParameteriv(int sampler,
int pname,
long params)
SamplerParameterivpublic static void glSamplerParameteriv(int sampler,
int pname,
java.nio.IntBuffer params)
SamplerParameteri.sampler - the sampler object whose parameter to modifypname - the symbolic name of a sampler parameter. One of:TEXTURE_BORDER_COLOR | TEXTURE_WRAP_S | TEXTURE_WRAP_T | TEXTURE_WRAP_R |
TEXTURE_MIN_FILTER | TEXTURE_MAG_FILTER | TEXTURE_MIN_LOD | TEXTURE_MAX_LOD |
TEXTURE_LOD_BIAS | TEXTURE_COMPARE_MODE | TEXTURE_COMPARE_FUNC |
params - an array where the value or values of pname are storedpublic static void nglSamplerParameterfv(int sampler,
int pname,
long params)
SamplerParameterfvpublic static void glSamplerParameterfv(int sampler,
int pname,
java.nio.FloatBuffer params)
SamplerParameteriv.sampler - the sampler object whose parameter to modifypname - the symbolic name of a sampler parameterparams - an array where the value or values of pname are storedpublic static void nglSamplerParameterIiv(int sampler,
int pname,
long params)
SamplerParameterIivpublic static void glSamplerParameterIiv(int sampler,
int pname,
java.nio.IntBuffer params)
SamplerParameteriv.sampler - the sampler object whose parameter to modifypname - the symbolic name of a sampler parameterparams - an array where the value or values of pname are storedpublic static void nglSamplerParameterIuiv(int sampler,
int pname,
long params)
SamplerParameterIuivpublic static void glSamplerParameterIuiv(int sampler,
int pname,
java.nio.IntBuffer params)
SamplerParameteriv.sampler - the sampler object whose parameter to modifypname - the symbolic name of a sampler parameterparams - an array where the value or values of pname are storedpublic static void nglGetSamplerParameteriv(int sampler,
int pname,
long params)
GetSamplerParameterivpublic static void glGetSamplerParameteriv(int sampler,
int pname,
java.nio.IntBuffer params)
sampler - the name of the sampler object from which to retrieve parameterspname - the symbolic name of a sampler parameter. One of:TEXTURE_WRAP_S | TEXTURE_WRAP_T | TEXTURE_WRAP_R | TEXTURE_MIN_FILTER | TEXTURE_MAG_FILTER |
TEXTURE_MIN_LOD | TEXTURE_MAX_LOD | TEXTURE_LOD_BIAS | TEXTURE_COMPARE_MODE | TEXTURE_COMPARE_FUNC |
| , | TEXTURE_BORDER_COLOR |
params - the sampler parameterspublic static int glGetSamplerParameteri(int sampler,
int pname)
sampler - the name of the sampler object from which to retrieve parameterspname - the symbolic name of a sampler parameter. One of:TEXTURE_WRAP_S | TEXTURE_WRAP_T | TEXTURE_WRAP_R | TEXTURE_MIN_FILTER | TEXTURE_MAG_FILTER |
TEXTURE_MIN_LOD | TEXTURE_MAX_LOD | TEXTURE_LOD_BIAS | TEXTURE_COMPARE_MODE | TEXTURE_COMPARE_FUNC |
| , | TEXTURE_BORDER_COLOR |
public static void nglGetSamplerParameterfv(int sampler,
int pname,
long params)
GetSamplerParameterfvpublic static void glGetSamplerParameterfv(int sampler,
int pname,
java.nio.FloatBuffer params)
GetSamplerParameteriv.sampler - the name of the sampler object from which to retrieve parameterspname - the symbolic name of a sampler parameterparams - the sampler parameterspublic static float glGetSamplerParameterf(int sampler,
int pname)
GetSamplerParameteriv.sampler - the name of the sampler object from which to retrieve parameterspname - the symbolic name of a sampler parameterpublic static void nglGetSamplerParameterIiv(int sampler,
int pname,
long params)
GetSamplerParameterIivpublic static void glGetSamplerParameterIiv(int sampler,
int pname,
java.nio.IntBuffer params)
GetSamplerParameteriv.sampler - the name of the sampler object from which to retrieve parameterspname - the symbolic name of a sampler parameterparams - the sampler parameterspublic static int glGetSamplerParameterIi(int sampler,
int pname)
GetSamplerParameteriv.sampler - the name of the sampler object from which to retrieve parameterspname - the symbolic name of a sampler parameterpublic static void nglGetSamplerParameterIuiv(int sampler,
int pname,
long params)
GetSamplerParameterIuivpublic static void glGetSamplerParameterIuiv(int sampler,
int pname,
java.nio.IntBuffer params)
GetSamplerParameteriv.sampler - the name of the sampler object from which to retrieve parameterspname - the symbolic name of a sampler parameterparams - the sampler parameterspublic static int glGetSamplerParameterIui(int sampler,
int pname)
GetSamplerParameteriv.sampler - the name of the sampler object from which to retrieve parameterspname - the symbolic name of a sampler parameterpublic static void glGenSamplers(int[] samplers)
GenSamplerspublic static void glDeleteSamplers(int[] samplers)
DeleteSamplerspublic static void glSamplerParameteriv(int sampler,
int pname,
int[] params)
SamplerParameterivpublic static void glSamplerParameterfv(int sampler,
int pname,
float[] params)
SamplerParameterfvpublic static void glSamplerParameterIiv(int sampler,
int pname,
int[] params)
SamplerParameterIivpublic static void glSamplerParameterIuiv(int sampler,
int pname,
int[] params)
SamplerParameterIuivpublic static void glGetSamplerParameteriv(int sampler,
int pname,
int[] params)
GetSamplerParameterivpublic static void glGetSamplerParameterfv(int sampler,
int pname,
float[] params)
GetSamplerParameterfvpublic static void glGetSamplerParameterIiv(int sampler,
int pname,
int[] params)
GetSamplerParameterIivpublic static void glGetSamplerParameterIuiv(int sampler,
int pname,
int[] params)
GetSamplerParameterIuivCopyright LWJGL. All Rights Reserved. License terms.