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 somehow to write only to those texels in my color attachment > of the second pass, where depth != far. Right now I really feel stupid, > as I thought that there must be any easy way to do so. Any ideas how to > render extra properties to the color buffer attachment at the positions > that have been written in the first pass without re-rendering the whole > scene?
You could write to the stencil buffer in the first pass, then render a full-screen quad with the stencil test enabled on the second pass to only write to the pixels written to in the first pass. osgPPU might be useful to you for doing this. >> 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 RTT-pass in the second camera, >>> so the renderorder is set accordingly. >>> >>> Basically my scene is organized like this: >>> >>> root >>> | >>> RTTCamera_1 >>> | |----Model >>> RTTCamera_2 >>> | |----Model >>> Booth cameras use the same geometry, viewport, transform. Yet the >>> Model graph is culled twice. Is there any way to prevent the second >>> cull traversal? I.e. reuse the batch collected in the first culling? >> >> In OSG, culling (the CullVisitor) also collects state. Since you are >> almost certainly using two different shaders (one that writes to three >> targets, another which writes to one), it's unlikely that OSG's state >> graph can be reused in your situation. >> -Paul -- Bryan Thrall Principal Software Engineer FlightSafety International bryan.thr...@flightsafety.com _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org