Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: Using the same texture buffer multiple times with different parameters

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2012
    Posts
    18

    Question Using the same texture buffer multiple times with different parameters

    Hey,

    I have a texture which I'm using at multiple instances throughout my program.
    At each instance I'm applying different texture parameters, which would effectively overwrite each other and generally just cause each other problems.
    Is there a way to have multiple texture buffers pointing to the same texture, but with different parameters?
    Or what would be the best way of proceeding without having to copy the entire texture?

    Any help would be appreciated.

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    Posts
    791
    You can either set different sampler objects (see glGenSamplers and friends) while keeping your texture bound (parameters on the sampler object take precedence over those set on the texture) or use texture views (see glTextureView) to share the storage.

  3. #3
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    498
    Quote Originally Posted by Silverlan View Post
    Is there a way to have multiple texture buffers pointing to the same texture, but with different parameters?
    Or what would be the best way of proceeding without having to copy the entire texture?
    Samplers (OpenGL 3.3 and higher) allow you to store the sampling state (filter modes, wrap modes, min/max LoD, LoD bias, compare function/mode and border colour) separately from the texture. When a sampler is bound to a texture unit, the sampler state overrides the equivalent state stored in the texture.

    The minimum (base) and maximum mipmap levels and the R/G/B/A swizzle state are properties of the texture itself and can't be overridden via samplers.

  4. #4
    Intern Contributor
    Join Date
    May 2013
    Posts
    69
    Anisotropy filtering is also limited to the texture and can not be set with samplers. Well, it also still is an EXT function.

  5. #5
    Advanced Member Frequent Contributor arekkusu's Avatar
    Join Date
    Nov 2003
    Posts
    783
    Quote Originally Posted by Osbios View Post
    Anisotropy filtering is also limited to the texture and can not be set with samplers.
    ARB_sampler_objects clearly says that max anisotropy is per-sampler state.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •