[osg-users] OSG Performance Issues

Robert Osfield robert.osfield at gmail.com
Sat Oct 27 02:55:37 PDT 2007


HI big is test_load_resolution? 10, 20, 100, 1000, 10000??

BTW, this isn't an OSG Performance issue, this is your code performance issue.

On 10/26/07, Shawn Cook <sfncook at hotmail.com> wrote:
>
>  Hi, I'm back to whine about my performance issues in OpenSceneGraph.  Look
> at this main loop:
>
>  while( !viewer.done() && !timeToDie)
>  {
>  //*** SLOW CODE ***
>  osg::Vec3Array *vecs = dynamic_cast<osg::Vec3Array*>
> (geom->getVertexArray());
>  if( vecs ) {
>  for(int i=0; i<test_load_resolution; i++ ){
>  for(int j=0; j<test_load_resolution; j++ ) {
>  float left = unit_size*i;
>  float right = unit_size*(i+1);
>  float bottom = unit_size*j;
>  float top = unit_size*(j+1);
>  int quadIndex = (i*4*test_load_resolution) + (j*4);
>  vecs->at(quadIndex+0).set(left, bottom, 0.0);
>  vecs->at(quadIndex+1).set(right, bottom, 0.0);
>  vecs->at(quadIndex+2).set(right, top, 0.0);
>  vecs->at(quadIndex+3).set(left, top, 0.0);
>  }
>  }
>  }
>  //^^^ SLOW CODE ^^^^
>  viewer.sync();
>  viewer.update();
>  viewer.frame();
>  }
>
>  When I comment out "SLOW CODE" my framerate is a few hundred frames a
> second.  But when I uncomment "SLOW CODE" my frame rate won't go above
> 20fps.  I need dynamic vertices in my application - how do I acheive this
> with OpenSceneGraph?
>
>  Thanks folks!
>
>  -Shawn
>
> ________________________________
> Windows Live Hotmail and Microsoft Office Outlook – together at last. Get it
> now!
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>



More information about the osg-users mailing list