Hi all, First of all, thanks to the folks who built this library.
I'm building a 3D game engine based on osg::CompositeViewer featuring rather larger worlds built using cubes. I've attached an image of what I'm trying to create. I was using ShapeDrawable for the blocks until I read I would get faster rendering by building the geometry myself using vertex arrays. I've implemented something like an octree to create a balanced tree upon level load. The nodes of the tree are Group objects and the leaves are Geode objects with multiple Geometry objects attached (the faces of each block.) Empty "cells" are culled. The minimum cell size for the octree division is 2x2x2 (so a leaf node can contain up to 8 blocks). The octree doesn't seem to have given me much of a performance boost in the culling department. I am guessing this is because the leaves of the tree contain so many geometry objects? I've had a read of the forum and google and have come to the conclusion I should do something like the following to improve performance: 1. Group up my geometry objects to perform "batch rendering" - i.e. render more than a single face of a single block in one go. How can I do this? Do I need to create a single geometry object containing vertex arrays etc of a whole chunk of block faces? 2. Re-use a single geometry object for block faces. Apparently there is code in osgParticle::PrecipitationEffect which does this - although I haven't checked it out yet. 3. "Instanced rendering" I'm not sure quite what this is about, but is what osg::Impostor does? I just had a look at osgimpostor.exe for the first time while writing this, and it seems pretty close to what I want to achieve. Anyway I've kinda answered some of my own questions in writing this, but I would be thankful for some clarification on the finer points. I'll be digging into osgimpostor now anyway. :D Cheers, David W ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=30514#30514 Attachments: http://forum.openscenegraph.org//files/deditor_156.png _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org