Hi JP For now I Initialize a texture with the value A, in the shader I put the value B and I would like to have a the end in the texture the max blending between the value A and B.
Lets do an example: I create an texture Tex initialized with color red (1,0,0,1) I attach my texture to a camera Camera->attach(osg::Camera::COLOR_BUFFER0, Tex); I use a shader witch do this treatment: gl_FragData[0] = vec4(0.0,1.0,0.0,1.0); And I would like have a yellow (1.0,1.0,0.0,1.0) texture at the end of the treatment. For now using an osg::BlendEquation with RGBA_MAX blending, I have if I define a clearColor to my camera the blending between this clearColor and the color use in the shader. I think this is normal because the blendEquation define how the blending is doing between the color previously in the frame buffer and the added color. But it's not what i want I would like to have the blending between the color previously in the texture and the added color. Thanks for your help Clement 2010/1/7 J.P. Delport <[email protected]> > Hi Clement, > > could you explain a bit more what you expect and what you are getting? Do > you want to blend between the different textures (AFAIK you cannot do this > unless you do another pass)? Are you expecting max, but getting average? > > jp > > clement vidal wrote: > >> >> Hi, >> >> I have a problem with BlendEquations and shaders. That is the situation: >> >> I attach several textures to my camera using COLOR_BUFFER0, >> COLOR_BUFFER1, ... >> I use a shader to make the rendering into this textures. >> >> There is some values in this textures and i would like to use a max >> blending between the value wich are already in and the values i affect in >> the shader. >> >> When I define an osg::BlendEquation with RGBA_MAX blending, i have the >> blend result between the value in the frame buffer (background color or >> ClearColor ) and the value in the shader. >> >> What I do wrong? Somebody have a idea? >> >> Thanks for helping >> >> >> ------------------------------------------------------------------------ >> >> >> _______________________________________________ >> osg-users mailing list >> [email protected] >> 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. > > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

