[require] GLSL >= 1.10 [vertex shader] void main() { gl_Position = gl_Vertex; } [fragment shader] uniform float arg0; uniform float arg1; uniform float arg2; uniform float tolerance; uniform float expected; void main() { float result = clamp(arg0 * arg1 + arg2, 0.0, 1.0); gl_FragColor = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0); } [test] uniform float arg2 0.0 clear color 0.0 0.0 1.0 0.0 clear uniform float arg0 0.0 uniform float arg1 0.0 uniform float expected 0.0 uniform float tolerance 0.0 draw rect ortho 0 0 4 4 uniform float arg0 0.0 uniform float arg1 -1.33 uniform float expected -0.0 uniform float tolerance 0.0 draw rect ortho 4 0 4 4 uniform float arg0 0.0 uniform float arg1 0.85000002 uniform float expected 0.0 uniform float tolerance 0.0 draw rect ortho 8 0 4 4 uniform float arg0 -1.33 uniform float arg1 0.0 uniform float expected -0.0 uniform float tolerance 0.0 draw rect ortho 12 0 4 4 uniform float arg0 -1.33 uniform float arg1 -1.33 uniform float expected 1.0 uniform float tolerance 0 draw rect ortho 16 0 4 4 uniform float arg0 -1.33 uniform float arg1 0.85000002 uniform float expected 0 #-1.1305000266 uniform float tolerance 0 #0.01 draw rect ortho 20 0 4 4 uniform float arg0 0.85000002 uniform float arg1 0.0 uniform float expected 0.0 uniform float tolerance 0.0 draw rect ortho 24 0 4 4 uniform float arg0 0.85000002 uniform float arg1 -1.33 uniform float expected 0 uniform float tolerance 0 draw rect ortho 28 0 4 4 uniform float arg0 0.85000002 uniform float arg1 0.85000002 uniform float expected 0.72250003 uniform float tolerance 7.2250004e-06 draw rect ortho 32 0 4 4 uniform float arg0 2.85000002 uniform float arg1 0.85000002 uniform float expected 1.0 uniform float tolerance 0 draw rect ortho 36 0 4 4 probe rect rgba (0, 0, 4, 4) (0.0, 1.0, 0.0, 1.0) probe rect rgba (4, 0, 4, 4) (0.0, 1.0, 0.0, 1.0) probe rect rgba (8, 0, 4, 4) (0.0, 1.0, 0.0, 1.0) probe rect rgba (12, 0, 4, 4) (0.0, 1.0, 0.0, 1.0) probe rect rgba (16, 0, 4, 4) (0.0, 1.0, 0.0, 1.0) probe rect rgba (20, 0, 4, 4) (0.0, 1.0, 0.0, 1.0) probe rect rgba (24, 0, 4, 4) (0.0, 1.0, 0.0, 1.0) probe rect rgba (28, 0, 4, 4) (0.0, 1.0, 0.0, 1.0) probe rect rgba (32, 0, 4, 4) (0.0, 1.0, 0.0, 1.0) probe rect rgba (36, 0, 4, 4) (0.0, 1.0, 0.0, 1.0)