Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can somebody explain to me the meaning of the variable names "st" and "pct" on this page[0]? I understand the code itself, but I can't puzzle out what the letters stand for.

[0]http://thebookofshaders.com/05/



"st" are texture coordinates, with "s" being the along the horizontal axis into the texture, and "t" being the vertical.

One major stumbling block with graphics is that you'll find lots of one letter names. "xyz" represents locations in the world, whereas "st" represents locations along a surface area. "uv" is also sometimes used for texture coordinates. There is a difference between them, but it's not interesting or relevant to a beginner. Just know that both are in use.

I would guess that "pct" is an abbreviation for "percent", given that it ranges from 0.0 to 1.0. It's definitely a poor choice of variable name.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: