1 91.427 Computer Graphics I, Fall 2010 Implementation II.

Slides:



Advertisements
Similar presentations
Computer Graphics - Rasterization -
Advertisements

Visible-Surface Detection(identification)
From Vertices to Fragments
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
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.
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.
Hidden Surface Removal Why make the effort?  Realistic models.  Wasted time drawing. OpenGL and HSR  OpenGL does handle HSR using the depth buffer.
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
Part I: Basics of 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.
Vertices and Fragments I CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
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.
Visible-surface Detection Computer Graphics Seminar MUM
Vertices and Fragments III Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Implementation I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
1 Chapter 5 Viewing. 2 Perspective Projection 3 Parallel Projection.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
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.
Objectives Review some advanced topics, including Review some advanced topics, including Chapter 8: Implementation Chapter 8: Implementation Chapter 9:
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Chapter 7: From Vertices to Fragments Ed Angel Professor of Computer Science, Electrical.
CS 325 Introduction to Computer Graphics 03 / 08 / 2010 Instructor: Michael Eckmann.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Implementation Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Objectives Introduce basic implementation strategies Clipping Scan conversion.
From Vertices to Fragments Chapter 7. Part I Objectives Introduce basic implementation strategies Introduce basic implementation strategies Clipping Clipping.
CS 480/680 Computer Graphics Shading in OpenGL Dr. Frederick C Harris, Jr. Fall 2013.
From Vertices to Fragments II Software College, Shandong University Instructor: Zhou Yuanfeng
Visible-Surface Detection Jehee Lee Seoul National University.
1 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Week 3 Lecture 1: Implementation Based on Interactive Computer Graphics (Angel) - Chapter.
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,
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
CS 376 Introduction to Computer Graphics 03 / 21 / 2007 Instructor: Michael Eckmann.
Hidden Surface Removal
Implementation II.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
1Computer Graphics Implementation 1 Lecture 15 John Shearer Culture Lab – space 2
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
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.
Visible surface determination. Problem outline Given a set of 3D objects and a viewing specification, we wish to determine which lines or surfaces are.
Learning Objectives Classification of Visible Surface Detection Algorithms Classification of Visible Surface Detection Algorithms Back-Face Detection Back-Face.
COMPUTER GRAPHICS CS 482 – FALL 2015 NOVEMBER 10, 2015 VISIBILITY CULLING HIDDEN SURFACES ANTIALIASING HALFTONING.
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
Lecture 9 From Vertices to Fragments. Objectives Introduce basic implementation strategies Clipping Rasterization hidden-surface removal.
Chapter 71 Computer Graphics - Chapter 7 From Vertices to Fragments Objectives are: How your program are processed by the system that you are using, Learning.
Computer Graphics Implementation II
Solid Area Scan Conversion or Visible Surface Detection
CSC461: Lecture 20 Parallel Projections in OpenGL
CSCE 441: Computer Graphics Hidden Surface Removal
3D Rendering Pipeline Hidden Surface Removal 3D Primitives
Implementation II Ed Angel Professor Emeritus of Computer Science
Course code: 10CS65 | Computer Graphics and Visualization
Introduction to Computer Graphics with WebGL
From Vertices To Fragments
Implementation II Ed Angel Professor Emeritus of Computer Science
From Vertex to Fragment
From Vertex to Fragment
Presentation transcript:

Computer Graphics I, Fall 2010 Implementation II

Computer Graphics I, Fall 2010 Objectives Introduce clipping algorithms for polygons Survey hidden-surface algorithms

Computer Graphics I, Fall 2010 Polygon Clipping Not as simple as line segment clipping ­Clipping line segment yields at most one line segment ­Clipping polygon can yield multiple polygons However, clipping convex polygon can yield at most one other polygon

Computer Graphics I, Fall 2010 Tessellation and Convexity One strategy: replace nonconvex (concave) polygons with set of triangular polygons (= tessellation) Also makes fill easier Tessellation code in GLU library

