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

Guy guy at dvp.co.il
Wed Mar 18 23:11:44 PDT 2009


Hi Steven,
 
 Two things, first, in the code you entered there are 5 values you set
in vec4... so maybe it's a mistake in the email, and maybe in the shader
code.

 Second, to have alpha values between 0-1 you don't need MRT.

Guy.



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:
 
Code:
gl_FragColor = vec4(1,2,3,4, 1);



But this will be read incorrectly:

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



------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=8707#8707





_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g



More information about the osg-users mailing list