Re: [osg-users] framerate drops drastically when turning child nodes on and off
Hi John, On 9 May 2012 15:52, John Kelso wrote: > Many thanks. This problem sure is beginning to smell like "driver and/or > card" to me. I'd love to hear from other Linux users too. I think there is probably a few issues going on here. First up switching on/off subgraphs can cause problems on first enabling a new subgraph in that OpenGL objects required to render the subgraph may not have compiled and downloaded to the GPU so have to be created, compiled and downloaded on the first frame that they appear - this can cause a frame drop but it'll typically be just for the first frame. The way to avoid this issue is to make sure you precompile the whole subgraph prior to rendering. The OSG has a osgUtil::GLObjectsVisitor written for the purpose of precompiling this will be invoked in the realize of the graphics window - but will only compile your subgraph if you have already assigned it to the view. If you add you scene graph after realize you can invoke this automatically for the next frame by calling osgViewer::Renderer::setCompileOnNextDraw(true) for each viewer Camera via: osgViewer::Renderer* renderer = dynamic_cast(camera->getRenderer()); renderer->setCompileOnNextDraw(true); If your NodeMask is set to 0x0 then the GLObjectVisitor won't traverse the subgraphs so perhaps this might be causing problems, if so you might need to use a draw callback to invoke your own GLObjectVistor traversal with NodeVisitor::setNodeMaskOverride(uint) set so that the compile traversal is able to ignore the 0x0 node masks during traversal. -- The odd frame rate cycling seen by Stephan is likely a whole different issue related to the way the driver/os/OpenGL FIFO and the draw dispatch are all interacting. Try disabling/enabling vsync to see if that changes behaviour. By co-incidence Today I'll be doing some work on using the new ARB_sync functionality to sync frame loop, this should enable us to control how many frames are dropped into the OpenGL FIFO and hold the frame loop to be sync'd with vysnc so we don't end up over filling the OpenGL FIFO and hopefully this will avoid the OpenGL FIFO blocking the application periodically. I'll ping the list once I've checked this functionality in. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] framerate drops drastically when turning child nodes on and off
Many thanks. This problem sure is beginning to smell like "driver and/or card" to me. I'd love to hear from other Linux users too. John On Wed, 9 May 2012, Stephan Maximilian Huber wrote: Am 09.05.12 15:26, schrieb John Kelso: Do you see the original problem as well? Does it act the same at .5 FPS and no switching, and degrade at 1 FPS? I don't see the original problem, the draw time is constant for both FPS, no peaks, nada. Only if i rotate the cube about 180° performance decrease to 3-5fps, regardless of the specified switch-timing. cheers, Stepahn ___ 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] framerate drops drastically when turning child nodes on and off
Am 09.05.12 15:26, schrieb John Kelso: > Do you see the original problem as well? Does it act the same at .5 FPS and > no switching, and degrade at 1 FPS? I don't see the original problem, the draw time is constant for both FPS, no peaks, nada. Only if i rotate the cube about 180° performance decrease to 3-5fps, regardless of the specified switch-timing. cheers, Stepahn ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] framerate drops drastically when turning child nodes on and off
Do you see the original problem as well? Does it act the same at .5 FPS and no switching, and degrade at 1 FPS? Thanks, John On Wed, 9 May 2012, Ulrich Hertlein wrote: When running this on OS X I'm seeing some odd behaviour as well: - roughly every 7s there is a jump in the draw time (see attached screenshot) - this happens even when *not* switching between the two groups (no update callback installed; both are visible at the same time) Cheers, /ulrich ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] framerate drops drastically when turning child nodes on and off
Am 09.05.12 09:31, schrieb Ulrich Hertlein: > When running this on OS X I'm seeing some odd behaviour as well: > - roughly every 7s there is a jump in the draw time (see attached screenshot) > - this happens even when *not* switching between the two groups (no update > callback > installed; both are visible at the same time) I see dramatic performance degression, when rotating the cube to a specific angle, performcance goes down from 60fps to 3fps. (MacPro with an ATI Radeon HD 5770 1024 MB) Rotating the cube a bit more the performance goes back to normal. Maybe Mac OS X internal multithreaded-rendering is the culuprit here, (which is enabled by default i think). I've seen this jump every 7s too, but when running the app for a longer time, the jump goes away. cheers, Stephan ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] framerate drops drastically when turning child nodes on and off
Hi Philip -- I've been working with John on this. The FrameStamp's reference time should be clock time / elapsed seconds. Just to clarify, the code uses reference time only to control when to flip from one child to another, and that appears to be working correctly. John's performance drop also occurs when other mechanisms (such as Sequence nodes) are used to flip between children. As an additional data point, we have evidence to suggest the issue is platform-specific. We've seen it on some Linux systems with Quadro graphics, but the same code has a consistent framerate on Win7 systems with GeForce graphics. We were hoping the community would try the code and see if they are able to reproduce framerates that vary based on the child flip time. -Paul On 5/7/2012 5:16 PM, Philip Taylor wrote: I am not familiar with getReferenceTime but I think the root cause of your problem is probably the line: unsigned int intTime( nv->getFrameStamp()->getReferenceTime() / _deltaFlipTime ); You probably just need to check that it is producing the values you are expecting for 0.05 and 1.0 -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of John Kelso Sent: 07 May 2012 22:24 To: osg-users@lists.openscenegraph.org Subject: [osg-users] framerate drops drastically when turning child nodes on and off Hi all, We are creating a simple flipbook animation. There's a node at the top, and after a certain delta time the child node that's on is turned off, and the next child is turned on. If all the child nodes are turned on we get a nice solid 60 FPS. Spin it around, move it here and there, no change in FPS. So the prolem isn't just too much data to fit on the card. When we animate with a delta time of .05 seconds we also get a nice smooth animation at 60 FPS. But, here's where things get weird, if we use a delta time of 1 second we get a sudden and very drastic drop in frame rate. The size of the drop seems to be related to the amount of data getting turned on and off. Same thing if you manually single step the animation. ___ 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] framerate drops drastically when turning child nodes on and off
I am not familiar with getReferenceTime but I think the root cause of your problem is probably the line: unsigned int intTime( nv->getFrameStamp()->getReferenceTime() / _deltaFlipTime ); You probably just need to check that it is producing the values you are expecting for 0.05 and 1.0 -Original Message- From: osg-users-boun...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of John Kelso Sent: 07 May 2012 22:24 To: osg-users@lists.openscenegraph.org Subject: [osg-users] framerate drops drastically when turning child nodes on and off Hi all, We are creating a simple flipbook animation. There's a node at the top, and after a certain delta time the child node that's on is turned off, and the next child is turned on. If all the child nodes are turned on we get a nice solid 60 FPS. Spin it around, move it here and there, no change in FPS. So the prolem isn't just too much data to fit on the card. When we animate with a delta time of .05 seconds we also get a nice smooth animation at 60 FPS. But, here's where things get weird, if we use a delta time of 1 second we get a sudden and very drastic drop in frame rate. The size of the drop seems to be related to the amount of data getting turned on and off. Same thing if you manually single step the animation. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org