DOC PREVIEW
CU-Boulder CSCI 5448 - OpenSceneGraph

This preview shows page 1-2-3-26-27-28 out of 28 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

OpenSceneGraphRyan Kroiss Object-Oriented Analysis and DesignCSCI 5448 - Spring 2011What is it?High-performance 3D graphics toolkitObject-oriented framework on top of OpenGL Open sourceCross platformBased on "scene graph" conceptWhat is a scene graph?Data structure used to describe a graphical sceneTypically a directed, acyclic graph (DAG)Nodes represent aspects of scene Leaf nodes represent geometry to be renderedNon-leaf nodes establish hierarchy and scene manipulations Figure 1: Scene graph for a scene with a truck on a road with one crate in the truck and another on the roadScene Graph in OSGFigure 2: OSG representation of scene graph in Figure 1Common Uses of OSGFlight simulators (Flightgear)Visualization (TerrainView)Virtual Reality (J3Tech - J3Reality)Games (Pok3D)Brief History1998: Started as hobby project by Don Burns1999Robert Osfield joined the teamCode became open source2000: Development gets serious2001: Don and Robert form separate companies for commercial support of OSG2002: Community involvement gets serious2003: Development focused on scalabilityFuture PlansMid-term goalsImprove shadow supportDevelop node kit for 3D GUIDevelop node kit for volume renderingSupport geometry shader Long-term goalsIntegrate OpenGL ESIntegrate OpenGL 3.0Getting started with OSGDownload hereObtain pre-reqs/dependenciesCMakeAppropriate compiler for your platformConfigure; make; make installExperiment with example applications Start coding!Important Classesosg::NodeNode in a scene graphImportant subclassesosg::Geodeosg::Grouposg::Drawable Actual rendered geometryNot a node in scene graph - must be attached to an osg::NodeImportant subclassesosg::Geometryosg::ShapeDrawableosgViewer::ViewerControls viewing of sceneBasic OSG ProgramFigure 3: OSG program to draw a cubeBasic OSG Program (2)Set up scene graphDefine root nodeDefine elements of scene graphMake shape drawableAttach drawable shape to graph nodeAdd graph node to scene graphGroups allow manipulation to cascadeScene graph can obviously be much more complexBasic OSG Program (3)Define the StateSet for this GroupHere, simply turn off lightingStateSets define the OpenGL state for a node when it is renderedTexturesCullingLightingetc.OSG can sort nodes at render time to minimize state switchingBasic OSG Program (4)Set up the view of the sceneSet the scene graph for the viewerSet the camera manipulatorSet up the windowsViewer holds a single view of a single sceneNote how easy it is to define a camera manipulator!Basic OSG Program (5)Turn control over to OSGViewer listens for signals to exit Figure 4: Output of program (boring, but only 20 lines of code)Basic OSG Program Summary~20 lines of C++ codeRender 3D object with one camera that can be manipulated via the mouseImportant conceptsScene graph structureStateSetsViewersCamera manipulation Barely scratching the surface of OSG's potential!FeaturesWritten in C++ and OpenGLUses Standard Template Library (STL) and Design PatternsAdvantages PerformanceProductivityData loadersNode kitsPortabilityScalabilityMulti-language supportDesign Patterns in OSGFigure 5: Design patterns in OSGDesign Patterns in OSG (2)If you don't know why design patterns are useful, then you haven't been paying attention in class!UML diagram of OSG Noteworthy patterns for OSG developersVisitor - traversal and rendering of scene graphObserver - notifications for groups of nodesDecorator - dynamically change behaviors of scene graphPerformanceCulling: view-frustum, occlusion, small featureDon't draw features that you can't seeVertex arraysReduce number of function callsLet OSG/OpenGL do the workLevel of Detail nodes Don't render detail when you don't need it OpenGL Shader LanguageHarness the parallelism of your GPU Display lists "Compile" complex, frequently used geometry for faster renderingData loadersSupports loading of graphical modelsExtensible plugin mechanism for new loadersSupported formatsCOLLADALightWaveWaveFrontDirectX3D Studio MAXand many more! Terrain loaders Figure 6: Model to load in OSGNode KitsLibraries that can be used with OSGAllows for more advanced graphicsosgParticle - particle systemsosgFX - special effectsosgShadow - shadows osgManipulator - 3D interactive controlosgAnimation - character animationand more... Possible usesSkeletal animationBump mapping - makes flat surfaces appear bumpyAnimate explosionsCommunity can develop node kits tooPortabilityOnly requires standard C++ and OpenGLPorted to many platformsLinuxWindowsMac OS Xeven Playstation 2Independent of windowing systemCan be used with Qt, Cocoa, GLUT, etc.ScalabilitySupports multiple graphics contextsUses mostly read-only operations to draw scene graphMulti-threadedEnables OSG to scale Mobile device -> Multi-core/multi-GPU -> clustersMulti-language supportBindings for various languagesPythonLuaJavaAvailable as community projectsDrawbacks to OSGLatest version of OpenGL not supported (yet)Restricts development to a particular data modelDebugging is difficult (as with graphics in general)Less fine-grained than using OpenGL aloneAssumes it's smarter than youOverrides your settings in certain situationsCustom keyboard bindings can be difficult to set upAlternatives to OSGOGRE (Object-Oriented Graphics Rendering Engine)Irrlicht EngineDelta3DOpenSG (different from OpenSceneGraph)Crystal SpaceVisualization LibraryPlain, old OpenGLConclusionHigh-performance 3D graphics toolkitOpen source, cross platformBased on concept of scene graphProgram structure straight-forwardScalable and portableHighly


View Full Document

CU-Boulder CSCI 5448 - OpenSceneGraph

Documents in this Course
Django

Django

42 pages

ENRS

ENRS

30 pages

PhoneGap

PhoneGap

22 pages

Load more
Download OpenSceneGraph
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view OpenSceneGraph and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view OpenSceneGraph 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?