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

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

CPSC / Sonny Chan - University of Calgary. Collision Detection II

Spatial Data Structures

Computer Graphics (CS 543) Lecture 13b Ray Tracing (Part 1) Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

Announcements. Written Assignment2 is out, due March 8 Graded Programming Assignment2 next Tuesday

Spatial Data Structures

Spatial Data Structures and Acceleration Algorithms

Motivation. Culling Don t draw what you can t see! What can t we see? Low-level Culling

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

Speeding up your game

Acceleration Data Structures

Spatial Data Structures and Acceleration Algorithms

Ray Tracing: Intersection

Spatial Data Structures

COMP 175: Computer Graphics April 11, 2018

CS 563 Advanced Topics in Computer Graphics Culling and Acceleration Techniques Part 1 by Mark Vessella

Spatial Data Structures

Bounding Volume Hierarchies

Spatial Data Structures

Computer Graphics. Bing-Yu Chen National Taiwan University The University of Tokyo

Ray Tracing III. Wen-Chieh (Steve) Lin National Chiao-Tung University

Ray Tracing. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

Intersection Acceleration

Topics. Ray Tracing II. Intersecting transformed objects. Transforming objects

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

CS535 Fall Department of Computer Science Purdue University

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

Collision Detection based on Spatial Partitioning

Topics. Ray Tracing II. Transforming objects. Intersecting transformed objects

Computer Graphics. Bing-Yu Chen National Taiwan University

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

Collision Detection. These slides are mainly from Ming Lin s course notes at UNC Chapel Hill

Accelerating Ray Tracing

Project Gotham Racing 2 (Xbox) Real-Time Rendering. Microsoft Flighsimulator. Halflife 2

Ray Tracing Acceleration. CS 4620 Lecture 20

Collision Detection II. These slides are mainly from Ming Lin s course notes at UNC Chapel Hill

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

CS580: Ray Tracing. Sung-Eui Yoon ( 윤성의 ) Course URL:

MSBVH: An Efficient Acceleration Data Structure for Ray Traced Motion Blur

Collision and Proximity Queries

Using Bounding Volume Hierarchies Efficient Collision Detection for Several Hundreds of Objects

Lesson 05. Mid Phase. Collision Detection

Spatial Data Structures. Steve Rotenberg CSE168: Rendering Algorithms UCSD, Spring 2017

INFOGR Computer Graphics. J. Bikker - April-July Lecture 11: Acceleration. Welcome!

Computer Graphics. - Ray-Tracing II - Hendrik Lensch. Computer Graphics WS07/08 Ray Tracing II

Accelerated Raytracing

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

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

CHAPTER 1 Graphics Systems and Models 3

improving raytracing speed

Ray Tracing Acceleration Data Structures

CS451Real-time Rendering Pipeline

Acceleration Data Structures. Michael Doggett Department of Computer Science Lund university

Overview. Pipeline implementation I. Overview. Required Tasks. Preliminaries Clipping. Hidden Surface removal

Computer Graphics. - Spatial Index Structures - Philipp Slusallek

Terrain Rendering Research for Games. Jonathan Blow Bolt Action Software

Speeding Up Ray Tracing. Optimisations. Ray Tracing Acceleration

TSBK03 Screen-Space Ambient Occlusion

Lecture 25 of 41. Spatial Sorting: Binary Space Partitioning Quadtrees & Octrees

Real Time Rendering of Complex Height Maps Walking an infinite realistic landscape By: Jeffrey Riaboy Written 9/7/03

Homework 1: Implicit Surfaces, Collision Detection, & Volumetric Data Structures. Loop Subdivision. Loop Subdivision. Questions/Comments?

Chapter 11 Global Illumination. Part 1 Ray Tracing. Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.

Universiteit Leiden Computer Science

11 - Spatial Data Structures

MODELING AND HIERARCHY

Visibility and Occlusion Culling

Hidden surface removal. Computer Graphics

l Without collision detection (CD), it is practically impossible to construct e.g., games, movie production tools (e.g., Avatar)

Real-Time Collision Detection for Dynamic Virtual Environments

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

Comparison of hierarchies for occlusion culling based on occlusion queries

Collision Detection. Pu Jiantao.

Simulation in Computer Graphics Space Subdivision. Matthias Teschner

Ray Tracing with Spatial Hierarchies. Jeff Mahovsky & Brian Wyvill CSC 305

Lecture 2 - Acceleration Structures

