Class ARBSamplerObjects

java.lang.Object
org.lwjgl.opengl.ARBSamplerObjects

public class ARBSamplerObjects extends 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 Details

    • 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:
  • 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

      public static void glGenSamplers(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.
    • nglDeleteSamplers

      public static void nglDeleteSamplers(int count, long samplers)
      Unsafe version of: DeleteSamplers
      Parameters:
      count - the number of sampler objects to be deleted
    • glDeleteSamplers

      public static void glDeleteSamplers(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
    • 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 modify
      pname - the symbolic name of a single-valued sampler parameter. One of:
      TEXTURE_WRAP_STEXTURE_WRAP_TTEXTURE_WRAP_RTEXTURE_MIN_FILTERTEXTURE_MAG_FILTER
      TEXTURE_MIN_LODTEXTURE_MAX_LODTEXTURE_LOD_BIASTEXTURE_COMPARE_MODETEXTURE_COMPARE_FUNC
      param - the value of pname
    • 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
    • nglSamplerParameteriv

      public static void nglSamplerParameteriv(int sampler, int pname, long params)
      Unsafe version of: SamplerParameteriv
    • glSamplerParameteriv

      public static void glSamplerParameteriv(int sampler, int pname, IntBuffer params)
      Pointer version of SamplerParameteri.
      Parameters:
      sampler - the sampler object whose parameter to modify
      pname - the symbolic name of a sampler parameter. One of:
      TEXTURE_BORDER_COLORTEXTURE_WRAP_STEXTURE_WRAP_TTEXTURE_WRAP_R
      TEXTURE_MIN_FILTERTEXTURE_MAG_FILTERTEXTURE_MIN_LODTEXTURE_MAX_LOD
      TEXTURE_LOD_BIASTEXTURE_COMPARE_MODETEXTURE_COMPARE_FUNC
      params - an array where the value or values of pname are stored
    • nglSamplerParameterfv

      public static void nglSamplerParameterfv(int sampler, int pname, long params)
      Unsafe version of: SamplerParameterfv
    • glSamplerParameterfv

      public static void glSamplerParameterfv(int sampler, int pname, 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
    • nglSamplerParameterIiv

      public static void nglSamplerParameterIiv(int sampler, int pname, long params)
      Unsafe version of: SamplerParameterIiv
    • glSamplerParameterIiv

      public static void glSamplerParameterIiv(int sampler, int pname, 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
    • nglSamplerParameterIuiv

      public static void nglSamplerParameterIuiv(int sampler, int pname, long params)
      Unsafe version of: SamplerParameterIuiv
    • glSamplerParameterIuiv

      public static void glSamplerParameterIuiv(int sampler, int pname, 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
    • nglGetSamplerParameteriv

      public static void nglGetSamplerParameteriv(int sampler, int pname, long params)
      Unsafe version of: GetSamplerParameteriv
    • glGetSamplerParameteriv

      public static void glGetSamplerParameteriv(int sampler, int pname, IntBuffer params)
      Return the integer value(s) of a sampler parameter.
      Parameters:
      sampler - the name of the sampler object from which to retrieve parameters
      pname - the symbolic name of a sampler parameter. One of:
      TEXTURE_WRAP_STEXTURE_WRAP_TTEXTURE_WRAP_RTEXTURE_MIN_FILTERTEXTURE_MAG_FILTER
      TEXTURE_MIN_LODTEXTURE_MAX_LODTEXTURE_LOD_BIASTEXTURE_COMPARE_MODETEXTURE_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 parameters
      pname - the symbolic name of a sampler parameter. One of:
      TEXTURE_WRAP_STEXTURE_WRAP_TTEXTURE_WRAP_RTEXTURE_MIN_FILTERTEXTURE_MAG_FILTER
      TEXTURE_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

      public static void glGetSamplerParameterfv(int sampler, int pname, 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
    • nglGetSamplerParameterIiv

      public static void nglGetSamplerParameterIiv(int sampler, int pname, long params)
      Unsafe version of: GetSamplerParameterIiv
    • glGetSamplerParameterIiv

      public static void glGetSamplerParameterIiv(int sampler, int pname, 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
    • nglGetSamplerParameterIuiv

      public static void nglGetSamplerParameterIuiv(int sampler, int pname, long params)
      Unsafe version of: GetSamplerParameterIuiv
    • glGetSamplerParameterIuiv

      public static void glGetSamplerParameterIuiv(int sampler, int pname, 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