Hi,

> I haven't yet figured out how to get from an osg.:Camera or an 
> osg::RenderInfo& to an actual fbo pointer.  *sigh* 


Such a method should be usefull, but I didn't find a way to do it neither.

In my application, I do something really close, but I affect explicity the 
texture to use for color buffer and depth buffer :


Code:
        
p_sceneCamera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);
        p_sceneCamera->attach(osg::Camera::COLOR_BUFFER, 
p_sceneColorOutputBuffer);
        p_sceneCamera->attach(osg::Camera::DEPTH_BUFFER, 
p_sceneDepthOutputBuffer)



Where p_sceneDepthOutputBuffer :

- internalFormat = GL_DEPTH_COMPONENT32
- sourceFormat = GL_DEPTH_COMPONENT
- sourceType = GL_FLOAT

So I don't need to extract the pointer to the depth buffer, because I already 
nknow it : it is "p_sceneDepthOutputBuffer"

And then I can share it with another camera or copy it using a renderquad and a 
shader (but this copy is maybe not as edficient as a "glBlitFramebuffer" call)


Cheers,
Aurelien

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





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

Reply via email to