#version 450 // iter3 gl_FragCoord-encoded fragment shader. // For each pixel at integer position (x, y): // R = x / 255 -> byte x (UNORM) // G = y / 255 -> byte y (UNORM) // B = 0x80 -> sentinel proving the frag shader executed // A = 0xff -> opaque // Readback: pixel at (col, row) should be 0xff80(row)(col) LE. layout(location = 0) out vec4 outColor; void main() { uvec2 ipos = uvec2(gl_FragCoord.xy); outColor = vec4( float(ipos.x) / 255.0, float(ipos.y) / 255.0, 128.0 / 255.0, 1.0 ); }