[require] GLSL >= 1.10 [vertex shader] varying vec4 color; void main() { gl_Position = gl_Vertex; color = vec4(gl_Vertex.xy, -gl_Vertex.xy); } [fragment shader] varying vec4 color; void main() { vec3 rgb = abs(color.rgb); gl_FragColor = vec4(rgb, 1.0); } [test] draw rect -1 -1 2 2 relative probe rgb (0.0, 0.0) (1.0, 1.0, 1.0) relative probe rgb (0.1, 0.1) (0.8, 0.8, 0.8) relative probe rgb (0.2, 0.2) (0.6, 0.6, 0.6) relative probe rgb (0.3, 0.3) (0.4, 0.4, 0.4) relative probe rgb (0.4, 0.4) (0.2, 0.2, 0.2) relative probe rgb (0.5, 0.5) (0.0, 0.0, 0.0) relative probe rgb (0.6, 0.6) (0.2, 0.2, 0.2) relative probe rgb (0.7, 0.7) (0.4, 0.4, 0.4) relative probe rgb (0.8, 0.8) (0.6, 0.6, 0.6) relative probe rgb (0.9, 0.9) (0.8, 0.8, 0.8) relative probe rgb (1.0, 1.0) (1.0, 1.0, 1.0)