| 1 | <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> |
|---|
| 2 | <html> |
|---|
| 3 | <head> |
|---|
| 4 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
|---|
| 5 | <meta name="GENERATOR" content="Mozilla/4.77 [en] (X11; U; Linux 2.4.3-20mdk i686) [Netscape]"> |
|---|
| 6 | <title>Introduction to the OpenSceneGraph</title> |
|---|
| 7 | </head> |
|---|
| 8 | <body bgcolor="#FFFFFF"> |
|---|
| 9 | <img SRC="images/OpenSceneGraphBanner_Distribution.jpg" BORDER=0> |
|---|
| 10 | <table> |
|---|
| 11 | <tr> |
|---|
| 12 | <td><a href="index.html">Index</a></td> |
|---|
| 13 | |
|---|
| 14 | <td><a href="introduction.html">Introduction</a></td> |
|---|
| 15 | |
|---|
| 16 | <td><a href="contents.html">Contents</a></td> |
|---|
| 17 | |
|---|
| 18 | <td><a href="install.html">Install</a></td> |
|---|
| 19 | |
|---|
| 20 | <td><a href="dependencies.html">Dependencies</a></td> |
|---|
| 21 | |
|---|
| 22 | <td><a href="examples.html">examples</a></td> |
|---|
| 23 | |
|---|
| 24 | <td><a href="data.html">Data</a></td> |
|---|
| 25 | |
|---|
| 26 | <td><a href="osgviewer.html">Viewer</a></td> |
|---|
| 27 | |
|---|
| 28 | <td><a href="stereo.html">Stereo</a></td> |
|---|
| 29 | |
|---|
| 30 | <td><a href="plan.html">Plan</a></td> |
|---|
| 31 | |
|---|
| 32 | <td><a href="documentation.html">Reference Guides</a></td> |
|---|
| 33 | </tr> |
|---|
| 34 | </table> |
|---|
| 35 | |
|---|
| 36 | <h2> |
|---|
| 37 | <u>Introduction to the OpenSceneGraph</u></h2> |
|---|
| 38 | Welcome to OpenSceneGraph project! |
|---|
| 39 | <p>The OpenSceneGraph is an Open Source <a href="../LICENSE.txt">(OSGPL)</a>, Cross Platform (Windows, |
|---|
| 40 | Linux, Mac OSX, FreeBSD, Irix, Solaris and HP-UX), Standard C++ and OpenGL based |
|---|
| 41 | graphics development library. Uses range from visual simulation, games, |
|---|
| 42 | virtual reality, scientific visualization and graphics research. This page |
|---|
| 43 | introduces what scene graphs are, why graphics developers use them, and |
|---|
| 44 | details about the OpenSceneGraph project, how to learn how to use it and |
|---|
| 45 | contribute to the OpenSceneGraph community. |
|---|
| 46 | <p><i>Robert Osfield, Project Lead. July 2002.</i> |
|---|
| 47 | <br> |
|---|
| 48 | <hr> |
|---|
| 49 | <h3> |
|---|
| 50 | <u>What is a Scene Graph?</u></h3> |
|---|
| 51 | Its a tree! Quite simply one the best and most reusable data structures |
|---|
| 52 | invented. Typically drawn schematically with the root at the top, leaves at the |
|---|
| 53 | bottom. It all starts with a top-most root node which encompasses your whole |
|---|
| 54 | virtual world, be it 2D or 3D. The world is then broken down into a hierarchy |
|---|
| 55 | of nodes representing either spatial groupings of objects, settings of the |
|---|
| 56 | position of objects, animations of objects, or definitions of logical relationships |
|---|
| 57 | between objects such as those to manage the various states of a traffic light. |
|---|
| 58 | The leaves of the graph represent the physical objects themselves, the |
|---|
| 59 | drawable geometry and their material properties. |
|---|
| 60 | <p>A scene graph isn't a complete game or simulation engine, although it may |
|---|
| 61 | be one of the main components of such an engine; it's primary focus is |
|---|
| 62 | representation of your 3d worlds, and efficient rendering thereof. Physics models, |
|---|
| 63 | collision detection and audio are left to other development libraries that |
|---|
| 64 | a user will integrate with. The fact that scene graphs don't typically |
|---|
| 65 | integrate all these features is actually a really good thing: it aids interoprability |
|---|
| 66 | with clients' own applications and tools and allows them to serve many varied |
|---|
| 67 | markets from games, visual simulation, virtual reality, |
|---|
| 68 | scientific and commercial visualization, training through to modeling programs. |
|---|
| 69 | <br> |
|---|
| 70 | <hr> |
|---|
| 71 | <h3> |
|---|
| 72 | <u>Why use a Scene Graph - Performance, Productivity, Portability and Scalability</u>.</h3> |
|---|
| 73 | |
|---|
| 74 | <ol><b><i>Performance</i></b> - scene graphs provide an excellent framework for |
|---|
| 75 | maximizing graphics performance. A good scene graph employs two key techniques |
|---|
| 76 | - culling of the objects that won't be seen on screen, and state sorting |
|---|
| 77 | of properties such as textures and materials, so that all similar objects |
|---|
| 78 | are drawn together. Without culling the CPU, buses and GPU will all become |
|---|
| 79 | swamped by many times the amount of data than they actually require to |
|---|
| 80 | represent your work accurately. The hierarchical structure of the scene |
|---|
| 81 | graph makes this culling process very efficient with whole town being culled |
|---|
| 82 | with just a few operations! Without state sorting, the the buses and GPU |
|---|
| 83 | will thrash between states, stalling the graphics pipeline and destroying graphics |
|---|
| 84 | througput. As GPU's get faster and faster, the cost of stalling the graphics |
|---|
| 85 | is also going up, so scene graphs are becoming ever more important. |
|---|
| 86 | <p><b><i>Productivity</i></b> - scene graphs take away much of the hard work required |
|---|
| 87 | to develop high performance graphics applications. The scene graph manages |
|---|
| 88 | all the graphics for you, reducing what would be thousands of lines of |
|---|
| 89 | OpenGL down to a few simple calls. Furthermore, one of most powerful concepts |
|---|
| 90 | in Object Oriented programming is that of object composition, enshrined |
|---|
| 91 | in the <i>Composite Design Pattern</i>, which fits the scene graph tree structure |
|---|
| 92 | perfectly and makes it a highly flexible and reusable design - in real |
|---|
| 93 | terms this means that it can be easily adapted to solve your problems. |
|---|
| 94 | With scene graphs often also come additional utility libraries which range from |
|---|
| 95 | helping users set up and manage graphics windows to importing of 3d models |
|---|
| 96 | and images. All this together allows the user to achieve a great deal with |
|---|
| 97 | very little coding. A dozen lines of code can be enough to load your data |
|---|
| 98 | and create an interactive viewer! |
|---|
| 99 | <p><b><i>Portability</i></b> - scene graphs encapsulate much of the lower level |
|---|
| 100 | tasks of rendering graphics and reading and writing data, reducing or even |
|---|
| 101 | eradicating the platform specific coding that you require in your own application. |
|---|
| 102 | If the underlying scene graph is portable then moving from platform to |
|---|
| 103 | platform can be as simple as recompiling your source code. |
|---|
| 104 | <p><b><i>Scalability</i></b> - along with being able to dynamic manage the complexity |
|---|
| 105 | of scenes automatically to account for differences in graphics performance |
|---|
| 106 | across a range of machines, scene graphs also make it much easier to manage |
|---|
| 107 | complex hardware configurations, such as clusters of graphics machines, |
|---|
| 108 | or multiprocessor/multipipe systems such as SGI's Onyx. A good scene graph |
|---|
| 109 | will allow the developer to concentrate on developing their own application |
|---|
| 110 | while the rendering framework of the scene graph handles the different |
|---|
| 111 | underlying hardware configurations.</ol> |
|---|
| 112 | |
|---|
| 113 | <hr> |
|---|
| 114 | <h3> |
|---|
| 115 | <u>So what about the OpenSceneGraph project?</u></h3> |
|---|
| 116 | The OpenSceneGraph is an Open Source Scene Graph, and our goal is make |
|---|
| 117 | the benefits of scene graph technology available to all. Our scene graph |
|---|
| 118 | is still in development, but has already gained a great deal of respect |
|---|
| 119 | amongst the development community for its high performance, cleanness of |
|---|
| 120 | design and portability. Written entirely in Standard C++ and OpenGL, it |
|---|
| 121 | makes full use of the STL and Design Patterns, and leverages the open source |
|---|
| 122 | development model to provide a development library that is legacy free |
|---|
| 123 | and well focused on the solving the task. The OpenSceneGraph delivers on |
|---|
| 124 | the four key benefits of scene graph technology outlined above using the |
|---|
| 125 | following features: |
|---|
| 126 | <ol><b><i>Performance</i></b> - supports view frustum culling, occlusion culling, small feature culling, |
|---|
| 127 | Level Of Detail (LOD) nodes, state sorting, vertex arrays and display |
|---|
| 128 | lists as part of the core scene graph. These together make the OpenSceneGraph |
|---|
| 129 | one of the highest performance scene graph available. User feedback is that |
|---|
| 130 | performance surpasses that of much more established scene graphs such as Performer, VTree, Vega |
|---|
| 131 | Scene Graph and Java3D! The OpenSceneGraph also supports easy customization |
|---|
| 132 | of the drawing process, which has allowed implementation of Continuous Level |
|---|
| 133 | of Detail (CLOD) meshes on top the scene graph. These allow the visualization |
|---|
| 134 | of massive terrain databases interactively, examples of this approach can |
|---|
| 135 | be found at Vterrain.org and TerrainEngine.com, both of which integrate |
|---|
| 136 | with the OpenSceneGraph. |
|---|
| 137 | <p><b><i>Productivity</i></b> - by combining lessons learned from established |
|---|
| 138 | scene graphs like Performer and Open Inventor, with modern software engineering |
|---|
| 139 | boosts like Design Patterns, along with a great deal of feedback early on |
|---|
| 140 | in the development cycle, it has been possible to design a library that is |
|---|
| 141 | clean and highly interpretable. This has made it easy for users to adopt |
|---|
| 142 | to the OpenSceneGraph and to integrate it with their own applications. With |
|---|
| 143 | a full feature set in the core scene graph, utilities to set up the scene |
|---|
| 144 | graph and viewers and a wide range of loaders it is possible to create |
|---|
| 145 | an application and bring in user data with a very small amount of code. |
|---|
| 146 | <p><b><i>Portability</i></b> - The core scene graph has also been designed to |
|---|
| 147 | have minimal dependency on any specific platform, requiring little more than |
|---|
| 148 | Standard C++ and OpenGL. This has allowed the scene graph to be rapidly |
|---|
| 149 | ported to a wide range of platforms - originally developed on IRIX, then |
|---|
| 150 | ported to Linux, then to Windows, then FreeBSD, Mac OSX, Solaris, HP-UX and |
|---|
| 151 | even a report of successful porting to PlayStation2! |
|---|
| 152 | <p> |
|---|
| 153 | The core scene graph library being completely windowing system independent makes |
|---|
| 154 | it easy for users to add their own window-specific libraries and applications on top. |
|---|
| 155 | In the distribution there is already the osgProducer library which integrates with <a href="http://www.andesengineering.com/Producer/">OpenProducer</a>, and in the Bazaar |
|---|
| 156 | found at openscenegrph.org/download/ one can find examples of applications |
|---|
| 157 | written on top of Qt, MFC, WxWindows and SDL. Users have also integrated it |
|---|
| 158 | with Motif, and X. |
|---|
| 159 | <p><b><i>Scalability</i></b> - the scene graph will not only run on portables all |
|---|
| 160 | the way up to Onyx Infinite Reality Monsters, it supports the multiple |
|---|
| 161 | graphics subsystems found on machines like a mulitpipe Onyx. This is |
|---|
| 162 | possible because the core scene graph supports multiple graphics contexts |
|---|
| 163 | for both OpenGL Display Lists and texture objects, and the cull and draw |
|---|
| 164 | traversals have been designed to cache rendering data locally and use the |
|---|
| 165 | scene graph almost entirely as a read-only operation. This allows multiple |
|---|
| 166 | cull-draw pairs to run on multiple CPU's which are bound to multiple graphics |
|---|
| 167 | subsystems. Support for multiple graphic context and multi-threading is all |
|---|
| 168 | available out of the box via osgProducer - all the examples in the distribution |
|---|
| 169 | can run multi-pipe just by use a simple configuation file.</ol> |
|---|
| 170 | |
|---|
| 171 | All the source to the OSG is published under the Open Scene Graph Public License |
|---|
| 172 | (a relaxed version on the LGPL) which allows both open source and closed source projects to use, |
|---|
| 173 | modify and distribute it freely as long its usage complies with the OSGPL. |
|---|
| 174 | The project has been developed over the last four years, initiated by Don |
|---|
| 175 | Burns, and then taken over by Robert Osfield who continues to lead the project |
|---|
| 176 | today. There are many other contributors to the library, for a full list |
|---|
| 177 | check out the AUTHORS file. Both Robert and Don now work on the OpenSceneGraph |
|---|
| 178 | in a professional capacity providing consultancy and bespoke development |
|---|
| 179 | on top the library, and are also collaborating on the book. Work on the |
|---|
| 180 | core scene graph and support of public mailing list remains unpaid as are |
|---|
| 181 | the contributions of the rest of the community, but this hasn't impacted |
|---|
| 182 | the quality of the source or support which once you get stuck in you grow |
|---|
| 183 | to appreciate. |
|---|
| 184 | <p>The project is currently in beta, which means the main core features are now in |
|---|
| 185 | place, with a 1.0 release in second half of 2003. Despite the beta development status, |
|---|
| 186 | the project has already earned the reputation as the leading open source scene |
|---|
| 187 | graph, and is establishing itself as a viable alternative to the commercial |
|---|
| 188 | scene graphs. Numerous companies, university researchers and graphics enthusiasts |
|---|
| 189 | have already adopted the OpenSceneGraph for their projects, all over the world. |
|---|
| 190 | <br> |
|---|
| 191 | <hr> |
|---|
| 192 | <h3> |
|---|
| 193 | <u>Getting started</u></h3> |
|---|
| 194 | The first thing is to select the distribution which suits you, there are |
|---|
| 195 | binary, development and source code distributions, these can be loaded |
|---|
| 196 | from the |
|---|
| 197 | <a href="http://www.openscenegraph.org/download">http://www.openscenegraph.org/download</a> |
|---|
| 198 | page. The latest developments area available as via a nightly tarball or |
|---|
| 199 | via cvs. |
|---|
| 200 | <p>The binary distribution contains just the libraries (.dll's /.so's) |
|---|
| 201 | and demo executables. This is suitable for using the OpenSceneGraph with |
|---|
| 202 | an application that has already been compiled but depends at runtime on |
|---|
| 203 | the OpenSceneGraph. |
|---|
| 204 | <p>The development distribution contains the libraries (.dll's /.so's), |
|---|
| 205 | demo executables, include files, and source to the demos. This is suitable |
|---|
| 206 | for using the developers using the OpenSceneGraph. |
|---|
| 207 | <p>The source distribution contains all the source and include files |
|---|
| 208 | required to build the OpenSceneGraph from scratch, and is ideal if you |
|---|
| 209 | want to learn more about how the scene graph works, how to extend it, and |
|---|
| 210 | to track down and fix any problems that you come across. |
|---|
| 211 | <p>If you are using a source distribution then read the <a href="install.html">installation</a> |
|---|
| 212 | instructions for how to get the OpenSceneGraph compiling and installed |
|---|
| 213 | on your system. You may also need to download libraries that parts of the |
|---|
| 214 | OpenSceneGraph depend upon, such as Producer. Check the <a href="dependencies.html">dependencies</a> |
|---|
| 215 | list for further details. |
|---|
| 216 | <p>For full instructions of how to run the examples read the <a href="examples.html">examples</a> |
|---|
| 217 | page. |
|---|
| 218 | <br> |
|---|
| 219 | <hr> |
|---|
| 220 | <h3> |
|---|
| 221 | <u>Learning how to use the OpenSceneGraph</u></h3> |
|---|
| 222 | The OpenSceneGraph distribution comes with a reference guide for each of |
|---|
| 223 | the component libraries - osg, osgDB, osgUtil, osgText, osgSim, osgParticle and osgProducer, a set |
|---|
| 224 | of examples - the source of which can be found in examples. For questions |
|---|
| 225 | or help which can't be easily be answered by the reference guide and demo |
|---|
| 226 | source, one should join the mailing list (details below). There are also |
|---|
| 227 | the beginnings of a <a href="http://www.c2.com/cgi/wiki?OpenSceneGraphFaq">Wiki |
|---|
| 228 | based FAQ</a> which may help answer a few of the common queries. |
|---|
| 229 | <p>A programming guide will be available in form of a OpenSceneGraph book |
|---|
| 230 | which is being written by Don Burns and Robert Osfield, parts of it will |
|---|
| 231 | be available online. |
|---|
| 232 | <p>Although not directly related to the OpenSceneGraph, once can learn |
|---|
| 233 | about scene graph technology from such sources as the <a href="http://www.sgi.com/software/inventor/manuals.html">Open |
|---|
| 234 | Inventor Mentor</a>, and <a href="http://www.cineca.it/manuali/Performer/ProgGuide24/html">Performer |
|---|
| 235 | Programming Guides</a>. The latter is the closer in design to |
|---|
| 236 | the OpenSceneGraph, although the Performer manuals are in C, alas. Also of use |
|---|
| 237 | as a background to some of the techniques used is a SIGGRAPH <a href="http://www.opengl.org/developers/code/sig99/advanced99/course_slides/vissim/index.htm">Vis-Sim |
|---|
| 238 | course</a>. |
|---|
| 239 | <p>The OpenSceneGraph uses OpenGL and does so with a deliberately thin layer, |
|---|
| 240 | making it easy to control the underlying OpenGL and to extend it with OpenGL |
|---|
| 241 | extensions. The close tie with OpenGL is also reflected in the naming of |
|---|
| 242 | many of the OpenGL state related classes, and the parameters that they |
|---|
| 243 | encapsulate, which means that knowledge of OpenGL itself will go a long way |
|---|
| 244 | to understanding how to get the best out of the OpenSceneGraph. To this |
|---|
| 245 | end it is worth obtaining a copy of the OpenGL programming guide - <a href="http://fly.cc.fer.hr/~unreal/theredbook/">`Red |
|---|
| 246 | Book`</a> and OpenGL reference guide 'Blue Book'. The main <a href="http://www.opengl.org">OpenGL |
|---|
| 247 | website</a> is also a good source of links and further information. |
|---|
| 248 | <br> |
|---|
| 249 | <hr> |
|---|
| 250 | <h3> |
|---|
| 251 | <u>Support and discussion - the <i>openscenegraph-news</i> mailing list</u></h3> |
|---|
| 252 | For scene graph related questions, bug reports, bug fixes, and general |
|---|
| 253 | design and development discussion one should join the <a href="http://lists.sourceforge.net/mailman/listinfo/openscenegraph-news">openscenegraph-news</a> |
|---|
| 254 | mailing list, and check the the mailing list <a href="http://www.geocrawler.com/redir-sf.php3?list=openscenegraph-news">archives</a>. |
|---|
| 255 | <p>Professional support is also available in the form of confidential online, |
|---|
| 256 | phone and onsite support and consultancy, for details contact Robert Osfield |
|---|
| 257 | at <a href="mailto:robert@openscenegraph.com">robert@openscenegraph.com</a>. |
|---|
| 258 | </body> |
|---|
| 259 | </html> |
|---|