Vertices and Fragments III Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.

Slides:



Advertisements
Similar presentations
Computer Graphics - Rasterization -
Advertisements

Visible-Surface Detection(identification)
From Vertices to Fragments
CSC418 Computer Graphics n Polygon normals n Back Faces n Visibility Algorithms.
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.
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.
Hidden Surface Removal Why make the effort?  Realistic models.  Wasted time drawing. OpenGL and HSR  OpenGL does handle HSR using the depth buffer.
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 고려대학교 컴퓨터 그래픽스 연구실.
Part I: Basics of Computer Graphics
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.
CS 4731: Computer Graphics Lecture 18: Hidden Surface Removal Emmanuel Agu.
Computer Graphics 14: Surface Detection Methods
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,
Visible-surface Detection Computer Graphics Seminar MUM
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.
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.
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,
From Vertices to Fragments Chapter 7. Part I Objectives Introduce basic implementation strategies Introduce basic implementation strategies Clipping Clipping.
CSC418 Computer Graphics n BSP tree n Z-Buffer n A-buffer n Scanline.
From Vertices to Fragments II Software College, Shandong University Instructor: Zhou Yuanfeng
Week 2 - Friday.  What did we talk about last time?  Graphics rendering pipeline  Geometry Stage.
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.
Visible-Surface Detection Methods
CS 325 Introduction to Computer Graphics 03 / 22 / 2010 Instructor: Michael Eckmann.
Binary Space Partitioning Trees Ray Casting Depth Buffering
Hidden Surface Removal
Implementation II.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Computer Graphics I, Fall 2010 Implementation II.
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.
1 Computer Graphics Week11 : Hidden Surface Removal.
Learning Objectives Classification of Visible Surface Detection Algorithms Classification of Visible Surface Detection Algorithms Back-Face Detection Back-Face.
Visible-Surface Detection Methods. To identify those parts of a scene that are visible from a chosen viewing position. Surfaces which are obscured by.
Hidden Surface Removal. 2 Goal: Determine which surfaces are visible and which are not. Z-Buffer is just one of many hidden surface removal algorithms.
Lecture 30: Visible Surface Detection
Computer Graphics Implementation II
Solid Area Scan Conversion or Visible Surface Detection
Hidden Surface Removal
CSC418 Computer Graphics Back Faces Visibility Algorithms.
CSCE 441: Computer Graphics Hidden Surface Removal (Cont.)
Hidden Surfaces Dr. Scott Schaefer.
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
Presentation transcript:

Vertices and Fragments III Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics

Objectives This lecture: – Survey hidden-surface algorithms. More about these algorithms later CS4395: Computer Graphics 2

Hidden Surface Removal Object-space approach: use pair-wise testing between polygons (objects). Worst case complexity O(n 2 ) for n polygons. Best-case sorting algorithms: O(n log(n)). CS4395: Computer Graphics 3 partially obscuring can draw independently

Painter’s Algorithm Render polygons in back to front order so that polygons behind others are simply painted over. CS4395: Computer Graphics 4 B behind A as seen by viewer Fill B then A

Depth Sort Requires ordering of polygons first: – O(n log n) calculation for ordering. – Not every polygon is in front or behind other polygons. Order polygons and deal with easy cases first, harder later. CS4395: Computer Graphics 5 Polygons sorted by distance from COP

Easy Cases A lies behind all other polygons: – Can render. Polygons overlap in z but not in either x or y: – Can render independently: CS4395: Computer Graphics 6

Hard Cases CS4395: Computer Graphics 7 Overlap in all directions but can render because all vertices of one polygon on one side of the plane of the other polygon. cyclic overlap penetration

Back-Face Removal (Culling)  CS4395: Computer Graphics 8 Face is visible iff 90    -90 equivalently cos   0 or v n  0 Plane of face has form ax + by +cz +d =0 but after normalization n = ( ) T Need only test the sign of c. In OpenGL we can simply enable culling but may not work correctly if we have non-convex objects

Image Space Approach Look at each projector ( nm for an n x m frame buffer) and find closest of k polygons. Complexity O (nmk). Ray tracing. z -buffer. CS4395: Computer Graphics 9

z-Buffer Algorithm Use a buffer called the Z (or depth) buffer to store the depth of the closest object at each pixel found so far. As we render each polygon, compare the depth of each pixel to depth in z-buffer. If less, place shade of pixel in color buffer and update z buffer. CS4395: Computer Graphics 10

Efficiency If we work scan line by scan line as we move across a scan line, the depth changes satisfy a  x + b  y + c  z=0. CS4395: Computer Graphics 11 Along scan line  y = 0  z = -  x In screen space  x = 1

Scan-Line Algorithm Can combine shading and HSR through scan line algorithm. CS4395: Computer Graphics 12 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.

Implementation Need a data structure to store: – Flag for each polygon (inside/outside). – Incremental structure for scan lines that stores which edges are encountered. – Parameters for planes. CS4395: Computer Graphics 13

Visibility Testing In many real-time applications, we want to eliminate as many objects as possible within the application: – Reduce burden on pipeline. – Reduce traffic on bus. Partition with Binary Spatial Partition (BSP) Tree. CS4395: Computer Graphics 14

Simple Example CS4395: Computer Graphics 15 Consider 6 parallel polygons. top view The plane of A separates B and C from D, E and F.

BSP Tree Can continue recursively: – Plane of C separates B from A. – Plane of D separates E and F. Can put this information in a BSP tree: – Use for visibility and occlusion testing. CS4395: Computer Graphics 16

Summary Looked at hidden-surface removal algorithms. OpenGL includes Z-buffering. Better organization of objects required to properly and efficiently render complex scenes. CS4395: Computer Graphics 17