Hi, Robert Thank you for your quick and kind reply. I have done this work according to your suggestions.
In my application, I manage large terrains by myself and just create a separate thread to load different terrains. Now it is running smoothly. Thanks again! -- Regards, Xia Qingran On Fri, Oct 10, 2014 at 4:06 PM, Robert Osfield <[email protected]> wrote: > Hi Xia, > > If you want the viewer's main loop to run independently from loading then > you'll need to create a database thread specifically to do the reading and > then have the main loop sync with the database thread. The > Viewer::setThreadingModel() just control the threading of the viewer main > loop and rendering, not database paging so the viewer constraint on > threading shouldn't affect database paging. > > The OSG has a DatabasePager built in that provides this functionality but > it built around the PagedLOD node - and is typically used when users want > to page large scale terrains such as ones built offline by > VirtualPlanetBuilder or on the fly my the osgEarth 3rd Party NodeKit. > > However, your own needs may been simpler than this, so rolling your own > thread might be the thing to do. The osgthreadedterrain example provides > an example of doing background database loading and syncing the loaded data > wit the scene graph so you could look at is as a basis, although it'll > probably look rather more complicated than what you'll need. > > I would recommend getting this stuff work on the desktop then porting over. > > Robert. > > On 9 October 2014 18:54, 夏清然 Xia Qingran <[email protected]> wrote: > >> Hi, >> I am new to OSG and have developed my own osgviewer client on Android >> OpenGL ES 2.0 based on osgAndroidExampleGLES2. >> >> Now I want the osgviewer of android to access network files like http:// >> by curl plugin. However I found a big problem of it: when the network >> transmission time is too long, the FPS of my app is too slow, less than >> 1. >> >> I think it is because it is a single-threaded client, http curl will >> block the rendering. Through the online docs, >> http://www.openscenegraph.org/index.php/documentation/platform-specifics/android/43-building-openscenegraph-for-android-3-0-2, >> the Android viewer does not support multi-thread. So I only >> use:_viewer->setThreadingModel(osgViewer::ViewerBase::SingleThreaded) in my >> code. >> >> How to solve my problem? Is there a very elegant solution of it? >> >> Thanks. >> >> >> regards, >> 夏清然 >> Xia Qingran >> [email protected] >> http://www.qingran.net >> >> _______________________________________________ >> osg-users mailing list >> [email protected] >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> >> > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > >
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

