Is there an explanation somewhere about the decision to use RED (R,0,0,1) instead of INTENSITY (I,I,I,I) behavior for single-channel textures in GPU programming? It seems like the universally wrong method to standardize, but maybe I'm missing something?
You pretty much have to special-case it in your shader and replicated the red channel out to the alpha channel at least, if not all 4 channels.
-
-
It would be fine if they'd kept INTENSITY as an option, but they removed it and you only get RED now, and I just cannot fathom why they would do that...
-
Fortunately, it's possible to emulate INTENSITY by using the texture swizzle functionality in the sampler. That's what I use when I want my shader to be agnostic about whether the texture is RGBA or INTENSITY.
- Show replies
New conversation -
-
-
In OpenGL you can change the swizzle mask of the texture if you do not want to special-case it in your shader: https://www.khronos.org/opengl/wiki/Texture#Swizzle_mask …
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.