Re: [osg-users] Qt + non-continuous draw + pagedLOD: Random loss of detail??
Hi all, I have the same problem in our digital content creation tool. IMHO the plausible solution would be to expire the nodes after certain number of frames rather than period of time. This would require changes in the database pager. It shall be possible to select expiration mode - time based or frame based (i.e. osgDB::setExpiryMode). I will think about implementation details this weekend. Regards, Maciej Krol 2008/7/31 Jakob Ruhe [EMAIL PROTECTED] Hi John! I also have these kind of problems when I use lazy rendering which is the way I want it to be done in my application. These methods may help you: osgDB::setExpiryDelay PagedLOD::setNumChildrenThatCannotBeExpired You can also override these virtual methods to fine tune what you want to do: osgDB::removeExpiredSubgraphs PagedLOD::removeExpiredChildren I hope it can help you in your case even though these are not any good permanent solutions for any lazy rendering app.. /Jakob Ruhe 2008/7/30 Glenn Waldron [EMAIL PROTECTED]: John, I have run into the same issue. PagedLOD children expire after a certain period of time (default is something like 5 seconds?) If a PagedLOD child has not been visited in the last N seconds, the pager will discard it and revert to a lower LOD. OSG updates the time-last-visited during the cull traversal in order to check for expiration. So, if you are not continuously running the frame loop, PagedLOD's will think their children have expired and will drop to the lowest LOD. I used to refer to the technique you're using as lazy rendering (i.e. only render a frame when something has changed) ... try searching the archives ... but at the time I never did find a good way to do this in OSG without confusing the pager. Glenn -- Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : +1.703.652.4791 On Wed, Jul 30, 2008 at 8:39 AM, John Vidar Larring [EMAIL PROTECTED] wrote: Hi all, Background: --- In our application the user can set up scenes ( or sequences as we call them) for playback on a timeline (e.g. seq.1 - transition - seg.2 - transition ... seq.N). Some scenes are too complex to render real-time and are recorded to movies before playback. Hence, when scenes are edited by the user all scenes are redrawn as needed rather than continuously to avoid sluggish GUI response. Problem: _Sometimes_ when the scene is redrawn in edit mode (i.e. redraw only if needed), the pagedLOD DB (osgTerrain) drops to the lowest detail level (Ref. osg_original.jpg and osg_problem.jpg). This behavior seems to appear at randomly. In playback mode (i.e. when frame rate is constant) the problem never occurs. Reproduce / Code example: -- The problem has been reproduces in a small test program (osgtest_source_code.tgz) derived from the osgviewerQT example (since we are using Qt 4.x in our application). To reproduce: run the compiled application: 'osgtest -t your osgTerrain db' . To trigger refreshes, occlude parts of the window with another window. The problem typically reveals itself when at a redraw or when the window looses focus (be patient, since this happens randomly it may take some time before the problem occurs). Since I'm still quite new to OSG, I'm not sure where to look for a solution. Hopefully someone will spot the obvious error in the sample code. Any advice is highly appreciated. Versions: - OSG svn rev 8700 Qt 4.2.3 Best regards, John Larring -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. ___ 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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] moving models...
Shayne, In my application, a global buffer is used to input data to osg thread from other thread. I used the method as same as Todd told you. setMatrix() is used to update the matrix of that MatrixTransform node. ... osg::ref_ptrosg::group root; osg::ref_ptrosg::MatrixTransform MotionMatrix; osg::ref_ptrosg::node MotionModelFile; //your motion model ... root-addchild(MotionMatrix); MotionMatrix-addchild(MotionModelFile); ... while((!Viewer.done) { ... if(Update is Needed) //position is changed or other MotionMatrix--setMatrix(osg::Matrix::translate(Pos)); //your position data ... Viewer.frame(); ... } su hu 2008/8/2, Tueller, Shayne R Civ USAF AFMC 519 SMXS/MXDEC [EMAIL PROTECTED]: This is probably a silly and simple question, but does anyone have an example of how to move a model explicitly without using a canned animation? Most of the examples I've seen, update the position in an animation using UpdateCallback. I have a position update coming from another process outside the scenegraph that I need to feed into the model to update its position. Do I need to use an UpdateCallback or a NodeVisitor approach? Any help would be most appreciated… Thanks, -Shayne ___ 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] Lazy Rendering with pagedLOD databases
Maciej, That's a good idea. Taking it one step further, the system could allow you to install a custom expiry callback so that you have the option of explicitly controlling the expiration test yourself. Perhaps a functor that DatabasePager can apply to PagedLOD::removeExpiredChildren. Paging control can really be application-specific. Available memory, distance to the eyepoint, priority, number of frames ... they can all be important considerations when considering whether to page out data. Glenn On Sat, Aug 2, 2008 at 5:16 AM, Maciej Krol [EMAIL PROTECTED] wrote: Hi all, I have the same problem in our digital content creation tool. IMHO the plausible solution would be to expire the nodes after certain number of frames rather than period of time. This would require changes in the database pager. It shall be possible to select expiration mode - time based or frame based (i.e. osgDB::setExpiryMode). I will think about implementation details this weekend. Regards, Maciej Krol 2008/7/30 Glenn Waldron [EMAIL PROTECTED] John, Digging into my memories on the subject... One issue is, like you said, keeping data from paging out when the renderer is idle. One approach might be to force a cull traversal every so often, or to visit the scene graph and manually update the timestamps on your PagedLODs. There may be more to it however. The other issue is making sure the pager completes all the tasks it has queued up. The pager does a little slice of work each frame in order to avoid frame rate hiccups. So when you go to render on demand, you have to keep looping until the pager goes idle ... i.e. its queues empty out. You can query the state with requiresUpdateSceneGraph(), getFileRequestListSize(), et al. Now, my experimentation in this area was with an older version of OSG and Robert has refactored the pager since then. It ended up being a much more complex task than I anticipated. Glenn On Wed, Jul 30, 2008 at 10:12 AM, John Vidar Larring [EMAIL PROTECTED] wrote: Hi Glenn, Thanks for your quick reply as always:) Changing topic title to use more appropriate terms. See comments below: I used to refer to the technique you're using as lazy rendering (i.e. only render a frame when something has changed) ... try searching the archives ... When searching the archives for lazy rendering through Google Groups and Gmain, I only found to posting on the subject, of which this one comments the former: http://article.gmane.org/gmane.comp.graphics.openscenegraph.user/8859/match=lazy+rendering I have run into the same issue. PagedLOD children expire after a certain period of time (default is something like 5 seconds?) If a PagedLOD child has not been visited in the last N seconds, the pager will discard it and revert to a lower LOD. OSG updates the time-last-visited during the cull traversal in order to check for expiration. So, if you are not continuously running the frame loop, PagedLOD's will think their children have expired and will drop to the lowest LOD. [snip]... but at the time I never did find a good way to do this in OSG without confusing the pager. Hmmm... that's what I feared. Ok, I am just thinking aloud here since this is a problem I really need to get solved: For real-time rendering paging out children on expery time is a good idea to keep memory consumption at minimum. However, this obvious does not work for lazy rendering. What if the pager could be configured in the following way for lazy rendering: * Set a maximum memory size osgDB::DatabasePager can occupy. * When a new page/sub-graph is added, osgDB::DatabasePager::removeExpiredSubgraphs() will remove the oldest pages if the maximum limit is exceeded. Would this be a feasible strategy? Or are there better ways/strategies to support lazy rendering of pagedLOD databases? Best regards, John Larring Glenn Waldron wrote: John, I have run into the same issue. PagedLOD children expire after a certain period of time (default is something like 5 seconds?) If a PagedLOD child has not been visited in the last N seconds, the pager will discard it and revert to a lower LOD. OSG updates the time-last-visited during the cull traversal in order to check for expiration. So, if you are not continuously running the frame loop, PagedLOD's will think their children have expired and will drop to the lowest LOD. I used to refer to the technique you're using as lazy rendering (i.e. only render a frame when something has changed) ... try searching the archives ... but at the time I never did find a good way to do this in OSG without confusing the pager. Glenn -- Glenn Waldron : Pelican Mapping : http://pelicanmapping.com : +1.703.652.4791 On Wed, Jul 30, 2008 at 8:39 AM, John Vidar Larring [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi all, Background: --- In our application the user can set up scenes ( or sequences as we
Re: [osg-users] Please test 2.6 branch
Tested with MinGW package bundled with Code::Blocks 8.02 - applications work as expected. However, see attachment for some of the warnings emitted by mingw32-gcc (3.4.5) ... H cid:part1.02030207.01040400@technotecture.com Paul Martz wrote: Hi all -- We've had some build testing of the 2.6 branch on Windows and a Linux box. Since it contains some mingw-specific changes, I'd especially like to see it tested there, as well as build and execution testing on all platforms. http://www.openscenegraph.org/svn/osg/OpenSceneGraph/branches/OpenSceneGraph-2.6 Please note the URL above is _not_ the SVN head; you'll need to 'svn switch' to the branch or check out a separate tree. (You're right, this is not how OSG releases usually work.) Thanks for helping with this release. Paul Martz *Skew Matrix Software LLC* http://www.skew-matrix.com http://www.skew-matrix.com/ +1 303 859 9466 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Hartmut Seichter, PhD (HKU), Dipl-Ing.(BUW), Postdoctoral Fellow, HITLabNZ C:\Development\SDKs\OpenSceneGraph\src\osgDB\FileUtils.cpp|30|warning: F_OK redefined| C:\PROGRA~1\CODEBL~1\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\io.h|196|warning: this is the location of the previous definition| C:\Development\SDKs\OpenSceneGraph\src\osgViewer\GraphicsWindowWin32.cpp||In member function `virtual bool osgViewer::Win32WindowingSystem::setScreenRefreshRate(const osg::GraphicsContext::ScreenIdentifier, double)':| C:\Development\SDKs\OpenSceneGraph\src\osgViewer\GraphicsWindowWin32.cpp|886|warning: converting to `DWORD' from `double'| C:\Development\SDKs\OpenSceneGraph\src\osgViewer\GraphicsWindowWin32.cpp||In member function `virtual void osgViewer::GraphicsWindowWin32::checkEvents()':| C:\Development\SDKs\OpenSceneGraph\src\osgViewer\GraphicsWindowWin32.cpp|1729|warning: passing NULL used for non-pointer converting 3 of `BOOL PeekMessageA(tagMSG*, HWND__*, UINT, UINT, UINT)'| C:\Development\SDKs\OpenSceneGraph\src\osgViewer\GraphicsWindowWin32.cpp|1729|warning: passing NULL used for non-pointer converting 4 of `BOOL PeekMessageA(tagMSG*, HWND__*, UINT, UINT, UINT)'| C:\Development\SDKs\OpenSceneGraph\src\osgViewer\GraphicsWindowWin32.cpp||In member function `virtual void osgViewer::GraphicsWindowWin32::requestWarpPointer(float, float)':| C:\Development\SDKs\OpenSceneGraph\src\osgViewer\GraphicsWindowWin32.cpp|1803|warning: converting to `LONG' from `float'| C:\Development\SDKs\OpenSceneGraph\src\osgViewer\GraphicsWindowWin32.cpp|1804|warning: converting to `LONG' from `float'| C:\Development\SDKs\OpenSceneGraph\src\osgWidget\Window.cpp||In member function `void osgWidget::Window::_removeFromGeode(osgWidget::Widget*)':| C:\Development\SDKs\OpenSceneGraph\src\osgWidget\Window.cpp|413|warning: converting of negative value `-0x1' to `unsigned int'| C:\Development\SDKs\OpenSceneGraph\src\osgWidget\WindowManager.cpp||In member function `virtual void osgWidget::WindowManager::childRemoved(unsigned int, unsigned int)':| C:\Development\SDKs\OpenSceneGraph\src\osgWidget\WindowManager.cpp|275|warning: converting of negative value `-0x1' to `unsigned int'| C:\Development\SDKs\OpenSceneGraph\src\osgPlugins\cfg\CameraConfig.cpp|23|warning: F_OK redefined| C:\PROGRA~1\CODEBL~1\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\include\io.h|196|warning: this is the location of the previous definition| C:\Development\SDKs\OpenSceneGraph\src\osgPlugins\OpenFlight\expPrimaryRecords.cpp||In member function `void flt::FltExportVisitor::writeLightPoint(const osgSim::LightPointNode*)':| C:\Development\SDKs\OpenSceneGraph\src\osgPlugins\OpenFlight\expPrimaryRecords.cpp|710|warning: passing negative value `-0x1' for converting 1 of `void flt::DataOutputStream::writeUInt32(flt::uint32)'| ||=== Build finished: 0 errors, 12 warnings ===| ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org