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

Robert Osfield robert.osfield at gmail.com
Tue Nov 29 02:55:50 PST 2016


Hi Simone,

I'm a bit confused by your question, it suspect you are trying to
solve an already solved problem and in an awkward way.

The ReadResult only holds the loaded subgraph for a very short period
of time, it just used for passing a reference to a loaded object/scene
graph back to the the code that invoked the read operation.  I can't
see much sense in looking at it.

The osgDB::Registry has a ReadFileCallback that can be used to
override the read implementation, allowing a user to implement custom
behaviours.  This has is used for a wide range of tasks. Have a look
through the mailing list/forum archives on this topic to see how
others have used it and what for.   As I'm not clear on what problem
you are actually trying to sovle I really can't say if this is
required though.

PagedLOD's themselves are meant to be loaded and unloaded to balance
the load on the system, so that graphics memory and main memory don't
get overloaded, and that the cull. draw dispatch and draw GPU
traversals don't get overloaded.  PagedLOD itself knows when it's
subgraph has been loaded or not, so there is no need to intervene, you
just build your paged database and the OSG will automatically do the
rest for you.

Given all this I just can't work out why you'd need to check to see if
a PagedLOD subgraph has been loaded or not.  Could it be that you are
just assuming you'd need to do this manually when in fact there is
absolutely no need to do so as PagedLOD/DatabasePager are built from
the ground up to manage paged databases correctly with no redundant
loads.

Robert.





On 29 November 2016 at 10:16, Simone Rapposelli
<simone.rapposelli at gmail.com> wrote:
> Hi,
>
> I need to check if a pagedLod with a given fileName has been already loaded in the databasepager, in order to avoid to read it again from file.
> My ideal sollution would be to access to the current pagedLod list from inside the osgDB::ReaderWriter::ReadResult readNode(const std::string &fileName, const osgDB::ReaderWriter::Options *options) const, but I can't understand if is possible and in case how.
>
> Thank you!
>
> Cheers,
> Simone
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69522#69522
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



More information about the osg-users mailing list