Computer Graphics I, Fall 2010 Clipping as a Black Box Can consider line segment clipping as process that takes in two vertices and produces either no vertices or vertices of clipped line segment

Computer Graphics I, Fall 2010 Pipeline Clipping of Line Segments Clipping against each side of window independent of other sides ­Can use four independent clippers in pipeline

Computer Graphics I, Fall 2010 Pipeline Clipping of Polygons Three dimensions: add front and back clippers Strategy used in SGI Geometry Engine Small increase in latency

Computer Graphics I, Fall 2010 Bounding Boxes Rather than doing clipping on complex polygon can use axis-aligned bounding box or extent ­Smallest rectangle aligned with axes that encloses polygon ­Simple to compute: max & min of x and y

Computer Graphics I, Fall 2010 Bounding boxes Can usually determine accept/reject based only on bounding box reject accept requires detailed clipping

Computer Graphics I, Fall 2010 Clipping and Visibility Clipping has much in common with hidden-surface removal In both cases, try to remove objects not visible to camera Often can use visibility or occlusion testing early in process to eliminate as many polygons as possible before going through entire pipeline

Computer Graphics I, Fall 2010 Hidden Surface Removal Object-space approach: use pairwise testing between polygons (objects) Worst case complexity O(n 2 ) for n polygons partially obscuringcan draw independently

Computer Graphics I, Fall 2010 Painter’s Algorithm Render polygons back-to-front ==> polygons behind others painted over B behind A as seen by viewer Fill B then A

Computer Graphics I, Fall 2010 Depth Sort Requires ordering of polygons first ­O(n log n) calculation for ordering ­Not every polygon is either in front or behind all other polygons Order polygons and deal with easy cases first, harder later Polygons sorted by distance from COP

Computer Graphics I, Fall 2010 Easy Cases A lies behind all other polygons ­Can render Polygons overlap in z but not in either x or y ­Can render independently

Computer Graphics I, Fall 2010 Hard Cases Overlap in all directions but one fully on one side of other cyclic overlap penetration

Computer Graphics I, Fall 2010 Back-Face Removal (Culling)  face visible iff 90    -90 equivalently cos   0 or v n  0 plane of face has form ax + by + cz + d = 0 ==> n = [a b c d] T but after normalization n = [ ] T need only test sign of c In OpenGL can simply enable culling but may not work correctly if have nonconvex objects

Computer Graphics I, Fall 2010 Image Space Approach Look at each projector ( nm for n x m frame buffer) find closest of k polygons Complexity O(nmk) Ray tracing z -buffer

Computer Graphics I, Fall 2010 z-Buffer Algorithm Use buffer “z or depth buffer” to store depth of closest object at each pixel found so far As render each polygon, compare depth of each pixel to depth in z buffer If less place shade of pixel in color buffer update z buffer

Computer Graphics I, Fall 2010 Efficiency If work scan line by scan line as move across scan line ==> depth changes satisfy a  x + b  y + c  z = 0 Along scan line  y = 0  z = -  x In screen space  x = 1

Computer Graphics I, Fall 2010 Scan-Line Algorithm Can combine shading and HSR through scan line algorithm scan line i: no need for depth information, can only be in no or one polygon scan line j: need depth information only when in more than one polygon

Computer Graphics I, Fall 2010 Implementation Need data structure to store ­Flag for each polygon (inside/outside) ­Incremental structure for scan lines stores which edges encountered ­Parameters for planes

Computer Graphics I, Fall 2010 Visibility Testing In many realtime applications, e.g., games, want to eliminate as many objects as possible within application ­Reduce burden on pipeline ­Reduce traffic on bus Partition space with Binary Spatial Partition (BSP) Tree

Computer Graphics I, Fall 2010 Simple Example consider 6 parallel polygons top view plane of A separates B and C from D, E and F

Computer Graphics I, Fall 2010 BSP Tree Can continue recursively ­Plane of C separates B from A ­Plane of D separates E and F Can put this information in BSP tree ­Use for visibility and occlusion testing