Fragment shader / get screen position?

hello,

i got an simple question about
the fragment shader.

is it possible to get the screen x,y coordinates
of the actual fragment in any way?
(0.0-1.0 or 0.0->resolution or whatever)

i heard that i can access the depthvalue of the fragment
and hope i get the screen position (if in visible area)

thanks for any help

gl_FragCoord

.xy is position in viewport coordinates (ie. resolution)
.z is depth

vielen vielen dank :slight_smile:

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.