760 likes | 941 Views
Image Synthesis. What is left to do? „The Real-World Problems!!!“. So far …. Realtime OpenGL / DirectX basics Programmable pipeline Effects Non- Realtime Raytracing Radiosity Photon Mapping. What‘s left ?. „Optimizations“ „Problem size“. Terabyte To Exabyte Datasets!.
E N D
Image Synthesis Whatisleftto do? „The Real-World Problems!!!“
So far … • Realtime • OpenGL / DirectX basics • Programmable pipeline • Effects • Non-Realtime • Raytracing • Radiosity • Photon Mapping
What‘sleft? • „Optimizations“ • „Problem size“ Terabyte To ExabyteDatasets!
Image Synthesis Scenegraph APIs
Scenegraph APIs Low-level APIs like GL/DX as well as self writen raytracing/radiosity implementations have several disadvantages:
Scenegraph APIs A historic overview • 1992 OpenInventor (SGI) ? • 1992 Iris Performer (SGI) • 1995 Cosmo3D (SGI) • 1996 Optimizer (SGI) • 1996 DirectModel/Jupiter (HP) • 1997 OpenGL++ (ARB-Sun,SGI,Intel,...) • 1997 Java3D (Sun) • 1998 Fahrenheit (SGI,MS) • 2000 OpenSG (OpenSource - Germany) • 2000 OpenScenegraph • 2003 NVSG NVidiaScenegraph?
Scenegraph APIs Features of a scenegraph API • The scene is stored in a hierarchically organized tree-like data structure Group Transform Nodes are the objects describing the scene Edges are references that define the relationship between objects Light Shape Appearance Geometry
Scenegraph APIs The scenegraph is implemented as a directed acyclic graph • It organizes and controls the rendering of the scene • It provides fixed or application dependent traversal order (Depth-first, breath-first, arbitrary) • It determines the way in which attributes are propagated to/associated with objects
Scenegraph APIs Each node belongs to a specific class • Shape nodes -> geometry • Appearance nodes -> material properties • Transform nodes -> local object transforms • Environment nodes -> lights, space properties • Camera nodes -> viewing parameters • Etc.
OpenInventor First widelyusedscenegraphfrom SGI • IRIS Inventor based on IrisGL • 1994: OpenInventorbased on OpenGL • Basis formanyproductsandprojects • Iris Explorer VisualizationToolkit • Amira • Since 2000 original in OpenSource • Multipipe, Stereo,3D Textures, Kollisionen,... • Multiplatforms: Linux, Windows • http://oss.sgi.com/projects/inventor/
OpenInventor - Example Table-scenewithpathtoone leg
Scenegraph APIs Scenegraph traversal • OpenInventor • Depth-first traversal • Inheritence of states from left to right and top to bottom • Performer • Depth-first traversal • Different traversalprocesses (app., cull, draw, etc.) • No inheritance from left to right
OpenInventor - Details • Traversal from top to bottom and left to right • Update of traversal state • Current transformation, geometry, material, texture, ... • Separator: push/pop of traversal state • Multiple references to nodes possible • Shared instancing • Explicit reference counting with automatic delete (important for memory management under C++) • Data elements of node: Fields • Basis types: Bool, Color, Vec3f, Matrix, List, Name, String, ... • Single Value Fields and Multiple Value Fields • setValue/getValue and defaults • Ignore/Overwrite Flags
OpenInventor - Interactions • Events • Windowindependent (Event Translator) • Processedbyapplication, viewerornodes • HandleEventAction: propagateseventsthroughgraphuntilonenodereacts (grab) • Picking • Yieldspaththroughscenegraph • Manipulators • Interaction nodeswithowngeometry (Pick, Feedback) • Supports 3D-Navigation with2D-Mouse (Projector) • ConsistsofDraggers (one Transformation)
OpenInventor - Manipulators Handlebox
OpenInventor - Manipulatoren Transformer Spot Light
OpenInventor - Scenegraph-Editor Directmodifikationofnodes in graph
OpenInventor – Data format #Inventor V2.0 ascii Separator { PerspectiveCamera { position 0 0 4.18154 nearDistance 2.44949 farDistance 5.91359 focalDistance 4.18154 } DirectionalLight {} Material { diffuseColor[ 1 1 0.2 ] } Cone { } }
OpenInventor – Data format • OpenInventor-2.0-Format • Basis for VRML 1.0 • Only slight differences, e.g. nodes for Web-Access • VRML 2.0 and following (VRML 97, X3D) • 3D-Formats for Internet • Take some OpenInventor concepts • But: structural changes
Scenegraph APIs SG APIs provide additional features to achieve interactive frame rates for large scenes • Handling and manipulation of huge data structures • Multiprocessor/Multipipe rendering • Build-in components for efficient rendering of large geometries • Pre-defined components, e.g. viewer including event handling
Scenegraph APIs Basic scenegraph optimization techniques can be split into different categories • Storage – Generate Stage • Graph traversal – Traversal Stage • Geometry processing – Transform Stage • Rasterization
Generate stage optimization • Storage • Links instead of instances • Hierarchical partitioning of the scenegraph • On-demand rendering from disk • Paging of (less frequently used) objects • Multiprocessor-control • Thread manager • Synchronization of multiprozessor-SG traversal • Geometry compression • Quantization and topology encoding • Geometry simplification and optimization • Mesh reduction • Efficient conversion in strips and fans
Generate stage optimization Geometry simplification • Objects are represented with less triangles • Relevant features and the original shape within a certain error tolerance are retained • Automatic selection of triangles to be removed based on local curvatureorothercriteria • Automatic triangle removal • Collapse, split, swap
Generate stage optimization Geometry simplification
Generatestageoptimization Mesh reduction criteria Mean-curvature Gauss-curvature 2-i Difference between area before and after reduction
Mesh analysis Criteria to analyze mesh quality • Distance to other mesh, e.g. mesh before modification • Hausdorff-distance (two-sided): dHaus(A,B) = max{maxaA dist(a,B), maxbBdist(A,b)} dist(a,B) = minbBdist(a,b) (one-side Hausdorff) dist(A,b) = minaAdist(a,b) (one-side Hausdorff) • Maximum of all shortest vertex-to-mesh distances
Mesh analysis Hausdorff-distance dhaus=d
Mesh analysis Hausdorff-distance • d1=maxqQdist(P,q) • d2=maxpPdist(p,Q)
Mesh analysis Hausdorff-distance dhaus=d1=d2
Generate stage optimization Triangle removal by re-tesselation • UsegluTesselatetotesselatearbitrarypolys
Generate stage optimization • n practical applications • User defines compression factor • Different Levels-of-Detail are precomputed • Manual or automatic LOD selection during rendering • E.g, less details are shown during movement or if the object is far away
Generate stage optimization Geometry simplification (5,10,50,100 %) progressive nonprogressive
Generate stage optimization • Geometry simplification #: 1.087716 286578 30392 3774
Generate stage optimization Geometry simplification Original Simplified
Generate stage optimization • Geometry optimization • Large redundant structures are stored into vertex arrays • Sharing of multiple defined geometry and attributes • Re-organization into strips and fans • Adjacency information is exploited for efficient coding 1 3 5 (012)(123)(234)(345) ->(012345) one strip 0 4 0 2 4 (012)(023)(034) -> (01234) one fan 3 1 2
Traversal stage optimization • Improved traversal by re-organization of the graph structure • Spatialization • Nodes are re-arranged with respect to their spatial position or other attributes • Can lead to a more efficient traversal order • Accelerated culling and picking • Flattening the graph structure results in less recursion stages • Better memory efficiency • Less CPU load • Group geometry with equal material • Minimize GPU state changes
Traversal stage optimization • Spatialization • Shared Instancing: group nodes • Build parallel SG of inner nodes for efficient culling • Remove unnecessary hierarchy stages • Resolve shared instances • Allows for adaptive BV-Hierarchies
Transform stage optimization • Objects rendered multiple times are stored into OpenGL display lists • Renderable primitives that won´t be displayed are automatically determined and culled • Culling: discard invisible objects before they are transfered to the GPU • backface cullingdiscard backfacing facets • detail cullingdiscard „small“ objects • view frustrum cullingdiscard objects outside view frustum • occlusion cullingdiscard occluded objects
Transform stage optimization • Backface culling • Triangles with a normal pointing away from the viewer are discarded • Efficient computation by means of the area of the polygon in window coordinates • Might lead tostrange results
Transform stage optimization View frustum culling • Parts of the scene outside the view frustum are discarded • Not supported by OpenGL; clipping is performed after transformation to screen space coordinates • Efficient intersection test between objects and frustum necessary
Transform stage optimization Occlusion culling • Parts of the scene that are entirely hidden by others are discarded Occludedparts