PDA

View Full Version : relative position of a pixel in fragment shader



banana joe
10-29-2013, 10:01 AM
How can I get the relative position of a pixel in a fragment shader? I only know gl_FragCoord​, but gl_FragCoord​ returns only the absolute coordinate.

GClements
10-29-2013, 12:53 PM
Relative to what?

BTW, the answer is probably going to be "add another attribute".