local variables in glsl shader

Hi

I am trying to use some local variables in the glsl shade. However, everytime I simply declare or declare and assign the variable to an initial value , it seems my shader stops working properly. Before doing this , I used to get a pretty picture on my screen, now I get a blank white screen.


static const char render_fs[] =
        "#version 430 core
"
        "
"
        "layout (location = 0) out vec4 color;
"
        "
"
        "uniform sampler2D output_image;
"
        "
"
        "void main(void)
"
        "{
"
	"vec4 sample=vec4(1.0,1.0,1.0,1.0};
"
	"
"
        "    color = texture(output_image, vec2(gl_FragCoord.xy) / vec2(textureSize(output_image, 0)));
"
        "}
";


See the sample variable. Just adding this whites out what i see on the screen.

[QUOTE=driver;1255263]


  ...
  vec4 sample=vec4(1.0,1.0,1.0,1.0};
  ...

See the sample variable. Just adding this whites out what i see on the screen.[/QUOTE]

You need to check the compilation log, print it out to the screen, and fatal on a compile error. The compiler is no doubt trying to tell you that there is a syntax error here. That last brace above should be a parenthesis.