CSE 167: Introduction to Computer Graphics Lecture #8: Scene Graph. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2015

Similar documents
CSE 167: Introduction to Computer Graphics Lecture #9: Scene Graph. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016

CSE 167: Introduction to Computer Graphics Lecture 11: Scene Graph 2. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

CSE 167: Introduction to Computer Graphics Lecture #11: Visibility Culling

CSE 167: Introduction to Computer Graphics Lecture #10: View Frustum Culling

CSE 167: Introduction to Computer Graphics Lecture #9: Visibility. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018

Problem Max. Points Total 80

CSE 167: Lecture #8: Lighting. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

Culling. Computer Graphics CSE 167 Lecture 12

CSE 167: Lecture #4: Vertex Transformation. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

CSE 167: Introduction to Computer Graphics. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

CSE 167: Introduction to Computer Graphics Lecture #7: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2015

CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation

CSE 167: Introduction to Computer Graphics Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2015

CSE 167: Lecture #5: Rasterization. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

CSE 167: Lecture #8: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

CSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2014

Lecture 08: Hierarchical Modeling with Scene Graphs

CSE 167: Introduction to Computer Graphics Lecture 12: Bézier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

Introduction to Computer Graphics. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

Overview. Java and OpenSceneGraph. Introduction. OpenSceneGraph. Introduction Scene graph structure

CSE 167: Introduction to Computer Graphics Lecture #5: Visibility, OpenGL

CIS 581 Interactive Computer Graphics

CSE 167: Introduction to Computer Graphics. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

Exercise Max. Points Total 90

CS451Real-time Rendering Pipeline

CIS 581 Interactive Computer Graphics (slides based on Dr. Han-Wei Shen s slides) Requirements. Reference Books. Textbook

CSE 167: Introduction to Computer Graphics Lecture #5: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017

Speeding up your game

CSE 167: Introduction to Computer Graphics Lecture #19: Wrapping Up. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017

CSE 167: Introduction to Computer Graphics Lecture #11: Bezier Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

Spatial Data Structures

Total 80

CSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

CSE 167: Lecture 11: Textures 2. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

Open Scene Graph Lecture Note #1

CSE 167: Lecture #17: Procedural Modeling. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

Accelerating Realism with the (NVIDIA Scene Graph)

CS535: Interactive Computer Graphics

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

CSE 167: Introduction to Computer Graphics Lecture #4: Coordinate Systems

Introduction to Computer Graphics. Knowledge basic concepts 2D and 3D computer graphics

Many rendering scenarios, such as battle scenes or urban environments, require rendering of large numbers of autonomous characters.

Chapter 4. Chapter 4. Computer Graphics 2006/2007 Chapter 4. Introduction to 3D 1

CSE 167: Introduction to Computer Graphics Lecture #13: Curves. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017

Computer Graphics I Lecture 11

Spatial Data Structures

Scene Management. Video Game Technologies 11498: MSc in Computer Science and Engineering 11156: MSc in Game Design and Development

CSE 167: Lecture #15: Procedural Modeling. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

CSE 167: Introduction to Computer Graphics Lecture #18: More Effects. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

Spatial Data Structures

Computer Graphics Disciplines. Grading. Textbooks. Course Overview. Assignment Policies. Computer Graphics Goals I

EDAF80 Introduction to Computer Graphics. Seminar 1. Hierarchical Transformation. Michael Doggett. Some slides by Carl Johan Gribel,

Spatial Data Structures

Lecture 18 of 41. Scene Graphs: Rendering Lab 3b: Shader

CHAPTER 1 Graphics Systems and Models 3

Lecture 0 of 41: Part A Course Organization. Introduction to Computer Graphics: Course Organization and Survey

TDA362/DIT223 Computer Graphics EXAM (Same exam for both CTH- and GU students)

CSE 167: Introduction to Computer Graphics Lecture #9: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

Spatial Data Structures

CS450/550. Pipeline Architecture. Adapted From: Angel and Shreiner: Interactive Computer Graphics6E Addison-Wesley 2012

lecture 18 - ray tracing - environment mapping - refraction

TSBK 07! Computer Graphics! Ingemar Ragnemalm, ISY

Topic 10: Scene Management, Particle Systems and Normal Mapping. CITS4242: Game Design and Multimedia

