Presentation is loading. Please wait.

Presentation is loading. Please wait.

Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 1 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Web3D (710.090) VRVU.

Similar presentations


Presentation on theme: "Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 1 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Web3D (710.090) VRVU."— Presentation transcript:

1 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 1 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Web3D (710.090) VRVU (710.096) SGP (710.098) Scenegraph APIs Markus Grabner Graz University of Technology

2 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 2 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Agenda ● Introduction ● PHIGS ● Open Inventor ● Performer

3 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 3 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP

4 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 4 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Introduction ● Rapid prototyping and application development ● Technical realization of hierarchical designs ● Supports re-use of objects ● Further abstraction of graphics hardware ● Access to underlying graphics library possible

5 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 5 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP PHIGS ● Programmer's Hierarchical Interactive Graphics System ● Interface for 2D/3D graphics (ANSI/ISO 1988) ● Device independent ● Interaction ● Library for different programming languages

6 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 6 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP PHIGS - example

7 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 7 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Open Inventor ● Overview ● Inventor Toolkit ● Component library (GUI) ● Extending Open Inventor ● Implementation of scene graph

8 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 8 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Overview (1) ● C++-library for interactive 3D graphics ● Easy use of graphics hardware ● Scene graph database based on OpenGL ● Flexible library of objects ● File format for 3D Szenen (cut & paste) ● GUI component library (Unix, Windows)

9 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 9 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Overview (2)

10 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 10 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Versions ● SGI Inventor (1992) http://oss.sgi.com/projects/inventor ● TGS Inventor http://www.tgs.com ● Coin3D (Systems in Motion) http://www.coin3d.org/Coin3D

11 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 11 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Inventor Toolkit ● Scene database ● Node Kits ● Manipulators

12 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 12 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Scene database (1) ● Node is smallest unit ● Information about ● Shape, material ● Geometric transformations ● Light sources, camera ● Many nodes equivalent to OpenGL command

13 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 13 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Scene database (2) ● Groups: scene graph by partial ordering ● Scene database contains scene graph(s) ● Traversing by applying of actions: ● Rendering ● Selection (by user) ● Output (to file) ● Database elements: ● Nodes (Shape, Properties, Groups) ● Engines, Sensors (e.g., for animations)

14 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 14 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Scene database (3)

15 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 15 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Node Kits ● Collection of nodes ● Predefined subgraph ● Structured, consistent scene database ● Applications: ● Shape objects with all desired properties ● Complex objects (e.g., car, plane) ● Similar to “PROTO” in VRML

16 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 16 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Manipulators (1) ● Special node type ● Reacts to user input ● Visible representation for interaction ● “3D icon”

17 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 17 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Manipulators (2) ● “Handle box”: Variation of ● Size ● Position ● Orientation

18 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 18 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Component library (1) ● Originally for X Windows ● Drawing window or object ● Main loop (input, redraw) ● Event handling ● X event  Inventor event ● Apply SoHandleEventAction to scenegraph ● Nodes can respond selectively ● Editors (e.g., material, light, transformations) ● Viewers (examiner, walk, fly, plane)

19 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 19 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Component library (2)

20 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 20 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Extending Open Inventor ● Very important for program development ● Possibilities: ● Callback-functions (C and C++): ● Reaction to user input in components ● Dedicated nodes in scene graph ● Subclassing (C++) ● Virtual methods (e.g., for rendering)

21 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 21 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Scene graph ● Nodes ● Group nodes ● Fields ● Re-using nodes (references)

22 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 22 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Nodes ● Fundamental element of scene graph ● On creation: root of new graph ● Typically hierarchical structure ● Information stored in fields

23 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 23 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Node types ● Shape (OpenGL rendering): ● Sphere ● Polygon mesh ● 3D text ● Properties (OpenGL state changes): ● Transformations (translation, scaling, rotation) ● Appearance (color, draw style, lighting) ● Metric (point and texture coordinates, normal vectors) ● Groups

24 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 24 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Groups (1) ● Children inserted one by one ● Actions applied in sequence of node insertion ● Setting object properties ● Properties remain valid

25 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 25 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Groups (2)

26 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 26 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Groups (3)

