Updating frame buffer

35 Views Asked by At

I am creating two windows in osg using osg::GraphicsContext and each window is separted into 4 parts where I render different images. I want to create transformation on one model in one image, so one out of four models in one window will have some kind of transformation. Below is the code that I am using.

The problem is if I have transformation on just one model does osg knows that it needs to update only that one frame buffer or does it update everything from the beginning even the ones that have no changes by frame?

osg::ref_ptrosgViewer::Viewer view1 = new osgViewer::Viewer;
osg::ref_ptrosgViewer::Viewer view2 = new osgViewer::Viewer;
// rest of the code...

// prepare viewer for rendering
view1->realize();
view2->realize();

while (!view1->done() && !view2->done()) 
{
    // Update transformations on models on images
    osg::Matrix matrix = transform->getMatrix();
    matrix *= osg::Matrix::rotate(osg::Quat(osg::inDegrees(1.0), osg::Vec3(0.0, 1.0, 0.0)));
    transform->setMatrix(matrix);

    view1->frame();
    view2->frame();
}
0

There are 0 best solutions below