Today. CS-184: Computer Graphics. Lecture #10: Clipping and Hidden Surfaces. Clipping. Hidden Surface Removal

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

CS-184: Computer Graphics. Today. Clipping. Hidden Surface Removal. Tuesday, October 7, Clipping to view volume Clipping arbitrary polygons

CS-184: Computer Graphics. Today. Lecture #10: Clipping and Hidden Surfaces ClippingAndHidden.key - October 27, 2014.

Computer Graphics. Bing-Yu Chen National Taiwan University

Computer Graphics. Lecture 9 Hidden Surface Removal. Taku Komura

VISIBILITY & CULLING. Don t draw what you can t see. Thomas Larsson, Afshin Ameri DVA338, Spring 2018, MDH

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

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

Hidden surface removal. Computer Graphics

8. Hidden Surface Elimination

Drawing the Visible Objects

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

Identifying those parts of a scene that are visible from a chosen viewing position, and only process (scan convert) those parts

CS559: Computer Graphics. Lecture 12: Antialiasing & Visibility Li Zhang Spring 2008

CEng 477 Introduction to Computer Graphics Fall 2007

Renderer Implementation: Basics and Clipping. Overview. Preliminaries. David Carr Virtual Environments, Fundamentals Spring 2005

Computing Visibility. Backface Culling for General Visibility. One More Trick with Planes. BSP Trees Ray Casting Depth Buffering Quiz

Hidden Surface Elimination: BSP trees

Computer Graphics II

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination

Clipping. Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination (Total: 100 marks)

Visible-Surface Detection Methods. Chapter? Intro. to Computer Graphics Spring 2008, Y. G. Shin

Clipping & Culling. Lecture 11 Spring Trivial Rejection Outcode Clipping Plane-at-a-time Clipping Backface Culling

CHAPTER 1 Graphics Systems and Models 3

Visibility and Occlusion Culling

Clipping Lines. Dr. Scott Schaefer

Graphics and Interaction Rendering pipeline & object modelling

More Visible Surface Detection. CS116B Chris Pollett Mar. 16, 2005.

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

Two-Dimensional Viewing. Chapter 6

9. Visible-Surface Detection Methods

CSE328 Fundamentals of Computer Graphics: Concepts, Theory, Algorithms, and Applications

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

More Hidden Surface Removal

Pipeline Operations. CS 4620 Lecture 10

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

Spatial Data Structures

CS 498 VR. Lecture 18-4/4/18. go.illinois.edu/vrlect18

CS452/552; EE465/505. Clipping & Scan Conversion

CS4620/5620: Lecture 14 Pipeline

Spatial Data Structures

VIII. Visibility algorithms (II)

From Vertices To Fragments-1

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Institutionen för systemteknik

Computer Graphics (CS 543) Lecture 9 (Part 2): Clipping. Prof Emmanuel Agu. Computer Science Dept. Worcester Polytechnic Institute (WPI)

8. Hidden Surface Elimination

Computer Graphics. Rendering. by Brian Wyvill University of Calgary. cpsc/enel P 1

Class of Algorithms. Visible Surface Determination. Back Face Culling Test. Back Face Culling: Object Space v. Back Face Culling: Object Space.

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

The Traditional Graphics Pipeline

Part IV. 2D Clipping

Computer Graphics. - Clipping - Philipp Slusallek & Stefan Lemme

Solid Modeling. Thomas Funkhouser Princeton University C0S 426, Fall Represent solid interiors of objects

Hidden-Surface Removal.

Visibility: Z Buffering

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

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

Image Precision Silhouette Edges

Aptitude Test Question

Visible Surface Detection. (Chapt. 15 in FVD, Chapt. 13 in Hearn & Baker)

Interactive Computer Graphics A TOP-DOWN APPROACH WITH SHADER-BASED OPENGL

Clipping and Intersection

Painter s HSR Algorithm

Determination (Penentuan Permukaan Tampak)

The Traditional Graphics Pipeline

3D Rendering Pipeline (for direct illumination)

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

The Traditional Graphics Pipeline

QUESTION BANK 10CS65 : COMPUTER GRAPHICS AND VISUALIZATION

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

CS-184: Computer Graphics

CS-184: Computer Graphics. Administrative

Hidden Surfaces II. Week 9, Mon Mar 15

Pipeline Operations. CS 4620 Lecture Steve Marschner. Cornell CS4620 Spring 2018 Lecture 11

GLOBAL EDITION. Interactive Computer Graphics. A Top-Down Approach with WebGL SEVENTH EDITION. Edward Angel Dave Shreiner

Spatial Data Structures

Computer Graphics. The Two-Dimensional Viewing. Somsak Walairacht, Computer Engineering, KMITL

Pipeline Operations. CS 4620 Lecture 14

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

CS123 INTRODUCTION TO COMPUTER GRAPHICS. Clipping. Concepts, Algorithms for line clipping. 1 of 16. Andries van Dam. Clipping - 10/12/17

