Hi David,

There are a range of issues relating to management of large scenes, as
you indicate your new the OSG and rendering I would suggest spending
some time just exploring and learning before diving into a specific
solution.

First area I'd suggest you look into is database paging.  The OSG has
great support for multi-threaded, loaded balanced database paging.
Database paging allows OSG applications to scale to handle
multi-terrabyte whole earth databases.  The only limit to how much
disk space you can throw at it.  The Database paging is designed to
load, merge and delete subgraphs all without dropping a frame.

As a developer you won't need to worry too much about the internal
details of the DatabasePager that does all the paging, you'll just
need to create a database with PageLOD nodes in them.  The
VitualPlanetBuilder is an offline tool that generates such databases
for you, and the osgEarth 3rd party NodeKit provide similar paged
database but dynamically generates the nodes required.  Lots has been
discussed about these tools on the list, and even if neither are
suitable for your specific needs what you learn will be really handy.

Another area I'd recommend looking into is the area of OpenGL fast
paths.  You mean NormalIndices and this jumped out as my as a
potential problem area, use of vertices indices will lead to the OSG
dispatching data to OpenGL uses slow paths as OpenGL has no support
for the per vertex array indices.  It's far far better to use
DrawElementUShort for indexed data instead.  The include/osg/Geometry
mentions the problem with Normal/ColorIndices, but for now they are
kept around for backwards compatibility.  Again lots has been
discussed about this issue on osg-users mailing list/forum so I'd
recommend having a search through the archives.

Good luck with your project,
Robert.



On Sun, Nov 21, 2010 at 12:01 PM, David Wilson <[email protected]> wrote:
> Hi everyone,
>
> I'm working on a game engine using OSG in which I can load very large game 
> worlds and have it run at a high framerate.
>
> My game world is made up of cubes, and I am building vertex arrays for each 
> "cell" in the level - each cell is 64x64x64 blocks in size.
>
> Now I would like to be able to add and remove blocks in-game with minimal 
> impact on my framerate.
> At the moment I am doing this by destroying the cell's geometry and 
> recreating it again - adding it back into the scenegraph using 
> setVertexArray() (and setNormalArray, setNormalIndices, etc.)
>
> This is quite a horrendous operation but remarkably it only takes about 100ms 
> or so. Still, my framerate takes a very noticeable hit when this occurs.
>
> How would I best modify my vertex/face/etc. arrays on the fly without the dip 
> in framerate? Should I be looking to farm this operation out to another 
> thread? Is there a way to add and remove vertex data from my arrays so that I 
> do not have to push such a large chunk of data to the video card each time 
> this happens?
>
> Apologies if my terminology isn't correct - I'm still learning how OSG (and 
> graphics rendering in general) works!
>
> And thanks to all who have put so much work into OSG, I hope to make an F1 
> racer of a game engine with it someday!
>
> Cheers,
> David Wilson
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=33898#33898
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to