Results 1 to 4 of 4

Thread: What is texture swizzling?

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2012
    Posts
    4

    What is texture swizzling?

    Hello

    I need to understand what is texture swizzling and what can be achieved by this feature?
    What should happen when we pass the token TEXTURE_SWIZZLE_R to TexParameteriv ?

    It would be good if I could get some sample code for reference. I have already referred to http://www.opengl.org/registry/specs/ARB/texture_swizzle.txt.

    Thanks in advance.

  2. #2
    V-man
    Guest

    Re: What is texture swizzling?

    This thing went into GL 3.3

    Swizzling means remapping.
    For example, you can swap the red and green component.
    Or, you can swap the red and green component and have blue and alpha set to 1.

    Code :
    glBindTexture(target, id);
    glTexParameteri(target, GL_TEXTURE_SWIZZLE_R, GL_GREEN);
    glTexParameteri(target, GL_TEXTURE_SWIZZLE_G, GL_RED);
    glTexParameteri(target, GL_TEXTURE_SWIZZLE_B, GL_ONE);
    glTexParameteri(target, GL_TEXTURE_SWIZZLE_A, GL_ONE);

    Also, read the part about "2) What is the demand for this extension?"

  3. #3
    Senior Member OpenGL Lord
    Join Date
    Mar 2015
    Posts
    6,676

    Re: What is texture swizzling?

    Did you check the wiki?

  4. #4
    Junior Member Newbie
    Join Date
    Jan 2012
    Posts
    4

    Re: What is texture swizzling?

    Thanks.
    That was great help.

Similar Threads

  1. Replies: 1
    Last Post: 12-26-2014, 04:57 PM
  2. Replies: 1
    Last Post: 03-10-2014, 12:51 PM
  3. swizzling with low level shaders
    By ehsan2004 in forum OpenGL: GLSL
    Replies: 5
    Last Post: 01-16-2007, 03:30 PM
  4. Replies: 2
    Last Post: 09-27-2004, 05:25 PM
  5. Swizzling after the combiners
    By Pentagram in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 03-01-2003, 12:48 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean