This isn’t possible in OpenGL 3.3:
glSamplerParameteri(Sampler, GL_TEXTURE_SWIZZLE_R, GL_ONE);
glSamplerParameteri(Sampler, GL_TEXTURE_SWIZZLE_G, GL_ONE);
glSamplerParameteri(Sampler, GL_TEXTURE_SWIZZLE_B, GL_ONE);
glSamplerParameteri(Sampler, GL_TEXTURE_SWIZZLE_A, GL_RED);
I thought it was at first but I made a mistake.
Question: why not?
Imagine, I’m going nut! I decide to interleave 2 kind of data in 1 texture, like diffuse color (RGB) and specular map (A) or normalmap (RGB) and heightmap (A). It could be something completely different but following the same idea.
I could use 2 samplers to read both kind of data and interpret these data with different ways using texture swizzle.
I might be completely inefficient, limited by the hardware or actually useless. Let me know what you think!