CSE 167: Introduction to Computer Graphics Lecture #8: Textures. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016

CS 381 Computer Graphics, Fall 2012 Midterm Exam Solutions. The Midterm Exam was given in class on Tuesday, October 16, 2012.

CSE 167: Introduction to Computer Graphics Lecture #3: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

CSE 167: Introduction to Computer Graphics Lecture #3: Coordinate Systems

Animation & Rendering

CS 4620 Program 3: Pipeline

Building scalable 3D applications. Ville Miettinen Hybrid Graphics

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T

Rendering. Converting a 3D scene to a 2D image. Camera. Light. Rendering. View Plane

Chapter 5 - The Scene Graph

Rendering Grass with Instancing in DirectX* 10

Algorithm Engineering Lab: Ray Tracing. 8. Februar 2018

Spatial Data Structures and Speed-Up Techniques. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

Particle systems, collision detection, and ray tracing. Computer Graphics CSE 167 Lecture 17

6.837 Introduction to Computer Graphics Assignment 5: OpenGL and Solid Textures Due Wednesday October 22, 2003 at 11:59pm

The Application Stage. The Game Loop, Resource Management and Renderer Design

EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing

LOD and Occlusion Christian Miller CS Fall 2011

2: Introducing image synthesis. Some orientation how did we get here? Graphics system architecture Overview of OpenGL / GLU / GLUT

Exercise Max. Points Total 80

CS 381 Computer Graphics, Fall 2008 Midterm Exam Solutions. The Midterm Exam was given in class on Thursday, October 23, 2008.

CSE 167: Introduction to Computer Graphics Lecture #7: GLSL. Jürgen P. Schulze, Ph.D. University of California, San Diego Spring Quarter 2016

CSE 167: Introduction to Computer Graphics Lecture #3: Projection. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

CSE 167: Introduction to Computer Graphics Lecture #16: Procedural Modeling

CSE 167: Lecture #17: Volume Rendering. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012

3D Rendering Pipeline

CSE 167: Lecture #7: Color and Shading. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

CSE 167: Introduction to Computer Graphics Lecture #6: Colors. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2013

CSE 167: Lecture #6: Color. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2011

Programming Game Engines ITP 485 (4 Units)

Spatial Data Structures and Speed-Up Techniques. Ulf Assarsson Department of Computer Science and Engineering Chalmers University of Technology

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

NVSG NVIDIA Scene Graph

CSCD18: Computer Graphics. Instructor: Leonid Sigal

Subdivision Of Triangular Terrain Mesh Breckon, Chenney, Hobbs, Hoppe, Watts

What s New in TerraExplorer Suite 5.0

Transcription:

CSE 167: Introduction to Computer Graphics Lecture #8: Scene Graph Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2015

Announcements Thursday: Midterm exam Friday: Project 3 late grading 2

Lecture Overview Scene Graphs & Hierarchies Introduction Data structures Performance Optimization Level-of-detail techniques View Frustum Culling 3

Rendering Pipeline Scene data Modeling and viewing transformation Shading Projection Rasterization, visibility 4 Image

Graphics System Architecture Interactive Applications Games, scientific visualization, virtual reality Rendering Engine, Scene Graph API Implement functionality commonly required in applications Back-ends for different low-level APIs No broadly accepted standards Examples: OpenSceneGraph, NVSG, Java3D, Ogre Low-level graphics API Interface to graphics hardware Highly standardized: OpenGL, Direct3D 5

