Hi Karl, First up, loads in tens of thousands of model parts efficiently isn't a newbie task, it's an advanced topic, so be prepared for needing to dig into lots of specifics of hardware/databases and lower level elements of the OSG. I don't mean to frighten you off, just prepare you for a steep learning curve.
The DatabasePager is designed around supporting paged databases, which a created as quad/oct tree hierachy with level of detail nodes (PagedLOD) that control the complexity of the scene. In you case it might be appropriate if you have a scene that can naturally be built into a such a database hierachy, but it sounds like it won't be - rather it sounds like it's just a big flat set of models. In the case of speeding the load of a lots of separate models one should consider what are your performance goals and what constraints you have w.r.t hardware and database arrangement. W.r.t hardware - do you have lots of CPU cores available? The more CPU cores you have the more threads you'll be able to dedicate to reading. Also if you can arrange your database in an archive rather than lots of separate files it may help, especially under Windows as it has a crap file system that can't efficiently handle directories with lots of similarly names files in them. As for threading database reads, this can be done without the DatabasePager, and in fact the DatabasePager isn't the best tool as it's focus lies with paged databases (such as vis-sim models). Personally I'd use a set of osg::OperationThead's that share a single osg::OperationQueue, and on this queue you add your own custom osg::Operation tasks that do the reading of the components from disk, and then when they complete their reading add them into a thread safe output queue of nodes that get read in the main thread and merged with the main scene graph. This might sounds complex, but in coding terms will just be a couple of hundred lines of code. Robert. On Sun, Dec 13, 2009 at 9:44 PM, Karl Karsten <[email protected]> wrote: > Hello, > > I am just experimenting to load huge amount of models. > I have a set of ~50.000+ single models (parts) stored on disk in a > folder structure in .osg or .ive format, converted from a cad system > format. To each of the models I have a transformation matrix to position > the model in the scene. Each model has the size similar to the cessna > example. > At the end the scene represent a complete mechanical car, aeroplane > truck etc. > > I would like to have best performance when loading the scene in the > viewer and inspecting them (zoom, pan, etc.). > > My newbie questions are: > - Should I use simply osgDB::readNodeFile in a loop for all parts? > I guess this will be slow when reading. > > - Can I prepared something before reading? creating an archive etc.? > > - Can osgDB::DatabasePager be a solution? Is there any Newbie > documentation available for osgDB::DatabasePager? Examples or code > sniplets? > > Many thanks for some tips. > > Karl ... > > > _______________________________________________ > 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

