Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usage of semantically undefined term: st #339

Open
LazerJesus opened this issue Feb 24, 2021 · 1 comment
Open

usage of semantically undefined term: st #339

LazerJesus opened this issue Feb 24, 2021 · 1 comment

Comments

@LazerJesus
Copy link

LazerJesus commented Feb 24, 2021

similar to #62 but for st.
what does st mean?

maybe point out what the words mean to make learning them easier.

stickler meeseeks out**

@julienbelmon
Copy link

julienbelmon commented Apr 17, 2021

s and t are used in opengl to denote texture coordinates. traditionally, texture coordinates are denoted with u and v (and... they still are, it depends on the programmer, or the context), but the next letter being w for 3d textures (such as cubemaps for example), other letters are preferred since w is already used for the clip coordinate as a convention. it is a convention used so frequently that it is part of the GLSL language to indicate the components of a vec4. given a : vec4, you may access its components using a.s, a.t, a.p, a.q, and you are able to use swizzling operations and grouping operations the same way as with the other notations (xyzw, rgba).

since in the examples we're operating on a grid of fragments covering the window (because the input to the vertex shader is the vertices of a rectangle covering the camera space, the result of the rasterization is giving us a grid of fragments covering the window to work with), it is intuitive to think of fragment coordinates as coordinates of a texture -- after being normalized by dividing the window coordinates by the viewport resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants