Hi,
Super new to GLSL, been watching a few tutorials, reading loads on here and the wiki, but i’m really struggling to grasp what vUV.st means?
Am i right in thinking that U and V are the same in my pic here -
I think/hope i’ve got the UV part, but the .st part really confuses me.
(also, what does the small lowercase ‘v’ mean - vUV ?
Thank you for any help and patience, its really appreciated.
vUV
is unique to TouchDesigner, and is explained in detail in the Write a GLSL TOP wiki page, paragraph " Sampling Inputs".
You can read what UV stands for at UV mapping - Wikipedia
So your sketch is correct, U is horizontal and V is vertical, both going from 0 to 1 (in other words, they are normalized). So (0.5, 0.5) is the middle pixel of a texture.
the .st
part is called swizzling and is explained in the Swizzling pragraph in the GLSL docs:
https://www.khronos.org/opengl/wiki/Data_Type_(GLSL)#Swizzling
So vUV
is a vector and vUV.st
will give you the first two components of that vector.
1 Like
The ‘v’ prefix is a legacy idea from GLSL 1.20. Back then the vUV variable was declared as a ‘varying’, which is what the ‘v’ prefix is for. If I was to name it today it would be called ‘iUV’, since it’s now declared as an ‘in’ variable in more modern GLSL 3.30+. However I didn’t want to rename that variable and confuse lots of tutorials and code.
3 Likes
Thank you both. Really appreciate that. Back down the rabbit hole!