[osg-users] Questions about OSG

16 views
Skip to first unread message

maik klein

unread,
Apr 21, 2013, 1:09:59 PM4/21/13
to osg-...@lists.openscenegraph.org
I am studying computer graphics at my university and I have a few questions about OSG.

Does OSG use the core profile?

Are scenegraphs in general suited for games? Yesterday my professor said that scenegraphs are too expensive for games. (because of many state changes) Unfortunately he didn't mention an alternative. I also couldn't find any information about this topic. I only know that Ogre3d is using an scenegraph too. I also saw that there are many different implementations of scenegraphs, like BSP octree etc.

Is OSG suited for a game engine?

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=53714#53714





_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Paul Martz

unread,
Apr 22, 2013, 4:22:32 PM4/22/13
to osg-users
Core profile requires use of vertex array objects, and currently OSG doesn't support VAO. As a result, OSG can't currently use core profile. This may change in the future, when someone submits a patch that adds VAO support.
--
Paul Martz
Skew Matrix Software LLC

Sergey Kurdakov

unread,
Apr 22, 2013, 5:24:37 PM4/22/13
to OpenSceneGraph Users
Hi Mike,

in respect to vao you might look at this thread http://forum.openscenegraph.org/viewtopic.php?t=10001 with initial attempt to add it.

with this you get a core profile,


>Are scenegraphs in general suited for games?

yes, not all games use scenegraphs but most I know - do.


>scenegraphs are too expensive for games.

it depends,  but due to extensive use, scenegraphs like OSG are quite optimized  for minimizing state changes, and thus there are games on smartphones and PCs which are based on OSG.


>I only know that Ogre3d is using an scenegraph too.

that is correct, and Ogre3d is used in many games. the difference is though with OSG - that Ogre3d rendering pipeline is not thread safe, so only one core is used for all graphics operations ( while OSG can use one or more threads),  Ogre3d is just somehow more popular among those who develops games, because it has additional features which are useful when developing games, but OSG is more powerful in respect to rendering flexibility


>I also saw that there are many different implementations of scenegraphs, like BSP octree etc.

OSG is not about octree of BSP thought there are use samples see "OpenSceneGraph 3 Cookbook" for octree and also
there are examples for BSP use in osgBullet and Delta3D which are related to OSG. Also  OSG has KdTree implementation

You might want to look at http://www.packtpub.com/openscenegraph-3-0-beginners-guide/book?tag=ns/openscene-abr4/0211 book to get more details.

as for 'non' scene graph games  - in fact almost all are using rendering library of some sort, it is just that they could be less general than proper scenegraph to make some features to run faster, but I'm not a specialist in non scene graphs games, so could not elaborate on it much.



Regards
Sergey

Jan Ciger

unread,
Apr 22, 2013, 6:00:51 PM4/22/13
to OpenSceneGraph Users
On 04/22/2013 11:24 PM, Sergey Kurdakov wrote:
> >scenegraphs are too expensive for games.
>
> it depends, but due to extensive use, scenegraphs like OSG are quite
> optimized for minimizing state changes, and thus there are games on
> smartphones and PCs which are based on OSG.

The "scene graphs are too expensive for games" is one of the urban
legend "wisdoms", unfortunately. This was true maybe back in the 90's
when scene graph meant Performer or something VRML ... The paradox is
that most game developers that refuse to use scene graphs end up
reinventing them in their own code at some point. Or the
middleware/engine they are using does it for them.

>
> >I only know that Ogre3d is using an scenegraph too.
>
> that is correct, and Ogre3d is used in many games. the difference is
> though with OSG - that Ogre3d rendering pipeline is not thread safe, so
> only one core is used for all graphics operations ( while OSG can use
> one or more threads), Ogre3d is just somehow more popular among those
> who develops games, because it has additional features which are useful
> when developing games, but OSG is more powerful in respect to rendering
> flexibility

Also if you need/want OpenGL, forget Ogre3D. The OpenGL renderer in Ogre
is horrid (put nicely). I did profile it (we are using Ogre3D at work
too) and it is basically wasting 90% of frame time doing state changes
that are redundant and have no effect - reloading and rebinding textures
and shaders, recreating display lists for no reason, duplicating
textures, etc. It is a very naively written renderer. The Direct3D one
is better, it shows that the developers were more interested in that API.

Also the OSG API is much cleaner and more orthogonal than what is in
Ogre3D, but I guess that is a personal opinion.

>
> >I also saw that there are many different implementations of
> scenegraphs, like BSP octree etc.
>
> OSG is not about octree of BSP thought there are use samples see
> /"OpenSceneGraph/ 3 Cookbook" for octree and also
> there are examples for BSP use in osgBullet and Delta3D which are
> related to OSG. Also OSG has KdTree implementation

BSP and octree are actually data structures, not scene graphs. Scene
graph can use those, but doesn't have to - there are different ways to
organize things and optimize traversals and culling.

Regards,

Jan

Terry Welsh

unread,
Apr 22, 2013, 6:47:43 PM4/22/13
to osg-...@lists.openscenegraph.org
OSG works fine for my game so far: http://www.reallyslick.com/retrobooster/ I'm making heavy use of model loading, textures, shaders, nodemasks, render bins, and deriving Drawables. The linear math classes are very useful outside of the scenegraph as well. The only serious rendering task I'm not using OSG for is particles. OSG has osgParticles, but I haven't looked at it for a few years. It might have more of what I require now.

I'm also using SDL and SDL_mixer. Together with OSG, these libraries reliably provide most of the heavy lifting of other game engines.
--
Terry Welsh
www.reallyslick.com

Robert Osfield

unread,
Apr 23, 2013, 4:58:33 AM4/23/13
to OpenSceneGraph Users
Hi Maik,


On 21 April 2013 18:09, maik klein <maik...@googlemail.com> wrote:
Are scenegraphs in general suited for games? Yesterday my professor said that scenegraphs are too expensive for games. (because of many state changes)
 
Your professor is rather out of touch.  One of the key points about using a good scene graph is that is sorts on state and has lazy state updating to specifically avoid state changes.  The OSG has been sorting and state and using lazy state updating for over a decade.

Robert.
Reply all
Reply to author
Forward
0 new messages