Re: [osg-users] Jerky display?
On Thu, Apr 23, 2009 at 6:20 AM, Akilan wrote: > Hi > > I bit know about the concept of quad tree. But I want to know applying the > concept on OSG construction. > Can I get any reference for organizing the scenegraph in quad tree form? I have help with API, but it's not my role to teach your about basics of computer graphics. Try google. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Jerky display?
Hi I bit know about the concept of quad tree. But I want to know applying the concept on OSG construction. Can I get any reference for organizing the scenegraph in quad tree form? Pls help me out. Akilan A -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10690#10690 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Jerky display?
HI Akilan, It kinda looks like you creating a scene graph that either uses the low res whole earth model or a group of high res tiles that all site in a single flat group. This is *really* inefficient way to build your scene graph. The proper way to build paged databases is to build a quad tree database. I don't know if the concept of quad tree is familiar to you so don't know how much to explain. Wriiting software that creates decent terrain paged databases is not a trivial matter, rather than create it yourself you should considering using a 3rd party tool to do it for you. For instance VirtualPlanetBuilder is designed to generated whole earth paged database that can be browsed with OSG apps. osgEarth and ossimPlanet also can generated paged databases on the fly for you. Robert. On Wed, Apr 22, 2009 at 6:41 AM, Akilan wrote: > Hi > > The following is the environment which i am working on, > > Hardware configuration: > > HP xw4400 Workstation > Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz, 2GB RAM > NVIDIA Quadro FX 3500 > > > OS: > MS Windows XP Professional Version 2002 > Service Pack 3, v.3244 > > OSG: > OSG2.2 > > The following set of code shows about how I am building scene graph for > terrian visualization, > > //the file"TerrainModels.txt" Contains list of terrain models(.osga files) > with absolute path > //all are geographic models with datum 'WGS-84' and 'UTM' projection > > ifstream fin("TerrainModels.txt"); > while(!fin.eof()){ > fin>>str; > if(strstr(str,".osga")!=NULL){ > osg::ref_ptr fog=new osg::Fog; > fog->setColor(osg::Vec4(.45,.45,.45,1.)); > fog->setStart(0.f); > fog->setEnd(50.f); > fog->setDensity(1.f); > fog->setMode(osg::Fog::LINEAR); > fog->setFogCoordinateSource(osg::Fog::FRAGMENT_DEPTH); > > osg::StateSet *statSet=new osg::StateSet(); > statSet->setMode(GL_BLEND,osg::StateAttribute::ON); > statSet->setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF); > statSet->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); > statSet->setAttributeAndModes(fog.get(),osg::StateAttribute::ON); > > osg::PagedLOD *plod = new osg::PagedLOD(); > plod->setName(str); > plod->setRangeMode(osg::PagedLOD::DISTANCE_FROM_EYE_POINT); > plod->setFileName(0, str); > plod->setPriorityOffset(0, 1.f); > plod->setPriorityScale(0, 1.f); > plod->setRange(0, 50.f, 100.f); > plod->setStateSet(statSet); > group->addChild(plod); > }else if(strstr(str,"bluemarble.ive")==0) //for specifically adding > virtual earth > group->addChild(osgDB::readNodeFile(str)); > } > fin.close(); > > osgViewer::Viewer viewer; > osgUtil::Optimizer optimzer; > > optimzer.optimize(group.get()); > viewer.setSceneData(group.get()); > viewer.addEventHandler( new > osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) ); > viewer.addEventHandler(new osgViewer::ThreadingHandler); > viewer.setCameraManipulator(new osgGA::TerrainManipulator()); > > viewer.realize(); > while(!viewer.done()){ > viewer.frame(); > } > > Let me explain the problem, > I am trying to load around 8000-9000 osg terrain models which are covering > part of india. > As I have set the PagedLOD range 50-100, when I enter the range(zooming-down > thru virtual earth), all the terrain models start loading and from that range > onwards I am not able to zoom-down freely. It becomes very slow and the view > also jerks. > > Please correct me. > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=10589#10589 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Jerky display?
Hi The following is the environment which i am working on, Hardware configuration: HP xw4400 Workstation Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz, 2GB RAM NVIDIA Quadro FX 3500 OS: MS Windows XP Professional Version 2002 Service Pack 3, v.3244 OSG: OSG2.2 The following set of code shows about how I am building scene graph for terrian visualization, //the file"TerrainModels.txt" Contains list of terrain models(.osga files) with absolute path //all are geographic models with datum 'WGS-84' and 'UTM' projection ifstream fin("TerrainModels.txt"); while(!fin.eof()){ fin>>str; if(strstr(str,".osga")!=NULL){ osg::ref_ptr fog=new osg::Fog; fog->setColor(osg::Vec4(.45,.45,.45,1.)); fog->setStart(0.f); fog->setEnd(50.f); fog->setDensity(1.f); fog->setMode(osg::Fog::LINEAR); fog->setFogCoordinateSource(osg::Fog::FRAGMENT_DEPTH); osg::StateSet *statSet=new osg::StateSet(); statSet->setMode(GL_BLEND,osg::StateAttribute::ON); statSet->setMode(GL_DEPTH_TEST,osg::StateAttribute::OFF); statSet->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); statSet->setAttributeAndModes(fog.get(),osg::StateAttribute::ON); osg::PagedLOD *plod = new osg::PagedLOD(); plod->setName(str); plod->setRangeMode(osg::PagedLOD::DISTANCE_FROM_EYE_POINT); plod->setFileName(0, str); plod->setPriorityOffset(0, 1.f); plod->setPriorityScale(0, 1.f); plod->setRange(0, 50.f, 100.f); plod->setStateSet(statSet); group->addChild(plod); }else if(strstr(str,"bluemarble.ive")==0) //for specifically adding virtual earth group->addChild(osgDB::readNodeFile(str)); } fin.close(); osgViewer::Viewer viewer; osgUtil::Optimizer optimzer; optimzer.optimize(group.get()); viewer.setSceneData(group.get()); viewer.addEventHandler( new osgGA::StateSetManipulator(viewer.getCamera()->getOrCreateStateSet()) ); viewer.addEventHandler(new osgViewer::ThreadingHandler); viewer.setCameraManipulator(new osgGA::TerrainManipulator()); viewer.realize(); while(!viewer.done()){ viewer.frame(); } Let me explain the problem, I am trying to load around 8000-9000 osg terrain models which are covering part of india. As I have set the PagedLOD range 50-100, when I enter the range(zooming-down thru virtual earth), all the terrain models start loading and from that range onwards I am not able to zoom-down freely. It becomes very slow and the view also jerks. Please correct me. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=10589#10589 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Jerky display?
Hi Akilan, Please carify now there's an expression I could through right back at your. What hardware/OS are you using? What type of viewer set up do you have? What OSG version? How did you build the databases? Do you have sync enabled? What exactly do you mean by "Jerky", are we talking dropped frames? Basically nobody has a chance to guess at what might be wrong until you provide some more info about your particular setup. Robert. On Tue, Apr 21, 2009 at 9:35 AM, Akilan wrote: > Hi, > > I created a simple scene graph as shown below, > > osg::ref_ptr grp=new osg::Group; > for(i=1;i<=n_models;i++) > { > osg::ref_ptr plod=new osg::PagedLOD; > plod->setFile(argv[i]); > plod->setRangeMode(...DISTANCE FROM EYE...); > plod->setRange(0,50.f,100.f); > grp->addChild(plod.get()); > } > In this same fashion I am adding more number of terrain models(on virtual > earth) lying close to each other. The problem here is that If I zoom down to > the range , I am getting jerky display even though I have used pagedLOD. > Please clarify me. > > Thank you. > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=10494#10494 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org