[osg-users] Setting alpha channel in Frag Shader does not work.

Steven Powers StevenAPowers at gmail.com
Wed Mar 18 08:11:34 PDT 2009

danielh wrote:
> Try attaching a texture to the COLOR_BUFFER0 instead of an image directly.
> That's what worked for me.

Thats what this code is doing. I've written to COLOR_BUFFER0 and whenever I change the shader alpha value to something other than 1 all color values come back incorrect.

This will be read correctly:
gl_FragColor = vec4(1,2,3,4, 1);

But this will be read incorrectly:

gl_FragColor = vec4(1,2,3,4, .5);

Read this topic online here:

More information about the osg-users mailing list