Hi,

I know OSG viewer can render into other window as shown in the glutviewer and 
sdl viewer example. But I do not know how to use fbo for this kind of work. The 
following code describes my purpose.



Code:


osg::ref_ptr<Viewer> viewer;
/* The vierwer is properly set up for other window*/

FrameBufferObject fbo;
/* The fbo is properly initilize with color and depth texture attachment and 
bind to a FBO object. And the fbo class have access to the texture object and 
will be used for image based rendering technic*/

/* The rendering loop */
void draw()
{
        // only repaint the whole scene when needed, because my scene is rather 
static and heavy, 
        // draw fewer things 
        if(dragging){
                fbo.bind();
                /* draw a fewer things into fbo*/
                viewer.frame();        
                fbo.unbind();
        }

        /* Draw heavier things */
        if(need_repaint)
        {
                fbo.bind();
                viewer.frame();
                fbo.unbind();
        }

        /* Do some post processing with fbo, e.g. eye dome lighting, which is  
a image based rendering techniqe */
        {
                /* filtering */
                filter(fbo);
        }

        /* blit the fbo onto backbuffer */
        fbo.blit();
        
        swapbuffer();
}





So my question is how to do this kind of fbo processing in OSG, because after 
investigate osg framebufferobject, I find the logic is not like this and a 
little confuse to understand. 

Thank you!

Cheers,
Han

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





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

Reply via email to