Re: [osg-users] Trigger some function when PagedLOD finishes openening a node
Hello Robert, thank you very much for the detailed answer. I implemented an app based on Qt. My draw/frame events are only called when the user makes some action (e.g. Mouse Click, Mouse Move). Is there a way I could bypass this and use the osgViewer:::ViewerBase::ON_DEMAND option? 2016-09-10 17:36 GMT+01:00 Robert Osfield: > Hi Bruno, > > You could possible use the ReadFileCllback for this purpose. Have a > look through the archives for discussions on the different ways that > ReadFileCallback can be used. > > However, I have to add the the DatabasePager is designed to dispatch > compile operations to the draw traversal to compile the newly loaded > subgraphs incrementally during each frame. A newly loaded subgraph > isn't merged until all the GL objects in that subgraph have been > compiled. This means you can't just switch off doing the rendering > loop and wait for things to load and just render one frame and expect > everything to merge right away. This incremental compilation exists > to avoid frame drops. > > One way around this pre compilation would be to simply switch off pre > compilation of subgraphs, this would be new subgraphs are merged in > the frame right after it has been loaded. However, this approach > increases the changes of a frame drop as the new data is rendered for > the first time. > > There is support built into lazy update of the scene via the > osgViewer::ViewerBase::setRunFrameScheme(...) support for the the > osgViewer:::ViewerBase::ON_DEMAND option. When this is set and you > use the Viewer::run() method the viewer will automatically only call > frame when events have happened, there are animations running or the > database requires a new frame to be done (including for the > incremental compilation.) You could have a look at how this is > implemented if you want to do something similar, or just use it > directly. > > Robert. > > On 10 September 2016 at 09:56, Bruno Oliveira > wrote: > > Hello, > > > > > > I am using a PagedLOD engine, but I need to call some function I have > every > > time the PagedLOD finished reading a Node and it is ready for rendering. > > This function I want to call is intended to trigger a draw/refresh > action in > > my viewer, but I think this could be any function at all. > > > > > > How do I do that? > > > > Thank you > > > > ___ > > osg-users mailing list > > osg-users@lists.openscenegraph.org > > http://lists.openscenegraph.org/listinfo.cgi/osg-users- > openscenegraph.org > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Trigger some function when PagedLOD finishes openening a node
Hi Bruno, You could possible use the ReadFileCllback for this purpose. Have a look through the archives for discussions on the different ways that ReadFileCallback can be used. However, I have to add the the DatabasePager is designed to dispatch compile operations to the draw traversal to compile the newly loaded subgraphs incrementally during each frame. A newly loaded subgraph isn't merged until all the GL objects in that subgraph have been compiled. This means you can't just switch off doing the rendering loop and wait for things to load and just render one frame and expect everything to merge right away. This incremental compilation exists to avoid frame drops. One way around this pre compilation would be to simply switch off pre compilation of subgraphs, this would be new subgraphs are merged in the frame right after it has been loaded. However, this approach increases the changes of a frame drop as the new data is rendered for the first time. There is support built into lazy update of the scene via the osgViewer::ViewerBase::setRunFrameScheme(...) support for the the osgViewer:::ViewerBase::ON_DEMAND option. When this is set and you use the Viewer::run() method the viewer will automatically only call frame when events have happened, there are animations running or the database requires a new frame to be done (including for the incremental compilation.) You could have a look at how this is implemented if you want to do something similar, or just use it directly. Robert. On 10 September 2016 at 09:56, Bruno Oliveirawrote: > Hello, > > > I am using a PagedLOD engine, but I need to call some function I have every > time the PagedLOD finished reading a Node and it is ready for rendering. > This function I want to call is intended to trigger a draw/refresh action in > my viewer, but I think this could be any function at all. > > > How do I do that? > > Thank you > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
[osg-users] Trigger some function when PagedLOD finishes openening a node
Hello, I am using a PagedLOD engine, but I need to call some function I have every time the PagedLOD finished reading a Node and it is ready for rendering. This function I want to call is intended to trigger a draw/refresh action in my viewer, but I think this could be any function at all. How do I do that? Thank you ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org