[quote="mp3butcher"]seams there's a problem in camera setup,but you didn't give 
it...
There's plenty of entries in osg forum concerning RTT camera setup..
hope the further code help
[code]  setClearMask(GL_COLOR_BUFFER_BIT);

        setClearColor(osg::Vec4(0.0f, 0, 0, 0.0f));
        setComputeNearFarMode(osg::Camera::DO_NOT_COMPUTE_NEAR_FAR);

        // set the camera to render before the main camera.
        setRenderOrder(osg::Camera::PRE_RENDER, 110);
        // tell the camera to use OpenGL frame buffer object where supported.
        setRenderTargetImplementation(osg::Camera::FRAME_BUFFER_OBJECT);

        setProjectionResizePolicy(osg::Camera::FIXED);
        setReferenceFrame(osg::Transform::ABSOLUTE_RF);
        setViewMatrix(osg::Matrix::identity());
        
setImplicitBufferAttachmentMask(osg::Camera::IMPLICIT_COLOR_BUFFER_ATTACHMENT, 
osg::Camera::IMPLICIT_COLOR_BUFFER_ATTACHMENT);
        setAllowEventFocus(false);      
//setReadBuffer(osg::Camera::COLOR_BUFFER);
        setDrawBuffer(osg::Camera::COLOR_BUFFER0);
        setViewMatrix(osg::Matrix::identity());

                setProjectionMatrix(osg::Matrix::ortho2D(0, 1, 0, 1));
         
                attach(osg::Camera::COLOR_BUFFER0, tex.get());

[/code][/quote]
Indeed that would be useful. 
I have read all the RTT entries which I could find, but it didn't help me solve 
the problem.

My camera code:
[code]
mainCamera->setClearMask(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
mainCamera->setClearColor(osg::Vec4f(0.0f, 0.0f, 0.0f, 1.0f));
mainCamera->setRenderOrder(osg::Camera::PRE_RENDER);
mainCamera->setRenderTargetImplementation(osg::Camera::FRAME_BUFFER);
mainCamera->setReferenceFrame(osg::Transform::ABSOLUTE_RF);
[/code]

I use FRAME_BUFFER because FRAME_BUFFER_OBJECT results in a black screen.
I have tried your settings, but it doesn't make a difference and 
setDrawBuffer(osg::Camera::COLOR_BUFFER0) gives an invalid enumerant error.

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





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

Reply via email to