Re: [osg-users] RTT multipass on same geometry

2011-09-23 Thread Sergey Polischuk
Hi, Sebastian You can setup blend func in a way that will keep old rgb values and replace alpha with new value. for second pass - BlendFunc(osg::BlendFunc::ZERO, osg::BlendFunc::ONE, osg::BlendFunc::ONE, osg::BlendFunc::ZERO). However if you reading from same texture attached to camera output

Re: [osg-users] RTT multipass on same geometry

2011-09-22 Thread Sebastian Messerschmidt
Thanks to all replies but I was able to figure it out. My initial idea was to modify a color attachment created in the first pass in the second pass only where fragments were created(i.e. depth was written) I came up with the following solution: 1. Pass RTT-Cam1 - DEPTH, COLOR1, COLOR2,

[osg-users] RTT multipass on same geometry

2011-09-21 Thread Sebastian Messerschmidt
Hello, I've have a question regarding RenderToTexture in a multipass setup. I have to RTT cameras, the first one has DEPTH and 3 color attachments, while the second has only one color attachment. I need to use the data from the first RTT-pass in the second camera, so the renderorder is set

Re: [osg-users] RTT multipass on same geometry

2011-09-21 Thread Paul Martz
On 9/21/2011 10:54 AM, Sebastian Messerschmidt wrote: Hello, I've have a question regarding RenderToTexture in a multipass setup. I have to RTT cameras, the first one has DEPTH and 3 color attachments, while the second has only one color attachment. I need to use the data from the first

Re: [osg-users] RTT multipass on same geometry

2011-09-21 Thread Sebastian Messerschmidt
Thank you Paul, It seems a little bit more obvious now. Basically I need to write some additional value to one of the COLOR attachments alpha channel, which is derived from the first pass. So my second approach (which seems to be failing) is somehow to write only to those texels in my color

Re: [osg-users] RTT multipass on same geometry

2011-09-21 Thread Thrall, Bryan
Sebastian Messerschmidt wrote on 2011-09-21: Thank you Paul, It seems a little bit more obvious now. Basically I need to write some additional value to one of the COLOR attachments alpha channel, which is derived from the first pass. So my second approach (which seems to be failing) is