Adaptive Point Cloud Rendering

Ray Tracing Acceleration. CS 4620 Lecture 22

Computer Graphics CS 543 Lecture 13a Curves, Tesselation/Geometry Shaders & Level of Detail

Computer Graphics. Lecture 9 Hidden Surface Removal. Taku Komura

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

The Traditional Graphics Pipeline

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

Collision Detection with Bounding Volume Hierarchies

Graphics and Interaction Rendering pipeline & object modelling

CS 563 Advanced Topics in Computer Graphics QSplat. by Matt Maziarz

Acceleration Data Structures for Ray Tracing

Kinetic BV Hierarchies and Collision Detection

Motivation. Sampling and Reconstruction of Visual Appearance. Effects needed for Realism. Ray Tracing. Outline

Geometry proxies (in 2D): a Convex Polygon

Collision Detection. Jane Li Assistant Professor Mechanical Engineering & Robotics Engineering

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Advanced 3D-Data Structures

Ray Tracing. Computer Graphics CMU /15-662, Fall 2016

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

CPSC GLOBAL ILLUMINATION

Page 1. Area-Subdivision Algorithms z-buffer Algorithm List Priority Algorithms BSP (Binary Space Partitioning Tree) Scan-line Algorithms

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

Anti-aliased and accelerated ray tracing. University of Texas at Austin CS384G - Computer Graphics

Optimisation. CS7GV3 Real-time Rendering

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

Transcription:

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

Overview Scene Management vs Rendering This chapter is about rendering acceleration techniques for complex scenes, i.e. scenes with large amounts of geometry Spatial Data Structures At the core of such techniques/algorithms we find spatial data structures Culling Techniques From those data structures, we are able to design culling techniques to determine the visilibility of scene objects Level of Detail (LOD) LOD techniques also help us to reduce the complexity of rendering scene objects.

Complex scenes: the Boeing 777 example A real-time renderer aims at satisfying four main performance goals: More frames per second (between 65-80 fps) Higher resolution and sampling rates But more pixels more computations and time taken More realistic materials and lighting But more realism implies more computations and time spent Increased scene complexity Boeing 777 has 132,500 unique parts and 3,000,000 fasteners, which yields a polygonal model with over 500,000,000 polygons Neither z-buffering nor ray tracing can handle such huge models without using acceleration techniques that reduce the number of computations

Scene management and rendering The scene management system maintains a world full of objects and determines what gets drawn and in what order. The scene management layer deals primarily with objects. The rendering layer deals primarily with triangles and graphics state. Graphics Engine Sound Engine Our Game Game Engine API Physics Engine AI Engine Hardware Abstraction Layer - DirectX, OpenGL,... Scripting Engine Hardware Layer - sound card, graphics card (physics card, AI card,...)

Spatial Data Structures

Spatial data structures Definition: Data structure that organizes geometry in 2D or 3D or in some n-dimensional space Goal: They are used to speed up queries about proximity and overlapping of geometric objects in a scene. Such spatial data structures are usually hierarchical to speed up queries, what leads to an improvement from O(n) to O(log n). Applications: These queries are used in many operations: Faster real-time rendering Faster intersection testing Faster collision detection Faster ray tracing and global illumination Types: Bounding volume hierarchies (BVHs) Binary space partitioning (BSP) trees Quadtrees Octrees

Bounding Volume (BV) A bounding volume is a volume that encloses a set of objects It should be a simple geometrical shape. Examples: Sphere Axis-Aligned Bounding Box (AABB) Oriented Bounding Box (OBB) Discrete Oriented Polytope (k-dop) A bounding volume does not contribute to the rendering image. Instead, it works as a proxy in place of the bounded objects to speed up rendering, selection, and other computations and queries. tighter approximation decreasing complexity and computational cost for geometric computations For example, BVH is often used for hierarchical view frustum culling.

Bounding Volume Hierarchies (BVH) http://www.win.tue.nl/~hermanh/stack/bvh.pdf Bounding volume tree (BV tree): A tree of bounding volumes Nodes contain bounding volume information Leaves additionally contain object primitive information BVH generation: Subdivision of bounding volumes to generate a hierarchy Improved object approximation at higher levels

Scene Graph BVH is the data structure that is used most often to wrap every single connected object of a scene, simply because: It is simple to grasp It is easy to program However, a BVH stores just geometry Rendering is more than geometry The scene graph is an extended BVH with: Lights, textures, transforms (translations, rotations, etc), and more It represents the 3D world (of the game)

