[require] GLSL >= 1.10 # GL_ARB_color_buffer_float provides a way to disable vertex color clamping, # but without it, the vertex colors must be clamped. [vertex shader] void main() { gl_Position = ftransform(); gl_FrontColor = vec4(-2, -1, 0.5, 3); /* (0, 0, 0.5, 1) */ gl_FrontSecondaryColor = vec4(2, 0.5, 1.5, -0.5); /* (1, 0.5, 1, 0) */ } [fragment shader] uniform vec4 arg0; void main() { gl_FragColor = (gl_Color + gl_SecondaryColor) * 0.5; } [test] draw rect -1 -1 2 2 probe rgba 1 1 0.5 0.25 0.75 0.5