Hi Marcus, Performance optimization is a huge topic and most of the time it comes down to creating a well balanced scene graph. You really need to make sure that the whole scene graph is built with performance in mind, one typically can't just enable something or apply some high level trick to suddenly get performance so to tricks you've already tried are really in this territory.
What you need to do is take a step back and start learning how different scene graphs/effects affect performance, what the bottlenecks are and what different techniques you can employ to improve the scene graphs to render at the desired framerates. As I said this is a *huge* topic so if you are new to real-time graphics it will seem rather daunting. Various aspects of performance optimization has been discussed many times on the osg-users mailing list/forum so I'd recommend have a look through the archives. FYI, the OSG by default does view frustum culling and provide lots of other ways of doing culling too, how effective they are depends upon the scene graph itself - the OSG is professional class scene graph used in many simulators worldwide - it has what it takes to deliver the performance that simulators needs but as much as it's very capable it can't fix scene graphs that are not built well. Robert. On Tue, Sep 20, 2011 at 2:32 PM, Marcus Rabe <[email protected]> wrote: > Hi, > > I am using "OSG version 2.8.2" on a Windows XP x64 System (i7 system, 8GB > RAM) and I am trying to implement a driving simulator with OSG. First I > testet all the scene with a small city and had no performance problems when I > was driving thru the city. But now I loaded the hole city into the scene and > than it was not possible to drive because I had one frame per second. (loaded > .ive 3d city-file was about 80Mb ...mem usage of the fully loaded scene is > around 323MB) > > First, I added backface-culling to every geode in the scene with following > lines: > > > Code: > rootNode->getOrCreateStateSet()->setMode( GL_CULL_FACE, > osg::StateAttribute::ON|osg::StateAttribute::OVERRIDE ); > > > > > I used OVERRIDE so that all the child nodes has the same property. > This works a little bit faster but is still no good performance. > Than I modified my camera settings with following lines: > > > Code: > camera->setCullingMode(osg::CullSettings::ENABLE_ALL_CULLING); > camera->setSmallFeatureCullingPixelSize(30.f); > > > > > 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 ); > > > > > Again it was a little bit faster but the performance still sucks. > 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 > > > > > I have no idea what I can do. If someone had the same problem like me and > found a solution, it would be great if he can post it here. > > I hope my english is ok. > > Thanks alot! > > Cheers, > Marcus[/quote] > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=42898#42898 > > > > > > _______________________________________________ > 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