Scene Graph APIs APIs focus on different types of applications OpenSceneGraph (www.openscenegraph.org) Scientific visualization, virtual reality, GIS (geographic information systems) NVIDIA SceniX (https://developer.nvidia.com/scenix) Optimized for shader support Support for interactive ray tracing Java3D (http://java3d.java.net) Simple, easy to use, web-based applications Ogre3D (http://www.ogre3d.org/) Games, high-performance rendering 6

Commonly Offered Functionality Resource management Content I/O (geometry, textures, materials, animation sequences) Memory management High-level scene representation Graph data structure Rendering Optimized for efficiency (e.g., minimize OpenGL state changes) 7

Lecture Overview Scene Graphs & Hierarchies Introduction Data structures Performance Optimization Level-of-detail techniques View Frustum Culling 8

Scene Graphs Data structure for intuitive construction of 3D scenes So far, our GLUT-based projects store a linear list of objects This approach does not scale to large numbers of objects in complex, dynamic scenes 9

Solar System Star World Planet 1 Planet 2 Moon A Moon B Moon C Moon D Example from http://www.gamedev.net 10

Solar System with Wobble World Star New Node Wobble Planet 2 Planet 1 Moon A Moon B Moon C Moon D 11

Planets rotating at different speeds Star World Separated Wobble Planet 2 Planet 1 Moon A Moon B Moon C Moon D 12

Data Structure Requirements Collection of separable geometry models Organized in groups Related via hierarchical transformations Use a tree structure Nodes have associated local coordinates Different types of nodes Geometry Transformations Lights Many more 13

Class Hierarchy Many designs possible Design driven by intended application Games Optimized for speed Large-scale visualization Optimized for memory requirements Modeling system Optimized for editing flexibility 14

Sample Class Hierarchy Node Group Geode MatrixTransform Switch Sphere Billboard Inspired by OpenSceneGraph 15

Class Hierarchy Node Common base class for all node types Stores node name, pointer to parent, bounding box Group Stores list of children Geode Geometry Node Knows how to render a specific piece of geometry 16

Class Hierarchy MatrixTransform Derived from Group Stores additional transformation M Transformation applies to sub-tree below node Monitor-to-world transformation M 0 M 1 World Star M 0 Planet M 1 17 Moon A Moon B

Lecture Overview Scene Graphs & Hierarchies Introduction Data structures Performance Optimization Level-of-detail techniques View Frustum Culling 18

Sample Class Hierarchy Node Group Geode MatrixTransform Switch Sphere Billboard Inspired by OpenSceneGraph 19

Class Hierarchy Node Common base class for all node types Stores node name, pointer to parent, bounding box Group Stores list of children Geode Geometry Node Knows how to render a specific piece of geometry 20

Class Hierarchy MatrixTransform Derived from Group Stores additional transformation M Transformation applies to sub-tree below node Monitor-to-world transformation M 0 M 1 World Star M 0 Planet M 1 21 Moon A Moon B

Class Hierarchy Switch Derived from Group node Allows hiding (not rendering) all or subsets of its child nodes Can be used for state changes of geometry, or key frame animation M 1 Moon Visible Moon Infrared 22

Class Hierarchy Sphere Derived from Geode Pre-defined geometry with parameters, e.g., for tesselation level, solid/wireframe, etc. Billboard Special geometry node to display an image always facing the viewer Sphere at different tessellation levels 23 Billboarded Tree

Solar System Star World Planet 1 Planet 2 Moon A Moon B Moon C Moon D 24

Source Code for Solar System world = new Group(); world.addchild(new Star()); rotation0 = new MatrixTransform( ); rotation1 = new MatrixTransform( ); rotation2 = new MatrixTransform( ); world.addchild(rotation0); rotation0.addchild(rotation1); rotation0.addchild(rotation2); rotation0.addchild(new Planet( 1 )); rotation0.addchild(new Planet( 2 )); rotation1.addchild(new Moon( A )); rotation1.addchild(new Moon( B )); rotation2.addchild(new Moon( C )); rotation2.addchild(new Moon( D )); Star Planet 1 Moon A 1 Moon B World 0 Moon C Planet 2 2 Moon D 25

Basic Rendering Traverse the tree recursively Group::draw(Matrix4 C) { for all children draw(c); } MatrixTransform::draw(Matrix4 C) { C_new = C*M; // M is a class member for all children draw(c_new); } Geode::draw(Matrix4 C) { setmodelview(c); render(myobject); } Initiate rendering with world->draw(identity); 26

Modifying the Scene Change tree structure Add, delete, rearrange nodes Change node parameters Transformation matrices Shape of geometry data Materials Create new node subclasses Animation, triggered by timer events Dynamic helicopter-mounted camera Light source Create application dependent nodes Video node Web browser node Video conferencing node Terrain rendering node 27

Benefits of a Scene Graph Can speed up rendering by efficiently using low-level API Avoid state changes in rendering pipeline Render objects with similar properties in batches (geometry, shaders, materials) Change parameter once to affect all instances of an object Abstraction from low level graphics API Easier to write code Code is more compact Can display complex objects with simple APIs 28 Example: osgearth class provides scene graph node which renders a Google Earth-style planet surface