The common names for the components of texture coordinates are U and V. However, because the next letter used (for 3D textures) is W, that causes a conflict with the names for the components of a position: X, Y, Z, and W.
To avoid such conflicts, OpenGL's convention is that the components of texture coordinates are named S, T, and R. Thus, you have function calls like this:
glTexParameter(..., GL_TEXTURE_WRAP_S, GL_REPEAT);
Where GL_TEXTURE_WRAP_S
refers to wrapping in the S component of the texture coordinate.
Unfortunately, OpenGL picked S, T, and R long before GLSL and swizzle masks came around. R, of course, conflicts with R, G, B, and A. To avoid such conflicts, in GLSL, the texture coordinate swizzle mask uses S, T, P, and Q.
In GLSL, you can swizzle with XYZW, STPQ, or RGBA. They all mean exactly the same thing. So position.st
is exactly the same as position.xy
. However, you're not allowed to combine swizzle masks from different sets. So position.xt
is not allowed.