6631 Video Games Technologies Put the parts on the table Assemble together the related part http://pesona.mmu.edu.my/~ypwong/virtualreality/java3d_tutorial_dave/slides/mt0026.htm http://pesona.mmu.edu.my/~ypwong/virtualreality/java3d_tutorial_dave/slides/mt0000.htm Building a toy airplane with a scene graph: example Assemble those into the final plane

Binary space partitioning (BSP) Doom makes use of a system known as binary space partitioning (BSP). It is because of this that it is not possible to move the walls in Doom; while doors and lifts move up and down, none of them ever move sideways. The level is divided up into a binary tree: each location in the tree is a "node" which represents a particular area of the level (with the root node representing the entire level). At each branch of the tree there is a dividing line which divides the area of the node into two subnodes. At the same time, the dividing line divides linedefs into line segments called "segs".

Binary Space Partitioning (BSP) Trees Types: Axis-aligned BSP tree Polygon-aligned BSP tree Idea: Divide space with a plane Sort geometry into the space it belongs Done recursively If traversed in a certain way, we can get the geometry sorted along an axis Exact for polygon-aligned Approximately for axis-aligned http://www.gamedev.net/page/resources/_/technical/graphics-programming-and-theory/bsp-tree-faq-r657

Axis-aligned BSP Trees Can only make a splitting plane along x,y, or z Each internal node holds a divider plane Leaves hold geometry Differences compared to BVH Encloses entire space and provides sorting The BV hierarchy can be constructed in any way (no sort) BVHs can use any desirable type of BVT

Axis-aligned BSP Trees: Rough Sorting Test the planes against the point of view Test recursively from root Continue on the hither side to sort front to back Works in the same way for polygon- aligned BSP trees --- but that gives exact sorting

Polygon-aligned BSP Trees Allows exact sorting Very similar to axis-aligned BSP tree But the splitting plane are now located in the planes of the triangles

Level of Detail (LoD)

Discrete LoDs Several discrete LODs are prepared off line and dynamically switched based on simple distance comparisons (ideally it should take the camera FOV and resolution into account too) Tried and true method used for many years in flight simulation Basically no CPU overhead for algorithm itself Hardware is well adapted to rendering static display lists Additional memory required for storing LODs, but all low LODs together are usually smaller than the high LOD Can use sophisticated mesh decimation tools off line for preparing models If desired, techniques exist for cross dissolving (fading) between LODs Bottom line: very fast and very simple (quick & dirty)

Progressive Meshes Automated mesh decimation and dynamic reconstruction technique Can take any model and then render it dynamically with any number of polygons (less than or equal to the original number) Requires about 1/3 extra memory (or more, depending on details of the implementation)

Progressive mesh performance Rendering requires custom processing at the per-vertex and per-triangle level, and so the algorithm, while pretty efficient, has trouble competing with the simpler discrete LOD technique. In other words, even though it may be able to render fewer triangles, the pertriangle cost is higher, usually making the overall approach slower. Neat technology and useful research, but hasn t been too successful in video games just yet. Future graphics hardware may have better support for progressive meshes, and so they may be more important later. Also, mesh decimation technology is still very useful in off line modeling.

Patches and subdivision surfaces Geometry is defined by a control mesh that explicitly describes a high order surface Surface is dynamically tessellated into polygons, based on camera distance and other visual quality controls Patches & subdivision surfaces allow for smooth, rounded surfaces to be described without using tons of memory Overall approach suffers from similar drawbacks to progressive meshes as far as its usefulness to games

6631 Video Games Technologies Terrain rendering

LoD issues Color & lighting (normals) pops are more visible than geometry or silhouette pops Camera is often moving and there are often many dynamic objects in the scene. This can help mask LOD transitions Ideally, LOD should be pixel error based Load balancing: LOD tolerances can be dynamically adjusted to provide a stable framerate Uses timers to analyze how long the last frame took to render, then adjusts LODs so that current frame makes the most of available CPU time

Summary Scene Management vs Rendering Performance goals, scene graphs, and differences between scene manager and render Spatial Data Structures Bounding volume hierarchies (BVHs), binary space partitioning (BSP) trees, quadtrees, and octrees Culling Techniques Definition and algorithms Level of Detail (LOD) Discrete LODs, progressive meshes, multiresolution schemes, terrain modeling