What's the difference between a UV texture coordinate vs. ST texture Coordinate?
I know that UV and ST are used in OpenGL.
I also know that ST are also used in Java.
What's the difference between a UV texture coordinate vs. ST texture Coordinate?
I know that UV and ST are used in OpenGL.
I also know that ST are also used in Java.
They mean the same thing, it's just a different naming convention.
U = S = x dimension
V = T = y dimension
Computer graphics principles and practice (Foley et al) defines the 2 as follows:
Texture mapping can be accomplished in two steps. A simple approach starts by mapping the four corners of the pixel onto the surface. For a bicubic patch this mapping naturally defines a set of points in the surface's (s,t) coordinate space. Next, the pixel's corner points in the surface's (s,t) coordinate space are mapped into the texture's (u,v) coordinate space The four (u,v) points in the texture map define a quadrilateral that approximates the more complex shape into which the pixel may actually map due to surface curvature. We compute a value for the pixel by summing all texels that lie within the quadrilateral, weighting each by the fraction of the texel that lies within the quadrilateral. If a transformed point in (u,v) space falls outside of the texture map, the texture map may e though of as replicated, like the patterns of Section 2.1.3 Rather than always use the identity mapping between (s,t) and (u,v), we can define a correspondence between the four corners of the 0-to-1 (s,t) rectangle and a quadrilateral in (u,v). When the surface is a polygon, it is common to assign texture map coordinates directly to its vertices.
uv coordinates start from the upper left corner (v-axis is facing down).
st coordinates start from the lower left corner (t-axis is facing up).
s = u;
t = 1-v;
I forgot to tell that textures in opengl should be loaded vertically flipped because the first element of the row data "corresponds to the lower left corner of the texture image" (see glTexImage2D). Only in that case, st and uv coordinates seems to be the same thing.
1-v
fixed the issue in my Maya to three.js exporter. :D –
Jurado It's a matter of convention.
Autodesk 3D Studio, Alias Maya, NewTek Lightwave and probably others used letters U and V for horizontal and vertical texture coordinates, respectively. DirectX follows the same convention.
Pixar's RenderMan however reserved the letters U and V for parameters in their parametric 3D primitives. So for texturing, they used S and T instead. OpenGL also used this convention for texture coordinates.
So their meaning may be different in theory but, unless you work on some Hollywood movie special effects, they probably both mean texture coordinates.
STQ is the texture coordinate system that must be used used when perspective correction or distortion is required, it relates to the homogeneous texel coordinates uv as follows:
u = (image width in pixels) * S / Q
v = (image height in pixels) * T / Q
When no perspective correction is needed, Q = 1.0, so ST become simply a normalized version of uv, and the difference between them becomes subtle, so some 3D systems skip the uv notation entirely and just use st/STQ for homogeneous/normalized.
although there are often other interpretations, generally ST coords are inherent to the geometry of the primitive and UVs are authored and edited by hand. Typically, each primitive has it's own ST coords, and entire meshes of prims have UV coords. Early books such as "Foley & Van Dam" had the exact opposite usage with ST being hand authored, but the industry adopted UV as the authored parameter naming convention.
© 2022 - 2025 — McMap. All rights reserved.