Last Time: Acceleration Data Structures for Ray Tracing. Schedule. Today. Shadows & Light Sources. Shadows

Z- Buffer Store the depth for each pixel on the screen and compare stored value with depth of new pixel being drawn.

Spatial Data Structures

CS488. Visible-Surface Determination. Luc RENAMBOT

Points and lines, Line drawing algorithms. Circle generating algorithms, Midpoint circle Parallel version of these algorithms

Drawing Fast The Graphics Pipeline

Rendering. Basic Math Review. Rasterizing Lines and Polygons Hidden Surface Remove Multi-pass Rendering with Accumulation Buffers.

Shadows in the graphics pipeline

2D Viewing. Viewing Pipeline: Window-Viewport Transf.

Visible-Surface Detection 1. 2IV60 Computer graphics set 11: Hidden Surfaces. Visible-Surface Detection 3. Visible-Surface Detection 2

CS Computer Graphics: Hidden Surface Removal

Computer Graphics. Shadows

Course Title: Computer Graphics Course no: CSC209

Computer Graphics Viewing

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

Last Time. Correct Transparent Shadow. Does Ray Tracing Simulate Physics? Does Ray Tracing Simulate Physics? Refraction and the Lifeguard Problem

Triangle Rasterization

Transcription:

Today CS-184: Computer Graphics Lecture #10: Clipping and Hidden Surfaces!! Prof. James O Brien University of California, Berkeley! V2015-S-10-1.0 Clipping Clipping to view volume Clipping arbitrary polygons Hidden Surface Removal Z-Buffer BSP Trees Others 2 1 2

Clipping Clipping Stuff outside view volume should not be drawn Too close: obscures view 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 3 4 3 4

Clipping Line to Line/Plane Clipping Line to Line/Plane Line segment to be clipped x(t)=a +t(b a) a Line segment to be clipped x(t)=a +t(b a) a ˆn b ˆn b Line/plane that clips it ˆn x ˆn r = 0 r } Line/plane that clips it ˆn x f = 0 ˆn (a +t(b a)) f = 0 t = f ˆn a ˆn d ˆn a +t(ˆn (b a)) f = 0 5 6 5 6

Clipping Line to Line/Plane Triangle Clip/Split Segment may be on one side a c + c + c + t 62 [0...1] ˆn b Lines may be parallel ˆn d = 0 t = f ˆn a ˆn d - a - - a b - - a b - b ˆn d appleε (Recall comments about numerical issues) Double vertices if you want separation... 7 8 7 8

Polygon Clip to Convex Domain Polygon Clipping Find the part of a polygon inside the clip window? 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 Before Clipping 9 9 10

Polygon Clipping Find the part of a polygon inside the clip window? Sutherland-Hodgman Clipping Clip to each window boundary one at a time After Clipping 11 12

Sutherland-Hodgman Clipping Clip to each window boundary one at a time Sutherland-Hodgman Clipping Clip to each window boundary one at a time 13 14

Sutherland-Hodgman Clipping Clip to each window boundary one at a time Sutherland-Hodgman Clipping Clip to each window boundary one at a time 15 16

Polygon Clip to Convex Domain Polygon Clip to Convex Domain Inside Outside Inside Outside Inside Outside Inside Outside s p p i s Note double edges. p Output p s i p Output i s No output Output i and p 18 17 17 18

Polygon Clip to Convex Domain General Polygon Clipping A B A B Sutherland-Hodgman algorithm Basically edge walking Clipping done often... should be efficient B A Liang-Barsky parametric space algorithm See text for clipping in 4D homogenized coordinates A [ B 19 A \ B 20 19 20

General Polygon Clipping Weiler Algorithm Double edges 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. 21 22 21 22

Z-Buffers Add extra depth channel to image Write Test Z-Buffers Z values when writing pixels Benefits Z values before writing Easy to implement Works for most any geometric primitive Parallel operation in hardware Images from Okan Arikan Limitations Quantization and aliasing artifacts Overfill Transparency does not work well 23 23 24 24

Z-Buffers Z-Buffers Transparency requires partial sorting: Partially transparent Opaque 3rd 2nd Front Partially transparent Opaque 1st 3rd Recall depth-value distortions.! It s a feature... More resolution near viewer Best use of limited precision Opaque 1st Opaque 2nd Good Not Good 25 26 25 26

A-Buffers Scan-line Algorithm Store sorted list of fragments at each pixel Draw all opaque stuff first then transparent Stuff behind full opacity gets ignored Assume polygons don t intersect Each time an edge is crossed determine who s on top! Nice for antialiasing... 27 28 27 28

Painter s Algorithm BSP-Trees Sort Polygons Front-to-Back Draw in order Back-to-Front works also, but wasteful How to sort quickly? Intersecting polygons? Cycles? Binary Space Partition Trees Split space along planes Allows fast queries of some spatial relations Draw Front-to-Back Draw same-side polygons first Draw root node polygon (if any) Draw other-side polygons last 29 30 29 30