PrEV
Thoughts from a NeXTStep Guy on Cocoa Development

OpenGL and Scene Graph's

Jan 09, 2009 by Bill Dudney

I've spent the last few days investigating scene graph libraries. Not to use but to learn from. For those that have not used one or investigated them before a Scene Graph is a way to organize the elements in a 3D scene. They have various feature sets but the big picture is that you get to put the various elements (like the rocks, cars, guns etc) into this graph then manage them as discrete elements or groups of elements.

Some of the cool features are things like grouping a bunch of elements then applying a transform to the top of the group, everything in the group gets transformed. Some let you mark some elements as terrain (so it does not move) and others as active so they do move. Some even have the beginnings of a physics/collision library going. It is a very interesting space.

Here are the four I looked at;

Again I'm not looking to use one of these libraries but instead to learn OpenGL from them.

Open Screen Graph seems to be the most mature. Looks interesting but seems to mostly use immediate mode. I stopped looking when I found that (cause I'm really interested in learning VBO's). And apparently I did not look deeply enough. According to Eric (a heavy user) I need to check my facts. So ignore this statement

Open SG also looks good but seemed to be using immediate mode as well. Did not look much further after that. Ok so apparently clueless here too, I'll look some more.

Java 3D has a compile mode that looks like it pushes everything down to the graphics card via VBO's. Looks really interesting and has some deep looking features. Can't do Java on the iPhone though...

NVIDIA's NVSG looks really good, uses VBO's full feature set etc. API is C++ but its not open so I could not use it on the iPhone.

There are good things about each of them so I downloaded them all and looked at some of the source (where I could) and have learned a bit (like a real deep scene graph library is complex:). Given that what I really want to do is learn OpenGL I've decided to implement my own in ObjC. My plan is to build on the OBJ loader to create a scene graph from one or more OBJ files.

I'd love to hear any experiences with Screen Graphs and what your thoughts are on using this as a means to learn the depths of OpenGL.

Thanks Eric for straightening me out :) That is what I love about learning in public, you get people who actually know helping you out!



Comments:

Hi Bill, I have a couple of corrections for you.

So first, you got the terminology wrong. It is Scene Graph, not Screen Graph.

Second, if the OpenSceneGraph authors heard your claim about doing only immediate mode, they would give you a nasty tongue lashing :) OSG is designed for high performance OpenGL and is used as such. OpenSceneGraph does do Vertex Buffer Objects and Display Lists. See the class osg::VertexBufferObject and support methods in classes such as osg::Array and osg::Geometry.

The lead Robert Osfield really knows his stuff. If immediate was all he could do, everybody would have packed up long ago. Other OSG contributers/alumni include Don Burns (original creator/co-founder of OSG) who was a contributer at Keyhole which later got bought by Google for a product now known as Google Earth, Paul Martz author of books such as "OpenGL Distilled" and I think he may have been an/the author of the infamous OpenGL FAQ, and Bob Kuehne author of "OpenGL Programming on Mac OS X".

I don't know much about OpenSG, but I doubt very much they only do immediate mode. They are also about high performance. OpenSG and OSG were somewhat competitors initially (OSG unknowingly beat them to the domain name for openscenegraph by a matter of days or weeks I hear.) But I think Open SG's target audience has evolved to be slightly different than OSG's. I think OpenSG has put in a lot of effort into clustering.

Posted by Eric Wing on January 09, 2009 at 03:14 PM MST #

You might be interested to look into the following links (though most won't help you with OpenGL...):

- Oolong - a game engine / graphics engine for the iPhone: http://oolongengine.com/

- Why the typical notion of scene graph is bad (it tries to cram many things/aspects into one data-structure): http://home.comcast.net/~tom_forsyth/blog.wiki.html#%5B%5BScene%20Graphs%20-%20just%20say%20no%5D%5D

- Great info about modern base layers for graphics engines for games (they sort calls based on bit-field keys): http://realtimecollisiondetection.net/blog/?p=86

- Nice and very interesting articles about rendering engines (in particular for parallel rendering) by Nick Porcino: http://meshula.net/wordpress/?s=parallel+rendering

Cheers,
Bjoern

Posted by Bjoern on January 10, 2009 at 11:48 AM MST #

Hi Bjoern,

Thanks for the pointers! I'll make sure to check them out and repost after looking into them.

Posted by Bill Dudney on January 10, 2009 at 11:48 AM MST #

Hi Bill,

Thanks for all the great posts. They're always relevant and interesting.
You may also wish to look at libMini, an OpenGL terrain rendering library that compiles on OSX.

Oh, and there is no apostrophe needed in "Scene Graphs".

Cheers,
Dave

Posted by Dave Robertson on January 12, 2009 at 07:48 AM MST #

hi Dave,

Thanks for the kind words and help correcting my horrible grammar! :)

I'm currently on vacation but will look at libMini when I get back home.

Thanks again!

Posted by Bill Dudney on January 14, 2009 at 04:37 PM MST #

I need a game graphics engine for the iPhone -Oolong and the template for xcode. please email to me . thanks!!

Posted by yangxingjun on May 14, 2009 at 01:54 PM MDT #

As I understand it, there isn't much going on with Java3D anymore. If fact one Sun project, Project Wonderland, that used Java3D was supposedly going to switch to jMonkeyEngine.

http://en.wikipedia.org/wiki/Project_Wonderland#cite_note-0

Posted by Jim on August 25, 2009 at 01:52 PM MDT #

Post a Comment:
  • HTML Syntax: Allowed