Hello,

I have the following setup. The main camera renders the scene to frame-buffer. 
Attached in the subgraph below the main camera, there is a post-render camera 
which does its work after the main has completed and renders to texture. 
However, in this second camera I want to reuse the depth buffer from the main 
camera.

I have something like:


Code:

osg::Camera* rt = new osg::Camera;
rt->setRenderOrder(osg::Camera::POST_RENDER, 0);
rt->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
rt->attach(osg::Camera::COLOR_BUFFER, tex);
rt->setClearMask(0);




This doesn't seem to work well, when ClearMask is 0; there are weird artifacts 
in rendering. It works fine when depth is cleared, though this is not what I am 
after. I am guessing that I should explicitly attach the depth buffer (that was 
previously used by main camera), but I am not really sure how to do that. If 
anyone has experience with this or ideas where to look, I'd very much 
appreciate it. Thanks.

Cheers,
Marko[/code]

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=48179#48179





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to