Engine Basics: Optimizing Geometry CS 446: Real-Time Rendering & Game Technology David Luebke University of Virginia.

Slides:



Advertisements
Similar presentations
COMPUTER GRAPHICS CS 482 – FALL 2014 NOVEMBER 10, 2014 GRAPHICS HARDWARE GRAPHICS PROCESSING UNITS PARALLELISM.
Advertisements

Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
CGDD 4003 THE MASSIVE FIELD OF COMPUTER GRAPHICS.
Tomas Mőller © 2000 Speeding up your game The scene graph Culling techniques Level-of-detail rendering (LODs) Collision detection Resources and pointers.
GLSL I May 28, 2007 (Adapted from Ed Angel’s lecture slides)
GLSL I Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico.
Further Programming for 3D applications CE Introduction to Further Programming for 3D application Bob Hobbs Faculty of Computing, Engineering and.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Introduction to Computer Graphics Ed Angel Professor of Computer Science, Electrical and.
Z-Buffer Optimizations Patrick Cozzi Analytical Graphics, Inc.
Sep 30, I3I3DG&VR CE00539-m Interactive 3D Graphics and Virtual Reality Bob Hobbs Faculty of Computing, Engineering and Technology Staffordshire.
Game Engine Design ITCS 4010/5010 Spring 2006 Kalpathi Subramanian Department of Computer Science UNC Charlotte.
Mohan Sridharan Based on slides created by Edward Angel GLSL I 1 CS4395: Computer Graphics.
Graphical Objects and Scene Graphs CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
Rendering Engine Basics CS 446: Real-Time Rendering & Game Technology David Luebke University of Virginia.
GPU Graphics Processing Unit. Graphics Pipeline Scene Transformations Lighting & Shading ViewingTransformations Rasterization GPUs evolved as hardware.
David Luebke 1 9/4/2015 Real-Time Rendering & Game Technology CS 446/651 David Luebke.
Antigone Engine Kevin Kassing – Period
Spatial Data Structures Jason Goffeney, 4/26/2006 from Real Time Rendering.
CS 480/680 Computer Graphics Course Overview Dr. Frederick C Harris, Jr. Fall 2012.
GPU Programming Robert Hero Quick Overview (The Old Way) Graphics cards process Triangles Graphics cards process Triangles Quads.
Programmable Pipelines. Objectives Introduce programmable pipelines ­Vertex shaders ­Fragment shaders Introduce shading languages ­Needed to describe.
Graphical Objects and Scene Graphs 1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009.
Chris Kerkhoff Matthew Sullivan 10/16/2009.  Shaders are simple programs that describe the traits of either a vertex or a pixel.  Shaders replace a.
A Crash Course in HLSL Matt Christian.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
Computer Graphics 2 Lecture 8: Visibility Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
1 CO Games Concepts Week 20 Matrices continued Gareth Bellaby.
1 Introduction to Computer Graphics SEN Introduction to OpenGL Graphics Applications.
Visibility III: Occlusion Queries CS 446: Real-Time Rendering & Game Technology David Luebke University of Virginia.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Visibility CS 446: Real-Time Rendering & Game Technology David Luebke University of Virginia.
Saarland University, Germany B-KD Trees for Hardware Accelerated Ray Tracing of Dynamic Scenes Sven Woop Gerd Marmitt Philipp Slusallek.
CS662 Computer Graphics Game Technologies Jim X. Chen, Ph.D. Computer Science Department George Mason University.
Jul 25, 2014IAT 3551 Scene Graphs.  A data structure that stores information about a graphics scene –Each node has information that structures the interpretation.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CSCE 552 Spring D Models By Jijun Tang. Triangles Fundamental primitive of pipelines  Everything else constructed from them  (except lines and.
CSE3AGT – How to fail the Exam Paul Taylor Things to forget: What is Barry? A hamster or a Guinea Pig? The differences between Dx9 and Dx10 What.
Recap: General Occlusion Culling l When cells and portals don’t work… –Trees in a forest –A crowded train station l Need general occlusion culling algorithms:
Computer Graphics IN5I11 Nabil H. Mustafa
Computer Graphics 3 Lecture 6: Other Hardware-Based Extensions Benjamin Mora 1 University of Wales Swansea Dr. Benjamin Mora.
Week 3 Lecture 4: Part 2: GLSL I Based on Interactive Computer Graphics (Angel) - Chapter 9.
David Luebke 1 1/20/2016 Real-Time Rendering CS 446 David Luebke.
Maths & Technologies for Games Graphics Optimisation - Batching CO3303 Week 5.
Computer Graphics and the Game Industry Speaker: Ted Bisson.
DPL2/10/2016 CS 551/651: Final Review David Luebke
OpenGL Shading Language
The Graphics Pipeline Revisited Real Time Rendering Instructor: David Luebke.
Programming with OpenGL Part 3: Shaders Ed Angel Professor of Emeritus of Computer Science University of New Mexico 1 E. Angel and D. Shreiner: Interactive.
GLSL I.  Fixed vs. Programmable  HW fixed function pipeline ▪ Faster ▪ Limited  New programmable hardware ▪ Many effects become possible. ▪ Global.
1 Advanced Scene Management. 2 This is a game-type-oriented issue Bounding Volume Hierarchies (BVHs) Binary space partition trees (BSP Trees) “Quake”
Computer Science – Game DesignUC Santa Cruz Tile Engine.
David Luebke 1 7/5/2016 CS 551/651: Advanced Computer Graphics Review for final.
1 Geometry for Game. Geometry Geometry –Position / vertex normals / vertex colors / texture coordinates Topology Topology –Primitive »Lines / triangles.
Institute for Computer Graphics and Vision Computer Graphics and Interactive Systems 1 Grabner HS i4, 2006/03/08 Web3D, VRVU, SGP Web3D ( ) VRVU.
COMPUTER GRAPHICS CHAPTER 38 CS 482 – Fall 2017 GRAPHICS HARDWARE
IAT 355 Scene Graphs Feb 23, 2017 IAT 355.
A Crash Course on Programmable Graphics Hardware
Graphics Processing Unit
Chapter 6 GPU, Shaders, and Shading Languages
CS451Real-time Rendering Pipeline
GLSL I Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico.
Introduction to Computer Graphics with WebGL
Graphics Processing Unit
Game Engines Non-game specific technology Game: Engine
Computer Graphics Practical Lesson 10
Programming with OpenGL Part 3: Shaders
Computer Graphics Introduction to Shaders
CIS 441/541: Introduction to Computer Graphics Lecture 15: shaders
CS 480/680 Fall 2011 Dr. Frederick C Harris, Jr. Computer Graphics
Presentation transcript:

Engine Basics: Optimizing Geometry CS 446: Real-Time Rendering & Game Technology David Luebke University of Virginia

Real-Time Rendering 2 David Luebke SIGN UP SHEET Today: Fight Night videos Demo Time

Real-Time Rendering 3 David Luebke Homework The pitch: “due” Tuesday, keep pitching The game: due today at midnight

Real-Time Rendering 4 David Luebke Recap: Scene Graph Node Examples Objects Groups of objects LOD selectors Animation “effectors” –“Flipbook” animation selectors –Transform drivers –Deformers –Skeletal animation players Lights! Cameras! Transforms Useful state –Bounding boxes, partitions Graphics state –Which textures, shaders bound –Material –Other state - glEnable(GL_FOO) “Raw” geometry –Vertices and triangles Note: often actual geometry only exists at leaves

Real-Time Rendering 5 David Luebke Scene Graph Traverals Classical use of scene graph: –Traverse in depth-first fashion –Apply effects of “action” nodes when reached LOD selectors, animation effectors –Push/pop matrices when reach/leave xform nodes –Issue geometry as reached Not very efficient for complex scenes ( why? ) –Unnecessary pushing/popping –Constantly switching graphics state –No spatial organization –Lots of recalculation for multiple passes

Real-Time Rendering 6 David Luebke Scene Graph Traversals Can optimize traversal logic several ways, e.g.: –Cache per-frame computations: bbox, matrices –Flatten hierarchy for unchanging subgraphs –Call animation effectors first & update bboxes bottom-up Visibility computations affect traversal –View-frustum culling: top-down, separate visibility grid –Cells & portals: portals can be special arcs –Other: BSP trees, 2.5D from-region, fog-of-war

Real-Time Rendering 7 David Luebke Scene Graph Traversals Common traversals: –Simple depth-first. Optional: View-frustum culling or other visibility scheme Different LOD biases Cache bbox/visibility/matrix info for later passes –Rough front-to-back sort –Sorted by state –Geometry-only

Real-Time Rendering 8 David Luebke Efficient Rendering So leaves of the scene graph represent geometry… How to efficiently represent that geometry? –Hint: not like this: typedef float Point[3]; typedef Point Triangle[3]; Triangle tris[] = new Triangle[ntris];... glBegin(GL_TRIANGLES); for (i=0;i<nverts;i++) { glVertex3fv(tris[i][0]); glVertex3fv(tris[i][1]); glVertex3fv(tris[i][2]); } glEnd();

Real-Time Rendering 9 David Luebke 5 Steps to Efficient Rendering Step 1: reduce #vertices/triangle Step 2: reduce overhead of each vertex Step 3: recognize the existence of the vertex cache Step 4: display lists (deprecated re: performance) Step 5: learn about the hardware

Real-Time Rendering 10 David Luebke Other things you should know Most interesting stuff in OpenGL isn’t in red book –Extension registry Extensions you should know: –ARB_multitexture –EXT_framebuffer_object –ARB_occlusion_query –ARB_point_sprite –ARB_texture_rectangle –ARB_draw_buffers –ARB_texture_float (_framebuffer_float, _half_float_pixel, etc) –ARB_depth_texture –ARB_vertex_buffer_object (_pixel_buffer_object)

Real-Time Rendering 11 David Luebke Coming Up Next topic: programmable graphics hardware –We’ll use NVIDIA’s Cg language because I know it –Similar alternatives: Microsoft’s HLSL for DirectX OpenGL Shading Language ( GLSL, once Glslang) –Different approach: Sh