David Luebke5/11/2015 CS 551 / 645: Introductory Computer Graphics David Luebke

Slides:



Advertisements
Similar presentations
Visible-Surface Detection(identification)
Advertisements

Computer Graphics Inf4/MSc 28/10/08Lecture 91 Computer Graphics Lecture 9 Visible Surface Determination Taku Komura.
CSC418 Computer Graphics n Polygon normals n Back Faces n Visibility Algorithms.
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
Computer Graphics Inf4/MSc Computer Graphics Lecture 9 Visible Surface Determination.
03/12/02 (c) 2002 University of Wisconsin, CS559 Last Time Some Visibility (Hidden Surface Removal) algorithms –Painter’s Draw in some order Things drawn.
Lecture Fall 2001 Visibility Back-Face Culling Painter’s Algorithm.
CS 551 / 645: Introductory Computer Graphics Visible Surface Determination.
CAP4730: Computational Structures in Computer Graphics Visible Surface Determination.
Visibility in Computer Graphics Toni Sellarès Unversitat de Girona
Computer Graphics Visible Surface Determination. Goal of Visible Surface Determination To draw only the surfaces (triangles) that are visible, given a.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Hidden Surface Removal 고려대학교 컴퓨터 그래픽스 연구실.
CS 445 / 645: Introductory Computer Graphics
UBI 516 Advanced Computer Graphics
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Clipping II, Hidden Surfaces.
Chapter 6: Vertices to Fragments Part 2 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
1 Dr. Scott Schaefer Hidden Surfaces. 2/62 Hidden Surfaces.
Hidden Surface Elimination Wen-Chieh (Steve) Lin Institute of Multimedia Engineering I-Chen Lin’ CG Slides, Rich Riesenfeld’s CG Slides, Shirley, Fundamentals.
1 CSCE 441: Computer Graphics Hidden Surface Removal (Cont.) Jinxiang Chai.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Visibility II Week 7,
1 Clipping and Hidden Surfaces CS-184: Computer Graphics Prof. James O’Brien.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner Hidden Surfaces II Week.
Vertices and Fragments III Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
Spatial Data Structure: Quadtree, Octree,and BSP tree Mengxia Zhu Fall 2007.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Visibility Week 9, Fri 31 Oct 2003.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Visibility Week 7, Wed.
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Visibility: Z Buffering Week 10, Mon 3 Nov 2003.
Hidden Surface Removal
Visible Surface Determination
Erdem Alpay Ala Nawaiseh. Why Shadows? Real world has shadows More control of the game’s feel  dramatic effects  spooky effects Without shadows the.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2010 Tamara Munzner Clipping II, Hidden Surfaces.
02/26/02 (c) 2002 University of Wisconsin, CS 559 Last Time Canonical view pipeline Orthographic projection –There was an error in the matrix for taking.
CSC418 Computer Graphics n BSP tree n Z-Buffer n A-buffer n Scanline.
Visible-Surface Detection Jehee Lee Seoul National University.
Hidden Surface Removal 1.  Suppose that we have the polyhedron which has 3 totally visible surfaces, 4 totally invisible/hidden surfaces, and 1 partially.
CS-378: Game Technology Lecture #2.2: Clipping and Hidden Surfaces Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney,
CAP4730: Computational Structures in Computer Graphics
1Computer Graphics Implementation II Lecture 16 John Shearer Culture Lab – space 2
Implementation II Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts University of New Mexico.
Binary Space Partitioning Trees Ray Casting Depth Buffering
Hidden Surface Removal
Implementation II.
1 Visiblity: Culling and Clipping Computer Graphics COMP 770 (236) Spring 2009 January 21 & 26: 2009.
Drawing Triangles CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
Computer Graphics Zhen Jiang West Chester University.
David Luebke 1 12/8/2015 Visibility CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © Visible Surface Determination (VSD) To render or not to render, that is the question… 1 of.
Where We Stand At this point we know how to: –Convert points from local to window coordinates –Clip polygons and lines to the view volume –Determine which.
Computer Graphics I, Fall 2010 Implementation II.
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
CS559: Computer Graphics Lecture 12: Antialiasing & Visibility Li Zhang Spring 2008.
01/28/09Dinesh Manocha, COMP770 Visibility Computations Visible Surface Determination Visibility Culling.
Computer Graphics Inf4/MSc 1 Computer Graphics Lecture 5 Hidden Surface Removal and Rasterization Taku Komura.
Hidden Surfaces University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner.
Hidden Surfaces / Depth Test University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner.
CS 445 / 645 Introduction to Computer Graphics Lecture 21 Visibility Visibility.
Visible Surface Detection
Computer Graphics Implementation II
Visibility Week 9, Fri 31 Oct 2003
CSC418 Computer Graphics Back Faces Visibility Algorithms.
Hidden Surfaces Dr. Scott Schaefer.
CSCE 441: Computer Graphics Hidden Surface Removal
Implementation II Ed Angel Professor Emeritus of Computer Science
Visibility: Z Buffering Week 10, Mon 3 Nov 2003
Hidden Surfaces II Week 9, Mon Mar 15
Hidden Surface Removal
Implementation II Ed Angel Professor Emeritus of Computer Science
Presentation transcript:

David Luebke5/11/2015 CS 551 / 645: Introductory Computer Graphics David Luebke

David Luebke5/11/2015 Administrivia l Note changes on homework web page –We were always drawing the icosahedron inside out…oops

