[require] GLSL >= 1.10 [vertex shader] varying float f; void myfunc() { f = 0.5; } [vertex shader] varying float f; void myfunc(); void main() { f = 0.1; myfunc(); gl_FrontColor.r = f++; gl_Position = gl_Vertex; } [fragment shader] varying float f; void main() { gl_FragColor = vec4(gl_Color.r, 0.0, 0.0, 1.0); } [test] draw rect -1 -1 2 2 probe all rgba 0.5 0 0 1.0