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,

Slides:



Advertisements
Similar presentations
Computer Graphics - Rasterization -
Advertisements

Visible-Surface Detection(identification)
CS-378: Game Technology Lecture #1: Scan Conversion Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic,
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
10/10/02 (c) 2002 University of Wisconsin, CS 559 Last Time Finished viewing: Now you know how to: –Define a region of space that you wish to view – the.
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.
David Luebke5/11/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
Hidden Surface Removal CSE 581. Visibility Assumption: All polygons are opaque What polygons are visible with respect to your view frustum?  Outside:
CECS461 Computer Graphics II University of Missouri at Columbia Hidden Surface Removal.
CHAPTER 12 Height Maps, Hidden Surface Removal, Clipping and Level of Detail Algorithms © 2008 Cengage Learning EMEA.
Visibility in Computer Graphics Toni Sellarès Unversitat de Girona
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.
Vertices and Fragments I CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
A lion in the desert How do you find a lion in the desert? How about when you have a predicate that tells you if the lion is in front or behind a separating.
Hidden Surface Elimination Wen-Chieh (Steve) Lin Institute of Multimedia Engineering I-Chen Lin’ CG Slides, Rich Riesenfeld’s CG Slides, Shirley, Fundamentals.
1 Clipping and Hidden Surfaces CS-184: Computer Graphics Prof. James O’Brien.
A lion in the desert How do you find a lion in the desert? How about when you have a predicate that tells you if the lion is in front or behind a separating.
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.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Other Rendering Techniques Types of rendering – Wireframe techniques – Scan-line conversion – Reyes.
10/11/2001CS 638, Fall 2001 Today Kd-trees BSP Trees.
2/26/04© University of Wisconsin, CS559 Spring 2004 Last Time General Orthographic Viewing –Specifying cameras in world coordinates –Building world  view.
Hidden Surface Removal
Graphics Pipeline Hidden Surfaces CMSC 435/634. Visibility We can convert simple primitives to pixels Which primitives (or parts of primitives) should.
Graphics Pipeline Hidden Surface CMSC 435/634. Visibility We can convert simple primitives to pixels/fragments How do we know which primitives (or which.
10/29/02 (c) 2002 University of Wisconsin, CS559 Today Hidden Surface Removal Exact Visibility.
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.
CS 325 Introduction to Computer Graphics 03 / 08 / 2010 Instructor: Michael Eckmann.
CSC418 Computer Graphics n BSP tree n Z-Buffer n A-buffer n Scanline.
The BSP-tree from Prof. Seth MIT.. Motivation for BSP Trees: The Visibility Problem We have a set of objects (either 2d or 3d) in space. We have.
CS-378: Game Technology Lecture #2.1: Projection Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica.
10/26/04© University of Wisconsin, CS559 Fall 2004 Last Time Drawing lines Polygon fill rules Midterm Oct 28.
Visible-Surface Detection Jehee Lee Seoul National University.
03/14/02 (c) 2002 University of Wisconsin, CS559 Last Time Some more visibility (Hidden Surface Removal) algorithms –A-buffer –Scanline –Depth sorting.
3/23/04© University of Wisconsin, CS559 Spring 2004 Last Time Antialiasing –Area-weighted sampling Visibility –Painters algorithm –Depth buffer (Z-buffer)
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.
CS 325 Introduction to Computer Graphics 03 / 22 / 2010 Instructor: Michael Eckmann.
Binary Space Partitioning Trees Ray Casting Depth Buffering
Implementation II.
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.
1 3D Hidden Surface Removal 김 성 남. 2 Contents Goal Motivation Approaches - back face detection - depth buffer - A-buffer - Scan line - Depth.
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.
1Computer Graphics Implementation 1 Lecture 15 John Shearer Culture Lab – space 2
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.
BSP Tree Supplement Jyun-Ming Chen. Fall Kd-Tree and BSP tree kd-tree is a special kind of bsp tree.
Computer Graphics Inf4/MSc 1 Computer Graphics Lecture 5 Hidden Surface Removal and Rasterization Taku Komura.
Visible-Surface Detection Methods. To identify those parts of a scene that are visible from a chosen viewing position. Surfaces which are obscured by.
Lecture 30: Visible Surface Detection
Computer Graphics Implementation II
(c) 2002 University of Wisconsin, CS559
CSC418 Computer Graphics Back Faces Visibility Algorithms.
© University of Wisconsin, CS559 Fall 2004
© University of Wisconsin, CS559 Spring 2004
Graphics Pipeline Hidden Surfaces
CSCE 441: Computer Graphics Hidden Surface Removal
Implementation II Ed Angel Professor Emeritus of Computer Science
CS-378: Game Technology Lecture #1: Scan Conversion Prof. Okan Arikan
© University of Wisconsin, CS559 Fall 2004
Introduction to Computer Graphics with WebGL
Hidden Surface Removal
Implementation II Ed Angel Professor Emeritus of Computer Science
Presentation transcript:

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, Zoran Popovic, Jessica Hodgins V

2 Today Clipping Clipping to view volume Clipping arbitrary polygons Hidden Surface Removal Z-Buffer BSP Trees Others

3 Clipping Stuff outside view volume should not be drawn Too close: obscures view

4 Clipping Stuff outside view volume should not be drawn Too close: obscures view Too far: Complexity Z-buffer problems Too high/low/right/left: Memory errors Broken algorithms Complexity

5 Clipping Line to Line/Plane Line segment to be clipped Line/plane that clips it

6 Clipping Line to Line/Plane Line segment to be clipped Line/plane that clips it

7 Clipping Line to Line/Plane Segment may be on one side Lines may be parallel

8 Polygon Clip to Convex Domain Convex domain defined by collection of planes (or lines or hyper-planes) Planes have outward pointing normals Clip against each plane in turn Check for early/trivial rejection

9 Polygon Clip to Convex Domain

10 Polygon Clip to Convex Domain

11 Polygon Clip to Convex Domain Sutherland-Hodgman algorithm Basically edge walking Clipping done often... should be efficient Liang-Barsky parametric space algorithm See text for clipping in 4D homogenized coordiantes

12 General Polygon Clipping

13 Weiler Algorithm Double edges General Polygon Clipping

14 Hidden Surface Removal True 3D to 2D projection would put every thing overlapping into the view plane. We need to determine what’s in front and display only that.

15 Z-Buffers Add extra depth channel to image Write Z values when writing pixels Test Z values before writing

16 Z-Buffers Benefits Easy to implement Works for most any geometric primitive Parallel operation in hardware Limitations Quantization and aliasing artifacts Overfill Transparency does not work well

17 Z-Buffers Transparency requires partial sorting:

18 Z-Buffers Recall depth-value distortions. It’s a feature... More resolution near viewer Best use of limited precision

19 A-Buffers Store sorted list of “fragments” at each pixel Draw all opaque stuff first then transparent Stuff behind full opacity gets ignored Nice for antialiasing...

20 Scan-line Algorithm Assume polygons don’t intersect Each time an edge is crossed determine who’s on top

21 Painter’s Algorithm Sort Polygons Front-to-Back Draw in order Back-to-Front works also, but wasteful How to sort quickly? Intersecting polygons? Cycles?

22 BSP-Trees Binary Space Partition Trees Split space along planes Allows fast queries of some spatial relations Simple construction algorithm Select a plane as sub-tree root Everything on one side to one child Everything on the other side to other child Use random polygon for splitting plane

23 BSP-Trees

24 BSP-Trees

25 BSP-Trees

26 BSP-Trees

27 BSP-Trees

28 BSP-Trees

29 Visibility Traversal Variation of in-order-traversal Child one Sub-tree root Child two Select “child one” based on location of viewpoint Child one on same side of sub-tree root as viewpoint

30 BSP-Trees

31 BSP-Trees

32 Suggested Reading Fundamentals of Computer Graphics by Pete Shirley Chapter 7 Clipping in chapter 11.1 and 11.2