Hi Robert et. al.,

> A custom "cull visitor" wouldn't be related to the osgViewer, rather
> it's something you'd instantiate and call yourself on demand.  The
> custom "cull visitor" needn't even subclass from CullVisitor.  The
> subclass from IntersectionVisitor with a Polytope representing the
> view frustum way actually be the best place to start.

I setup a osgUtil::PolytopeIntersector with a custom osgUtil::IntersectionVisitor::ReadCallback for loading as you suggested, but I have two new independent problems with this approach:

1) If I set the PolytopeIntersector to represent the view frustum (as below), then the IntersectionVisitor will try to load an insane amount of tiles (i.e. does not work. For the purpose of testing the method of loading PagedLOD this way I have just set the polytope to a fraction of the view). I think(?) the problem here is that I don't need the highest level of detail available - I need the correct level of detail for the specified camera.

   viewport = getCamera()->getViewport();
intersector = new osgUtil::PolytopeIntersector( osgUtil::Intersector::WINDOW, viewport->x(), viewport->y(), viewport->width(), viewport->height() );
   osgUtil::IntersectionVisitor iv(intersector,_readCallback.get());
   getCamera()->accept(iv);

2) The DatabasePager does not pick up on the fact that some PagedLODs have already been explicitly loaded with: osgDB::readNodeFile(filename, new osgDB::ReaderWriter::Options("CACHE_ALL")) in my implementation of osgUtil::IntersectionVisitor::ReadCallback.

I found the earlier thread between Robert and Wojtek titled "Passing explicitly loaded model to DatabasePager for expiry management" http://groups.google.com/group/osg-users/browse_thread/thread/b4f1a0abf7f72353/fcd3955ed3e0384e?lnk=gst&q=DatabasePager+IntersectionVisitor#fcd3955ed3e0384e

However, I didn't get the "double caching" trick to work (Wojtek, do you have any code sample to share?). I even tried to derive DatabasePager and add code (i.e.: ugly hacks) for making the DatabasePager aware of explicitly loaded tiles, but with no luck:(

Furthermore, even if I succeed in making the DatabasePager aware of already loaded tiles, I'm not sure that the intersector approach to loading the "correct" level of detail will fare any better than the CustomRenderer approach presented in an earlier posting. Profiling (callgrind) of both the osgautocapture and the osgintersection example with "LineOfSight" enabled shows that it is osgTerrain::GeometryTechnique::generateGeometry() that takes 60-78% for CPU time (rendering is disabled in both cases).

So the challenge seems to be:
1) Load necessary tiles down to appropriate level of detail _without_ generating geometry.

2) Discard tiles that are that are not needed for specific camera setting (excluding tiles that already have geometry)

3) Generate geometry for remaining tiles.

4) Render scene, capture image, and exit.

Thanks in advance for any suggestions, idea or relevant code samples:) Apologies for the lengthy post.

Best regards,
John

Robert Osfield wrote:
Hi John,

A custom "cull visitor" wouldn't be related to the osgViewer, rather
it's something you'd instantiate and call yourself on demand.  The
custom "cull visitor" needn't even subclass from CullVisitor.  The
subclass from IntersectionVisitor with a Polytope representing the
view frustum way actually be the best place to start.


Robert.



--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to