Hi Colin,
These days (i.e. OSG 2.2+) you don't need to use the DatabasePager, as
you can easily run a background OperationThread and register an custom
Operator to do the loading and merging with the main scene graph when
the load is done.
There isn't a succinct example that does this yet, but the osgtext
example does have a code pathway that creates multiple background
threads for creating text, and merges them with the main scene graph.
In the osgtext example look for the UpdateTextOperation and
atttachment to the view as an update operation (
viewer.addUpdateOperation(..) ) whilst at the same time being added to
an OperationThread that runs in the background.
Robert.
On Dec 14, 2007 4:30 PM, Colin Branch <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> What I'm trying to do:
> Asynchronous model loading using OSG 2.2
>
> How I'm currently doing it:
> I'm trying to use the Database Pager's requestNodeFile.
>
> I created a new node class that I can add (as well as place temporary
> objects) that I can add and will stay in the scene.
>
> class DtDelayedModelNode : public osg::Group
> {
> ...
> DtDelayedModelNode(const std::string& filename, osgDB::DatabasePager*
> pager) : osg::Group()
> {
> osg::FrameStamp fs;
> fs.setFrameNumber(INT_MAX);
> pager->requestNodeFile(filename,this,1.0,&fs);
> }
> ...
> };
>
> Problems:
> #1 Very limited documentation of the Pager class and no example on how
> to use it. I've searched the osgusers archive but haven't found
> anything too helpful, the 1.x examples don't seem relevant anymore.
> #2 Occasional texture corruption. This is difficult to reproduce
> however it appears that sometimes the width of the texture is 1px
> creating a streaking effect.
> #3 Certain actions cause the main app to lock, for example bringing up
> the Stats HUD.
>
> Questions:
> Is the Database Pager the proper way to be doing this?
>
> Are their any good examples using the Database Pager using OSG 2.x?
>
> What if any calls should I make to the pager around frame() (ie it
> doesn't appear that startFrame endFrame are needed, any other calls)?
>
> The value of the frame stamp appears to control deletion of requests. Ie
> if I pass in the current frame stamp, the model is actually deleted in
> compileGLObjects. Unless I set it to some value in the future (currently
> using INT_MAX) I can't guarantee it will load. Could someone explain the
> purpose of the framestamp and the proper usage?
>
> Is there anyway to get status feedback while a file loads?
>
> Thanks,
> Colin
> _______________________________________________
> 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