Class 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 Detail

      • GL_SAMPLER_BINDING

        public static final int GL_SAMPLER_BINDING
        Accepted by the value 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 bound
        sampler - the name of a sampler
      • glSamplerParameterf

        public static void glSamplerParameterf(int sampler,
                                               int pname,
                                               float param)
        Float version of SamplerParameteri.
        Parameters:
        sampler - the sampler object whose parameter to modify
        pname - the symbolic name of a single-valued sampler parameter
        param - the value of pname
      • glSamplerParameterfv

        public static void glSamplerParameterfv(int sampler,
                                                int pname,
                                                java.nio.FloatBuffer params)
        Float version of SamplerParameteriv.
        Parameters:
        sampler - the sampler object whose parameter to modify
        pname - the symbolic name of a sampler parameter
        params - an array where the value or values of pname are stored
      • glSamplerParameterIiv

        public static void glSamplerParameterIiv(int sampler,
                                                 int pname,
                                                 java.nio.IntBuffer params)
        Pure integer version of SamplerParameteriv.
        Parameters:
        sampler - the sampler object whose parameter to modify
        pname - the symbolic name of a sampler parameter
        params - an array where the value or values of pname are stored
      • glSamplerParameterIuiv

        public static void glSamplerParameterIuiv(int sampler,
                                                  int pname,
                                                  java.nio.IntBuffer params)
        Unsigned pure integer version of SamplerParameteriv.
        Parameters:
        sampler - the sampler object whose parameter to modify
        pname - the symbolic name of a sampler parameter
        params - an array where the value or values of pname are stored
      • glGetSamplerParameterfv

        public static void glGetSamplerParameterfv(int sampler,
                                                   int pname,
                                                   java.nio.FloatBuffer params)
        Float version of GetSamplerParameteriv.
        Parameters:
        sampler - the name of the sampler object from which to retrieve parameters
        pname - the symbolic name of a sampler parameter
        params - the sampler parameters
      • glGetSamplerParameterf

        public static float glGetSamplerParameterf(int sampler,
                                                   int pname)
        Float version of GetSamplerParameteriv.
        Parameters:
        sampler - the name of the sampler object from which to retrieve parameters
        pname - the symbolic name of a sampler parameter
      • glGetSamplerParameterIiv

        public static void glGetSamplerParameterIiv(int sampler,
                                                    int pname,
                                                    java.nio.IntBuffer params)
        Pure integer version of GetSamplerParameteriv.
        Parameters:
        sampler - the name of the sampler object from which to retrieve parameters
        pname - the symbolic name of a sampler parameter
        params - the sampler parameters
      • glGetSamplerParameterIi

        public static int glGetSamplerParameterIi(int sampler,
                                                  int pname)
        Pure integer version of GetSamplerParameteriv.
        Parameters:
        sampler - the name of the sampler object from which to retrieve parameters
        pname - the symbolic name of a sampler parameter
      • glGetSamplerParameterIuiv

        public static void glGetSamplerParameterIuiv(int sampler,
                                                     int pname,
                                                     java.nio.IntBuffer params)
        Unsigned pure integer version of GetSamplerParameteriv.
        Parameters:
        sampler - the name of the sampler object from which to retrieve parameters
        pname - the symbolic name of a sampler parameter
        params - the sampler parameters
      • glGetSamplerParameterIui

        public static int glGetSamplerParameterIui(int sampler,
                                                   int pname)
        Unsigned pure integer version of GetSamplerParameteriv.
        Parameters:
        sampler - the name of the sampler object from which to retrieve parameters
        pname - 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