In the WebGL reference card, there is the documentation about Vector components.
While it seems to me that i can use also {x, y, z, w}, I am not able to understand if it is mandatory to use {s, t, p, q} when reading from Textures.
Use when accessing vectors that represent texture coordinates
What is the meaning of the {s, t, p, q} letters? It is just only a matter of convention for readable code or is there something more that i am missing?
See WebGL Specification Vesion 1.0:
See the OpenGL ES Shading Language 1.00 Specification :
This means for a
vec4 v;
,v.stpq
is exactly the same asv.xyzw
orv.rgba
.The s, t naming comes from the Plane (geometry), where a plan can be described parametrically as the set of all points of the form R = R0 + sV + tW. (R and R0 are points, V and W are vectors, s and t are real numbers.