3 GL_ARB_derivative_control
5 [vertex shader passthrough]
8 #extension GL_ARB_derivative_control: require
12 float x = gl_FragCoord.x;
13 bool alt = bool(int(gl_FragCoord.y) % 2);
14 float altx = alt ? -x : x;
15 float dx = dFdxFine(altx);
16 // Alternating rows are now descending, so check the direction
17 // of the derivative based on the row we're in.
18 if (alt && dx >= 0 || !alt && dx <= 0)
19 gl_FragColor = vec4(1, 0, 0, 1);
21 gl_FragColor = vec4(0, 1, 0, 1);
26 probe all rgba 0.0 1.0 0.0 1.0