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

Steven Powers osgforum at tevs.eu
Thu Mar 12 12:27:24 PDT 2009

Camera Set up:

                _image = new osg::Image();
                _image->allocateImage(_camera->getViewport()->width(),_camera->getViewport()->height(), 1, GL_RGBA, GL_FLOAT);

            //redirect rendering to frame buffer object

In the shader I set: 

 gl_FragData[0] =vec4(0.12, 5, 0.000705882, 1); 

I can retrieve the RGB values. 
However, if I set the alpha channel to anything but 1 ie:

gl_FragData[0] =vec4(0.12, 5, 0.000705882, .5);

I seem to get random values. 

Any idea why this is happening?

Read this topic online here:

More information about the osg-users mailing list