Hello,

I am surprised about my little test program. I would like compare displaylists 
with frame buffer objects. Because, I suppose that the displaylists have to be 
faster than the vbo, because the displaylists are precompiled. But in my 
example I get another result:

VBO: 225 FPS
DL: 88 FPS

Is that possible?

Following a part of my code:
--------------------------------

// Geometry (Grid-Plane)
::osg::Geometry* geom = new osg::Geometry;
        
// Vertex Array (Grid with 1000 x 1000 quads)
::osg::ref_ptr< ::osg::Vec3Array > v = new ::osg::Vec3Array();
for(unsigned int x=0; x < 1000; x++)
{
  for(unsigned int y=0; y < 1000; y++)
  {
   // create points
  }
}
geom->setVertexArray(v);
        
#ifdef ENABLE_VBO
  // Vertex Buffer Object
  osg::VertexBufferObject* vbo = geom->getOrCreateVertexBufferObject();
  vbo->setArray(0,v);
  vbo->setUsage(GL_STATIC_DRAW);
  geom->setUseVertexBufferObjects(true);
  geom->setSupportsDisplayList(false);
  geom->setUseDisplayList(false);
#else
  geom->setSupportsDisplayList(true);
  geom->setUseDisplayList(true);
#endif

// Primitive
::osg::DrawArrays* da = new 
::osg::DrawArrays(::osg::PrimitiveSet::QUADS,0,v->size());
geom->addPrimitiveSet(da);

// Geometry Node
::osg::Geode* geode = new osg::Geode;
geode->addDrawable(geom);

----------------------------------------

Thanks

Martin
-- 
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to