Pixel and fragment are interchangeable, but I prefer the term fragment over pixel. The reason is that pixel is something that your display has, but a shader can run for "pixels" that are never visible like that on the screen by rendering into an offscreen buffer and doing post effects with it or whatever. A fragment makes more sense because it can be something that is output to the screen or an intermediate value somewhere.

To find the value of the pixel you'll need to know the size of the texture you are sampling. Let's say your texture is 256x256, then each pixel is 1/256 = 0.003906. vecViewport will most likely not contain the size unless you are doing post processing of some form.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com