Class ARBSamplerObjects
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
FieldsModifier and TypeFieldDescriptionstatic final intAccepted by thevalueparameter of the GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv and GetDoublev functions. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidglBindSampler(int unit, int sampler) Binds a named sampler to a texturing target.static voidglDeleteSamplers(int sampler) Deletes named sampler objects.static voidglDeleteSamplers(int[] samplers) Array version of:DeleteSamplersstatic voidglDeleteSamplers(IntBuffer samplers) Deletes named sampler objects.static intGenerates sampler object names.static voidglGenSamplers(int[] samplers) Array version of:GenSamplersstatic voidglGenSamplers(IntBuffer samplers) Generates sampler object names.static floatglGetSamplerParameterf(int sampler, int pname) Float version ofGetSamplerParameteriv.static voidglGetSamplerParameterfv(int sampler, int pname, float[] params) Array version of:GetSamplerParameterfvstatic voidglGetSamplerParameterfv(int sampler, int pname, FloatBuffer params) Float version ofGetSamplerParameteriv.static intglGetSamplerParameteri(int sampler, int pname) Return the integer value(s) of a sampler parameter.static intglGetSamplerParameterIi(int sampler, int pname) Pure integer version ofGetSamplerParameteriv.static voidglGetSamplerParameterIiv(int sampler, int pname, int[] params) Array version of:GetSamplerParameterIivstatic voidglGetSamplerParameterIiv(int sampler, int pname, IntBuffer params) Pure integer version ofGetSamplerParameteriv.static intglGetSamplerParameterIui(int sampler, int pname) Unsigned pure integer version ofGetSamplerParameteriv.static voidglGetSamplerParameterIuiv(int sampler, int pname, int[] params) Array version of:GetSamplerParameterIuivstatic voidglGetSamplerParameterIuiv(int sampler, int pname, IntBuffer params) Unsigned pure integer version ofGetSamplerParameteriv.static voidglGetSamplerParameteriv(int sampler, int pname, int[] params) Array version of:GetSamplerParameterivstatic voidglGetSamplerParameteriv(int sampler, int pname, IntBuffer params) Return the integer value(s) of a sampler parameter.static booleanglIsSampler(int sampler) Determines if a name corresponds to a sampler object.static voidglSamplerParameterf(int sampler, int pname, float param) Float version ofSamplerParameteri.static voidglSamplerParameterfv(int sampler, int pname, float[] params) Array version of:SamplerParameterfvstatic voidglSamplerParameterfv(int sampler, int pname, FloatBuffer params) Float version ofSamplerParameteriv.static voidglSamplerParameteri(int sampler, int pname, int param) Set the integer value of a sampler parameter.static voidglSamplerParameterIiv(int sampler, int pname, int[] params) Array version of:SamplerParameterIivstatic voidglSamplerParameterIiv(int sampler, int pname, IntBuffer params) Pure integer version ofSamplerParameteriv.static voidglSamplerParameterIuiv(int sampler, int pname, int[] params) Array version of:SamplerParameterIuivstatic voidglSamplerParameterIuiv(int sampler, int pname, IntBuffer params) Unsigned pure integer version ofSamplerParameteriv.static voidglSamplerParameteriv(int sampler, int pname, int[] params) Array version of:SamplerParameterivstatic voidglSamplerParameteriv(int sampler, int pname, IntBuffer params) Pointer version ofSamplerParameteri.static voidnglDeleteSamplers(int count, long samplers) Unsafe version of:DeleteSamplersstatic voidnglGenSamplers(int count, long samplers) Unsafe version of:GenSamplersstatic voidnglGetSamplerParameterfv(int sampler, int pname, long params) Unsafe version of:GetSamplerParameterfvstatic voidnglGetSamplerParameterIiv(int sampler, int pname, long params) Unsafe version of:GetSamplerParameterIivstatic voidnglGetSamplerParameterIuiv(int sampler, int pname, long params) Unsafe version of:GetSamplerParameterIuivstatic voidnglGetSamplerParameteriv(int sampler, int pname, long params) Unsafe version of:GetSamplerParameterivstatic voidnglSamplerParameterfv(int sampler, int pname, long params) Unsafe version of:SamplerParameterfvstatic voidnglSamplerParameterIiv(int sampler, int pname, long params) Unsafe version of:SamplerParameterIivstatic voidnglSamplerParameterIuiv(int sampler, int pname, long params) Unsafe version of:SamplerParameterIuivstatic voidnglSamplerParameteriv(int sampler, int pname, long params) Unsafe version of:SamplerParameteriv
-
Field Details
-
GL_SAMPLER_BINDING
public static final int GL_SAMPLER_BINDINGAccepted by thevalueparameter of the GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv and GetDoublev functions.- See Also:
-
-
Method Details
-
nglGenSamplers
public static void nglGenSamplers(int count, long samplers) Unsafe version of:GenSamplers- Parameters:
count- the number of sampler object names to generate
-
glGenSamplers
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. -
nglDeleteSamplers
public static void nglDeleteSamplers(int count, long samplers) Unsafe version of:DeleteSamplers- Parameters:
count- the number of sampler objects to be deleted
-
glDeleteSamplers
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_STEXTURE_WRAP_TTEXTURE_WRAP_RTEXTURE_MIN_FILTERTEXTURE_MAG_FILTERTEXTURE_MIN_LODTEXTURE_MAX_LODTEXTURE_LOD_BIASTEXTURE_COMPARE_MODETEXTURE_COMPARE_FUNCparam- 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
-
nglSamplerParameteriv
public static void nglSamplerParameteriv(int sampler, int pname, long params) Unsafe version of:SamplerParameteriv -
glSamplerParameteriv
Pointer version ofSamplerParameteri.- Parameters:
sampler- the sampler object whose parameter to modifypname- the symbolic name of a sampler parameter. One of:TEXTURE_BORDER_COLORTEXTURE_WRAP_STEXTURE_WRAP_TTEXTURE_WRAP_RTEXTURE_MIN_FILTERTEXTURE_MAG_FILTERTEXTURE_MIN_LODTEXTURE_MAX_LODTEXTURE_LOD_BIASTEXTURE_COMPARE_MODETEXTURE_COMPARE_FUNCparams- an array where the value or values ofpnameare stored
-
nglSamplerParameterfv
public static void nglSamplerParameterfv(int sampler, int pname, long params) Unsafe version of:SamplerParameterfv -
glSamplerParameterfv
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 ofpnameare stored
-
nglSamplerParameterIiv
public static void nglSamplerParameterIiv(int sampler, int pname, long params) Unsafe version of:SamplerParameterIiv -
glSamplerParameterIiv
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 ofpnameare stored
-
nglSamplerParameterIuiv
public static void nglSamplerParameterIuiv(int sampler, int pname, long params) Unsafe version of:SamplerParameterIuiv -
glSamplerParameterIuiv
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 ofpnameare stored
-
nglGetSamplerParameteriv
public static void nglGetSamplerParameteriv(int sampler, int pname, long params) Unsafe version of:GetSamplerParameteriv -
glGetSamplerParameteriv
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_STEXTURE_WRAP_TTEXTURE_WRAP_RTEXTURE_MIN_FILTERTEXTURE_MAG_FILTERTEXTURE_MIN_LODTEXTURE_MAX_LODTEXTURE_LOD_BIASTEXTURE_COMPARE_MODETEXTURE_COMPARE_FUNC, TEXTURE_BORDER_COLORparams- 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_STEXTURE_WRAP_TTEXTURE_WRAP_RTEXTURE_MIN_FILTERTEXTURE_MAG_FILTERTEXTURE_MIN_LODTEXTURE_MAX_LODTEXTURE_LOD_BIASTEXTURE_COMPARE_MODETEXTURE_COMPARE_FUNC, TEXTURE_BORDER_COLOR
-
nglGetSamplerParameterfv
public static void nglGetSamplerParameterfv(int sampler, int pname, long params) Unsafe version of:GetSamplerParameterfv -
glGetSamplerParameterfv
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
-
nglGetSamplerParameterIiv
public static void nglGetSamplerParameterIiv(int sampler, int pname, long params) Unsafe version of:GetSamplerParameterIiv -
glGetSamplerParameterIiv
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
-
nglGetSamplerParameterIuiv
public static void nglGetSamplerParameterIuiv(int sampler, int pname, long params) Unsafe version of:GetSamplerParameterIuiv -
glGetSamplerParameterIuiv
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
-