27 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 27 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Groups (4) #Inventor V2.1 ascii Group { Material { diffuseColor 0.6 0 0 specularColor 1 0 0 shininess 0.5 } Sphere { radius 1 } } Group { Transform { translation -0.7 -0.35 0 } Material { diffuseColor 1 1 1 specularColor 0.6 0.6 0.6 shininess 0.5 } Sphere { radius 0.66 } } Group { Transform { translation 1.4 0 0 } Sphere { radius 0.66 } }

28 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 28 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Group types ● Separator: ● Isolates effects of children nodes ● “Lazy stack”: efficient structuring ● Root should be separator ● Switch (only one child traversed) ● Level Of Detail (Clark 1976): ● Projection of 3D bounding box ● Memory consumption ● Popping

29 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 29 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Fields ● Extension of C/C++ standard types ● Consistent method for set/get ● React to modifications of scene graph ● Routing (e.g., timer with rotation angle) ● Reading from/writing to file

30 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 30 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Dependencies ● Enforcing constraints ● Field connections (compatible types) ● Unidirectional ● Explicit bidirectional (no infinite loops) ● Engines for complex dependencies

31 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 31 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Summary: different graph structures in OpenInventor ● Scene graph: geometric and/or semantic grouping of the scene ● Field dependency graph: consistent update of node properties ● C++ class inheritance graph: makeing common behaviour explicit

32 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 32 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Re-using nodes (1) ● Same node at different places in scene graph ● Instances distinguished by path ● Current path stored during traversal

33 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 33 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Re-using nodes (2)

34 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 34 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Re-using nodes (3) Separator { Material { diffuseColor 0.6 0 0 specularColor 1 0 0 shininess 0.5 } Sphere { radius 1 } } Separator { Transform { translation -0.7 -0.35 0 } DEF H_Atom Separator { Material { diffuseColor 1 1 1 specularColor 0.6 0.6 0.6 shininess 0.5 } Sphere { radius 0.66 } } Separator { Transform { translation 0.7 -0.35 0 } USE H_Atom }

35 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 35 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP References ● Deleting a group deletes all children ● Reference count incremented/decremented ● Groups and paths ● Problems: ● Dereferencing a node that is still in use ● Deleting the root (reference count always 0) ● Applying actions to nodes with reference count 0 ● Solution: explicit referencing/dereferencing

36 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 36 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Advanced topics ● Actions ● Engines ● Sensors

37 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 37 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Actions ● Different types: ● Rendering ● User input ● Bounding box ● Responsible for graph traversal (update path) ● OpenInventor extensions in C++: ● Easy: new nodes with same methods ● Hard: new methods for same nodes

38 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 38 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Engines ● Complex dependencies ● Lazy evaluation ● Types: ● Calculator ● Counter ● Interpolator ● Animation

39 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 39 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Sensors ● React on changes in database or external events ● Redraw scene graph ● Queues: ● Timer queue ● processed at scheduled time ● alarm and timer sensors ● Delay queue ● processed when application idle ● data sensors ● Example: key animation in VRML introduction

40 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 40 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP IRIS Performer - overview (1) ● Primary goal: maximum performance ● Problems with previous 3D libraries: ● Performance not platform independent ● Little support for optimization ● Not taking advantage of multiprocessor systems ● Hard to „upgrade“ for multi-threading

41 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 41 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP IRIS Performer - overview (2) ● Maximum performance by: ● Graphics optimizations: culling, LOD, profiling ● Multiprocessing ● Two libraries: ● libpr (optimized graphics primitives, shared memory) ● libpf (scene hierarchy, multiprocessing, real-time)

42 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 42 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP IRIS Performer - block diagram

43 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 43 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Efficient rendering ● Optimization of immediate mode ● Geometry: ● Rendering functions with optimized loops ● Utility library converts objects into triangle meshes ● State management: ● Only top-down inheritance (multiprocessing) ● Global states (e.g., lighting, fog) ● Local states (e.g., material, texture), lazy stack ● Attributes always defined with geometry

44 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 44 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Hierarchical scenes (1) ● No inner nodes for state changes ● Exception: geometric transformations ● Sorting by graphics mode (up to 50% faster) ● Hierarchy of bounding volumes

45 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 45 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Hierarchical scenes (2) ● Scene graph traversal for: ● Application ● View-volume culling ● Rendering ● Parallelisation in pipe-line

46 Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 46 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Thank you for your attention!


Download ppt "Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 1 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Web3D (710.090) VRVU."

Similar presentations


Ads by Google