On 9/20/2011 7:32 AM, Marcus Rabe wrote:
This was again a little bit faster but was not enough.
Than I used LODNodes:
Code:
osg::ref_ptr<osg::Node> lodLevel3 = originalGeode;
osg::ref_ptr<osg::Node> lodLevel2 = dynamic_cast<osg::Node*>(
lodLevel3->clone( osg::CopyOp::DEEP_COPY_ALL ) );
osg::ref_ptr<osg::Node> lodLevel1 = dynamic_cast<osg::Node*>(
lodLevel3->clone( osg::CopyOp::DEEP_COPY_ALL ) );
osg::ref_ptr<osg::LOD> lodNode = new osg::LOD();
lodNode->addChild( cowLevel1.get(), 200.0f, 20000.0f );
lodNode->addChild( cowLevel2.get(), 50.0f, 200.0f );
lodNode->addChild( cowLevel3.get(), 0.0f, 50.0f );
I don't see where you are reducing the geometry/complexity of the lower LOD
nodes. If you're not doing that, then LOD won't help you; it would still draw
the full resolution regardless of your eye distance / pixel size.
I read somewhere that OSG supports frustum culling by default but it seems that
this is not working. Because when I am driving in the small city the peformance
is perfect and when I am loading more city structure to the scene and drive
thru the same city part it is horrible lame (but you see on the screen the same
polygones like in the small city)
My open scene graph looks like this:
Code:
root
+-scene objects
| +-trafficSigns
| +-trafficLight
| +-triggerObjects
+-city root
| +-roads
| | +-road geode1
| | +-road geode2
| | +-road geode3
| | +-road geode4...
| +-houses
| | +-house geode1
| | +-house geode2
| | +-house geode3
| | +-house geode4...
| +-trees
| | +-tree geode1...
| +-...
+-lights
| +-light souce..
+-HUD geode
Scene graphs do frustum cull, OSG included. It's the reason that scene graphs
exist. But currently you have a rather flat organization, resulting in O(n)
performance. You should try organizing your scene graph in more of a spatial
quad tree (for example) to achieve O(log(n)) performance. (This all assume your
scene graph is cull limited...)
-Paul
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org