[osg-users] How to check if pagedLod already exists in databasepager with same filename

Rafa Gaitan rafa.gaitan at gmail.com
Tue Nov 29 10:26:58 PST 2016


Hi Simone,

If you just want to use the PagedLOD as a kind of delayed system for
loading nodes (but not unload them from memory), I suggest you use instead
de osg::ProxyNode, it defers the loading to the DatabasePager but once
loaded is not unloaded anymore. If your database is well balanced the
CullVisitor will ensure good framerate when the node is not in the frustrum.

Just my two cents,

Rafa.


El mar., 29 nov. 2016 a las 15:43, Simone Rapposelli (<
simone.rapposelli at gmail.com>) escribió:

> Hi Robert,
>
> by increasing TargetMaximumNumberOfPageLOD the problem of having to reload
> the same PageLod disappears, so it works!!
> Thank you!
>
>
> robertosfield wrote:
> > Hi Simone,
> >
> > On 29 November 2016 at 12:37, Simone Rapposelli
> > <> wrote:
> >
> > > thank you for your fast reply.
> > > My problem is that osgDB::ReaderWriter::ReadResult readNode(const
> std::string &fileName, const osgDB::ReaderWriter::Options *options) gets
> called even if a PagedLod with the same fileName has been previously
> loaded: for example, this happens if I move to any position on the viewer
> and then come back.
> > > Thus, inside this function I need to check if any of the PagedLod
> currently loaded in DatabasePager has the same fileName of the passed
> argument: in this case I could avoid to reload data already in memory.
> > >
> >
> > The PagedLOD/DatabasePager paging scheme is designed to expire and
> > reload subgraphs, it *crucial* to load balancing.  If you cached all
> > loaded subgraphs your memory would rapidly be overwhelmed and your
> > system would grind to a halt.  The very scheme you are trying to
> > defeat is one of the best assets of the OSG, you *absolutely* do not
> > want to be breaking this mechanism.
> >
> > Now, if you the defaults the paging scheme uses for load balancing is
> > too conservative w.r.t the number of PagedLOD it will aim for in
> > memory at one time you can adjust it to be higher simply by setting
> > the TargetMaximumNumberOfPageLOD parameter, from the DatabasePager
> > header you'll see:
> >
> > /** Set the target maximum number of PagedLOD to maintain in memory.
> > * Note, if more than the target number are required for
> > rendering of a frame then these active PagedLOD are excempt from being
> > expiried.
> > * But once the number of active drops back below the target
> > the inactive PagedLOD will be trimmed back to the target number.*/
> > void setTargetMaximumNumberOfPageLOD(unsigned int target) {
> > _targetMaximumNumberOfPageLOD = target; }
> >
> > You can also set the default value using the env var OSG_MAX_PAGEDLOD
> > i,e under bash:
> >
> > export OSG_MAX_PAGEDLOD=2000
> > osgviewer mypageddatabase.osgb
> >
> > You can get a listing of the env vars supported by doing:
> >
> > osgviewer --help-env
> >
> > Robert.
> > _______________________________________________
> > osg-users mailing list
> >
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >  ------------------
> > Post generated by Mail2Forum
>
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69530#69530
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20161129/74bf3b4f/attachment-0003.htm>


More information about the osg-users mailing list