Updating frame buffers #1301
Replies: 2 comments
-
You should use a osgViewer::CompositeViewer for this type of usage, as osgViewer::Viewer is written for a single window viewers. So create a single CompositerViewer and add your vsgViewer::View(s) to that viewer. You then just call viewer->frame() and it will render the views for you. |
Beta Was this translation helpful? Give feedback.
-
I think there are a couple of distinct things you might be trying to ask here, so I'll try to cover both. If you've got a viewer, then every frame, the advance, update, cull and draw steps will happen. The OSG doesn't cache the results of the last cull and redraw that if nothing's changed as typically, it'd be running one of these other passes that caused things to change, so it inherently needs to do everything in order for changes to happen in the first place. If you know you've not changed anything in a view's scene, though, you don't need to call As for making the transform only visible in one view, the simplest approach is to make the transform one view's scene data and the scene's root node a child of the transform, then make the scene without the transform the scene data for all the other scenes. |
Beta Was this translation helpful? Give feedback.
-
Hi, 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);
}
Beta Was this translation helpful? Give feedback.
All reactions