David Luebke5/11/2015 Recap: Visible Surface Determination l Reasons for invisible polygons: –Polygon outside the field of view –Polygon is backfacing –Polygon is occluded by object(s) nearer the viewpoint l Algorithms for determining which potions of which polygons are visible (unoccluded) are known as visible surface algorithms

David Luebke5/11/2015 Recap: Occlusion l For most interesting scenes, some polygons will overlap: l To render the correct image, we need to determine which polygons occlude which

David Luebke5/11/2015 Recap: Painter’s Algorithm l Simple approach: render the polygons from back to front, “painting over” previous polygons: l Doesn’t work in general case –Intersecting polygons –Visibility cycles:

David Luebke5/11/2015 Recap: Binary Space Partition (BSP) Trees l Fuchs et al, 1980 l Assumptions: –Static scene –Moving camera l Commonly used in 3-D video games (e.g., Quake), but going out of style l Still a very powerful, general idea, used in many graphics algorithms

David Luebke5/11/2015 Recap: BSP Trees –Preprocess: overlay a binary (BSP) tree on objects in the scene –Runtime: correctly traversing this tree enumerates objects from back to front –Idea: divide space recursively into half-spaces by choosing splitting planes n Splitting planes can be arbitrarily oriented n Notice: nodes are always convex

David Luebke5/11/2015 Recap: BSP Trees

David Luebke5/11/2015 Recap: BSP Trees

David Luebke5/11/2015 Recap: BSP Trees

David Luebke5/11/2015 Recap: BSP Trees

David Luebke5/11/2015 Recap: BSP Trees

David Luebke5/11/2015 Recap: Rendering BSP Trees renderBSP(BSPtree *T) BSPtree *near, far; if (T is a leaf node) renderObject(T) if (eye on left side of T->plane) near = T->left; far = T->right; else near = T->right; far = T->left; renderBSP(far); renderBSP(near);

David Luebke5/11/2015 Recap: Rendering BSP Trees

David Luebke5/11/2015 Recap: Rendering BSP Trees

David Luebke5/11/2015 Recap: BSP Tree Cons l No bunnies were harmed in my example l But what if a splitting plane passes through an object? –Split the object; give half to each node: –Worst case: can create up to O(n 3 ) objects! Ouch

David Luebke5/11/2015 BSP Demo l Really cool demo:

David Luebke5/11/2015 Warnock’s Algorithm (1969) l Elegant scheme based on a powerful general approach common in graphics: if the situation is too complex, subdivide –Start with a root viewport and a list of all primitives –Then recursively: n Clip objects to viewport n If number of objects incident to viewport is zero or one, visibility is trivial n Otherwise, subdivide into smaller viewports, distribute primitives among them, and recurse

David Luebke5/11/2015 Warnock’s Algorithm l What is the terminating condition? l How to determine the correct visible surface in this case?

David Luebke5/11/2015 Warnock’s Algorithm l Pros: –Very elegant scheme –Extends to any primitive type l Cons: –Hard to embed hierarchical schemes in hardware –Complex scenes usually have small polygons and high depth complexity n Thus most screen regions come down to the single-pixel case

David Luebke5/11/2015 The Z-Buffer Algorithm l Both BSP trees and Warnock’s algorithm were proposed when memory was expensive –Example: first 512x512 framebuffer > $50,000! l Ed Catmull (mid-70s) proposed a radical new approach called z-buffering. l The big idea: resolve visibility independently at each pixel

David Luebke5/11/2015 The Z-Buffer Algorithm l We know how to rasterize polygons into an image discretized into pixels:

David Luebke5/11/2015 The Z-Buffer Algorithm l What happens if multiple primitives occupy the same pixel on the screen? Which is allowed to paint the pixel?

David Luebke5/11/2015 The Z-Buffer Algorithm l Idea: retain depth (Z in eye coordinates) through projection transform –Recall canonical viewing volumes (see slide) –Can transform canonical perspective volume into canonical parallel volume with:

David Luebke5/11/2015 The Z-Buffer Algorithm l Augment framebuffer with Z-buffer or depth buffer which stores Z value at each pixel –At frame beginning initialize all pixel depths to  –When rasterizing, interpolate depth (Z) across polygon and store in pixel of Z-buffer –Suppress writing to a pixel if its Z value is more distant than the Z value already stored there n “More distant”: greater than or less than, depending

David Luebke5/11/2015 Interpolating Z l Edge equations: Z is just another planar parameter: z = Ax + By + C –Look familiar? –Total cost: n 1 more parameter to increment in inner loop n 3x3 matrix multiply for setup –See interpolating color discussion from lecture 10 l Edge walking: just interpolate Z along edges and across spans

David Luebke5/11/2015 The Z-Buffer Algorithm l How much memory does the Z-buffer use? l Does the image rendered depend on the drawing order? l Does the time to render the image depend on the drawing order? l How much of the pipeline do occluded polgyons traverse? –What does this imply for the front of the pipeline? –How does Z-buffer load scale with visible polygons? With framebuffer resolution?

David Luebke5/11/2015 Z-Buffer Pros l Simple!!! l Easy to implement in hardware l Polygons can be processed in arbitrary order l Easily handles polygon interpenetration l Enables deferred shading –Rasterize shading parameters (e.g., surface normal) and only shade final visible fragments –When does this help?

David Luebke5/11/2015 Z-Buffer Cons l Lots of memory (e.g. 1280x1024x32 bits) l Read-Modify-Write in inner loop requires fast memory l Hard to do analytic antialiasing l Hard to simulate translucent polygons l Precision issues (scintillating, worse with perspective projection)