Custom filter problem

Hi,
I’m just beginning to learn how to write custom2D filters and I wrote this filter :


/* Grayscale */
 
uniform sampler2D bgl_RenderedTexture;
void main(void)
 {
 vec4 color = texture2D(bgl_RenderedTexture, gl_TexCoord[0].st);
 float fAvg = (color.r + color.g + color.b) / 3.0;
 color = vec4(fAvg, fAvg, fAvg, 0);
 gl_FragColor = color;
 }

which functions properly when the viewport shading mode is set to ‘solid’, but when set to ‘textured’ gives me a gray screen.

Can anyone tell me why?
Thanks,
Dean

Figured it out, turns out the problem was I was inputting 0 for the alpha value… tnks anyways