On 05/06/2012 02:38 AM, Pete Black wrote:
> How suitable will OpenSceneGraph be for this kind of task? - i would have up to 5 million triangles visible at once (though a large number of these will be overdrawn) , and this dataset could be split into arbitrary-sized chunks, to optimise batch size. The triangles are textured with a single 'atlas' texture, and the vertices are specified in their final global coordinate locations, so no transforms are needed for each chunk. I pretty much have CPU to burn for state-sorting and culling.
I'd say it would at least be worth a look. If you organize your scene
into an octree, you could minimize the section of the scene hierarchy
that would change from frame to frame, which would keep update and cull
traversals manageable.
> Basically, does OSG have features for:
>
> a) updating OpenGL buffers/arrays in a separate thread
Yes, although I'm not sure how well your particular use case will work
here. OSG requires you to specify which sections of the scene are
dynamic and which are static. The Update/Cull thread(s) then traverse
the dynamic objects in the scene while the Draw thread waits. Once all
the dynamic objects have been traversed, the Draw thread begins doing
its work.
In your case, you'll probably be marking almost all of the scene
dynamic, so I'm not sure how much speedup you'll get from the
multithreading.
> b) optimised rendering by eliminating unnecessary state changes, compared to something like Ogre3d
Yes. This is historically where OSG gets most of its speedup. OSG
employs state sorting and lazy state updating in the draw dispatch. I'm
guessing that with something like MineCraft, you'll have a lot of
geometry, but a relatively small number of state sets. OSG would be
perfect for this.
--"J"