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

Reply via email to