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

J.P. Delport jpdelport at csir.co.za
Wed Mar 18 11:12:44 PDT 2009


Hi,

I haven't read your code, but I'm sure alpha channel works just fine.

Attached is a modified osgmultiplerendertargets example. Run it with
osgmultiplerendertargets --image
which should print a=128

or with
osgmultiplerendertargets --hdr --image
which should print a=-1.1

You can adjust the values in gl_FragData[0].

rgds
jp


Steven Powers wrote:
> 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.org
> 

-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.




More information about the osg-users mailing list