Hi Daneil, You'll need to render the scene to a FBO with texture attached to as the depth buffer, then reuse this texture in the second pass.
Robert. On Mon, Mar 9, 2009 at 1:30 AM, Daniel Holz <[email protected]> wrote: > Hi osg-users, > > is it possible to access the Z-Buffer content from a render pass 1 in the > shaders during a second render pass 2 if I do not clear the Z-Buffer content > in pass 1? > > In my project I render my scene in pass 1 and set the clear mask for pass 2 > to "0", hence not clearing neither the color nor the depth buffer: > pCamPass2->setClearMask(0); > > Now, how do I read out the Z-Buffer content of the gpu for a given pixel in > the fragment shader of pass2? > Trying to read from gl_FragDepth did not work. > > Any suggestions? > > Cheers > Daniel > > _______________________________________________ > 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

