Last active
January 1, 2016 20:29
-
-
Save Anteru/8196972 to your computer and use it in GitHub Desktop.
Swizzle texture access
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// (Not tried) I would assume this gets ignored by OpenCL but it does affect OpenGL state. | |
// This affects how the shader reads from the texture, but doesn't change the format itself. | |
::glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_B, GL_RED); | |
::glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_G, GL_GREEN); | |
::glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_R, GL_BLUE); | |
::glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_SWIZZLE_A, GL_ALPHA); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment