Class ARBSamplerObjects
- java.lang.Object
-
- org.lwjgl.opengl.ARBSamplerObjects
-
public class ARBSamplerObjects extends java.lang.Object
Native bindings to the ARB_sampler_objects extension.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
.
-
-
Field Summary
Fields Modifier and Type Field and Description static int
GL_SAMPLER_BINDING
Accepted by thevalue
parameter of the GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv and GetDoublev functions.
-
Method Summary
All Methods Static Methods Concrete Methods 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 ofGetSamplerParameteriv
.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 ofGetSamplerParameteriv
.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 ofGetSamplerParameteriv
.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 ofGetSamplerParameteriv
.static int
glGetSamplerParameterIui(int sampler, int pname)
Unsigned pure integer version ofGetSamplerParameteriv
.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 ofGetSamplerParameteriv
.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 ofSamplerParameteri
.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 ofSamplerParameteriv
.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 ofSamplerParameteriv
.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 ofSamplerParameteriv
.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 ofSamplerParameteri
.
-
-
-
Field Detail
-
GL_SAMPLER_BINDING
public static final int GL_SAMPLER_BINDING
Accepted by thevalue
parameter of the GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv and GetDoublev functions.- See Also:
- Constant Field Values
-
-
Method Detail
-
glGenSamplers
public static void glGenSamplers(java.nio.IntBuffer samplers)
Generates sampler object names.- Parameters:
samplers
- a buffer in which the generated sampler object names are stored
-
glGenSamplers
public static int glGenSamplers()
Generates sampler object names.
-
glDeleteSamplers
public static void glDeleteSamplers(java.nio.IntBuffer samplers)
Deletes named sampler objects.- Parameters:
samplers
- an array of sampler objects to be deleted
-
glDeleteSamplers
public static void glDeleteSamplers(int sampler)
Deletes named sampler objects.
-
glIsSampler
public static boolean glIsSampler(int sampler)
Determines if a name corresponds to a sampler object.- Parameters:
sampler
- a value that may be the name of a sampler object
-
glBindSampler
public static void glBindSampler(int unit, int sampler)
Binds a named sampler to a texturing target.- Parameters:
unit
- the index of the texture unit to which the sampler is boundsampler
- the name of a sampler
-
glSamplerParameteri
public static void glSamplerParameteri(int sampler, int pname, int param)
Set the integer value of a sampler parameter.- Parameters:
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 ofpname
-
glSamplerParameterf
public static void glSamplerParameterf(int sampler, int pname, float param)
Float version ofSamplerParameteri
.- Parameters:
sampler
- the sampler object whose parameter to modifypname
- the symbolic name of a single-valued sampler parameterparam
- the value ofpname
-
glSamplerParameteriv
public static void glSamplerParameteriv(int sampler, int pname, java.nio.IntBuffer params)
Pointer version ofSamplerParameteri
.- Parameters:
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 ofpname
are stored
-
glSamplerParameterfv
public static void glSamplerParameterfv(int sampler, int pname, java.nio.FloatBuffer params)
Float version ofSamplerParameteriv
.- Parameters:
sampler
- the sampler object whose parameter to modifypname
- the symbolic name of a sampler parameterparams
- an array where the value or values ofpname
are stored
-
glSamplerParameterIiv
public static void glSamplerParameterIiv(int sampler, int pname, java.nio.IntBuffer params)
Pure integer version ofSamplerParameteriv
.- Parameters:
sampler
- the sampler object whose parameter to modifypname
- the symbolic name of a sampler parameterparams
- an array where the value or values ofpname
are stored
-
glSamplerParameterIuiv
public static void glSamplerParameterIuiv(int sampler, int pname, java.nio.IntBuffer params)
Unsigned pure integer version ofSamplerParameteriv
.- Parameters:
sampler
- the sampler object whose parameter to modifypname
- the symbolic name of a sampler parameterparams
- an array where the value or values ofpname
are stored
-
glGetSamplerParameteriv
public static void glGetSamplerParameteriv(int sampler, int pname, java.nio.IntBuffer params)
Return the integer value(s) of a sampler parameter.- Parameters:
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 parameters
-
glGetSamplerParameteri
public static int glGetSamplerParameteri(int sampler, int pname)
Return the integer value(s) of a sampler parameter.- Parameters:
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
-
glGetSamplerParameterfv
public static void glGetSamplerParameterfv(int sampler, int pname, java.nio.FloatBuffer params)
Float version ofGetSamplerParameteriv
.- Parameters:
sampler
- the name of the sampler object from which to retrieve parameterspname
- the symbolic name of a sampler parameterparams
- the sampler parameters
-
glGetSamplerParameterf
public static float glGetSamplerParameterf(int sampler, int pname)
Float version ofGetSamplerParameteriv
.- Parameters:
sampler
- the name of the sampler object from which to retrieve parameterspname
- the symbolic name of a sampler parameter
-
glGetSamplerParameterIiv
public static void glGetSamplerParameterIiv(int sampler, int pname, java.nio.IntBuffer params)
Pure integer version ofGetSamplerParameteriv
.- Parameters:
sampler
- the name of the sampler object from which to retrieve parameterspname
- the symbolic name of a sampler parameterparams
- the sampler parameters
-
glGetSamplerParameterIi
public static int glGetSamplerParameterIi(int sampler, int pname)
Pure integer version ofGetSamplerParameteriv
.- Parameters:
sampler
- the name of the sampler object from which to retrieve parameterspname
- the symbolic name of a sampler parameter
-
glGetSamplerParameterIuiv
public static void glGetSamplerParameterIuiv(int sampler, int pname, java.nio.IntBuffer params)
Unsigned pure integer version ofGetSamplerParameteriv
.- Parameters:
sampler
- the name of the sampler object from which to retrieve parameterspname
- the symbolic name of a sampler parameterparams
- the sampler parameters
-
glGetSamplerParameterIui
public static int glGetSamplerParameterIui(int sampler, int pname)
Unsigned pure integer version ofGetSamplerParameteriv
.- Parameters:
sampler
- the name of the sampler object from which to retrieve parameterspname
- the symbolic name of a sampler parameter
-
glGenSamplers
public static void glGenSamplers(int[] samplers)
Array version of:GenSamplers
-
glDeleteSamplers
public static void glDeleteSamplers(int[] samplers)
Array version of:DeleteSamplers
-
glSamplerParameteriv
public static void glSamplerParameteriv(int sampler, int pname, int[] params)
Array version of:SamplerParameteriv
-
glSamplerParameterfv
public static void glSamplerParameterfv(int sampler, int pname, float[] params)
Array version of:SamplerParameterfv
-
glSamplerParameterIiv
public static void glSamplerParameterIiv(int sampler, int pname, int[] params)
Array version of:SamplerParameterIiv
-
glSamplerParameterIuiv
public static void glSamplerParameterIuiv(int sampler, int pname, int[] params)
Array version of:SamplerParameterIuiv
-
glGetSamplerParameteriv
public static void glGetSamplerParameteriv(int sampler, int pname, int[] params)
Array version of:GetSamplerParameteriv
-
glGetSamplerParameterfv
public static void glGetSamplerParameterfv(int sampler, int pname, float[] params)
Array version of:GetSamplerParameterfv
-
glGetSamplerParameterIiv
public static void glGetSamplerParameterIiv(int sampler, int pname, int[] params)
Array version of:GetSamplerParameterIiv
-
glGetSamplerParameterIuiv
public static void glGetSamplerParameterIuiv(int sampler, int pname, int[] params)
Array version of:GetSamplerParameterIuiv
-
-