Visible-Surface Determination

Slides:



Advertisements
Similar presentations
Computer Graphics - Rasterization -
Advertisements

Visible-Surface Detection(identification)
Hidden Surface Removal - 12 a (Visible Surface determination)
CSC418 Computer Graphics n Polygon normals n Back Faces n Visibility Algorithms.
1 z-buffer and shading ©Anthony Steed Overview n Coping with depth Scan-line depth buffering Z-buffer Recursive sub-division Trade-offs n gouraud.
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.
Visibility in Computer Graphics Toni Sellarès Unversitat de Girona
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.
Hidden Surface Elimination Wen-Chieh (Steve) Lin Institute of Multimedia Engineering I-Chen Lin’ CG Slides, Rich Riesenfeld’s CG Slides, Shirley, Fundamentals.
Visible-surface Detection Computer Graphics Seminar MUM
CS248 Final Review Derek Chan and Abe Davis. CS248 Final Monday, December 8, 3:30 to 6:30 pm Closed book, closed notes Mainly from material in the second.
Vertices and Fragments III Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Other Rendering Techniques Types of rendering – Wireframe techniques – Scan-line conversion – Reyes.
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.
Zakrite ploskve. Problem outline Given a set of 3D objects and a viewing specification, we wish to determine which lines or surfaces are visible, so that.
10/29/02 (c) 2002 University of Wisconsin, CS559 Today Hidden Surface Removal Exact Visibility.
CSC418 Computer Graphics n BSP tree n Z-Buffer n A-buffer n Scanline.
Visible-Surface Detection Jehee Lee Seoul National University.
Solutions to homework #6 Wu Xiaomao May 27, 2004.
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
CS 376 Introduction to Computer Graphics 03 / 21 / 2007 Instructor: Michael Eckmann.
Hidden Surface Removal
Implementation II.
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.
Presented by: Bhavna Agarwal. Given a bunch of 3D objects predefined in x,y,z; order them in geometry.
Computer Graphics I, Fall 2010 Implementation II.
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
Hidden Surface Removal. Visible Surface Invisible Primitives  Why might a polygon be invisible?  Polygon outside the field of view  Polygon is backfacing.
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.
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
Visible surface determination

Computer Graphics Implementation II
Solid Area Scan Conversion or Visible Surface Detection
Introduction to Polygons
Hidden Surface Removal
CSC418 Computer Graphics Back Faces Visibility Algorithms.
Visible-Surface Detection Methods
© University of Wisconsin, CS559 Fall 2004
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
Visibility Computations
Lecture 32: Visible Surface Detection
CSCE 441: Computer Graphics Hidden Surface Removal (Cont.)
Introduction to Computer Graphics with WebGL
Illumination and Shading
Hidden Surface Removal
Lecture 31: Visible Surface Detection
Implementation II Ed Angel Professor Emeritus of Computer Science
Presentation transcript:

Visible-Surface Determination Prof. Lizhuang Ma Shanghai Jiao Tong University

Contents Back-Face Culling The Depth-Sort Algorithm Binary Space-Partitioning Trees The z-Buffer Algorithm Scan-Line Algorithm Visible-Surface Ray Tracing Warnock’s Algorithm

Back-Face Culling = Front Facing

Use cross-product to get the normal of the face (not the actual normal) Use inner-product to check the facing

List-Priority Algorithms The Painter’s Algorithm The Depth-Sort Algorithm Binary Space-Partitioning Trees

The Painter’s Algorithm For the planes with constant z Not for real 3D, just for 2½D Sort all polygons according to the smallest (farthest) z coordinate of each Scan convert each polygon in ascending order of smallest z coordinate (i.e., back to front)

The Depth-Sort Algorithm Sort all polygons according to the smallest (farthest) z coordinate of each Resolve any ambiguities that sorting may cause when the polygons’ z extents overlap, splitting polygons if necessary Scan convert each polygon in ascending order of smallest z coordinate (i.e., back to front)

Overlap Cases

Overlap Detection Do the polygons’ x not overlap? Do the polygons’ y not overlap? Is P entirely on the opposite side of Q’s plane from the viewpoint? Is Q entirely on the same side of P’s plane as the viewpoint? Do the projections of the polygons onto the (x,y) plane not overlap?

Binary Space-Partitioning Trees Extremely efficient for static objects

The z-Buffer Algorithm void zBuffer() { int pz; for(each polygon) { for(each pixel in polygon’s projection) { pz=polygon’s z-value at(x,y); if(pz>=ReadZ(x,y)) { writeZ(x,y,pz); writePixel(x,y,color); }

The z-Buffer Algorithm

The z-Buffer Algorithm

Scan-Line Algorithm

Scan-Line Algorithm ET entry: PT entry: x ymax dx ID ID Plane eq. Shading info In-out AET contents Scan line Entries AB AC AB AC FD FE AB DE CB FE AB CB DE FE ET = edge table PT = polygon table AET = active-edge table

General Scan-Line Algorithm Add surfaces to surface table (ST); Initialize active-surface table (AST); for(each scan line) { update AST; for(each pixel on scan line) { determine surfaces in AST that project to pixel; find closest such surface; determine closest surface’s shade at pixel; }

Ray Tracing = Ray Casting Select center of projection and window on viewplane; for(each scan line in image) { for(each pixel in scan line) { determine ray from center of projection through pixel; for(each object in scene) { if(object is intersected and is closest considered thus far) record intersection and object name; } set pixel’s color to that at closest object intersection;

Ray Tracing

Spatial Partitioning

Spatial Partitioning

Spatial Partitioning

Warnock’s Algorithm An area-subdivision algorithm

Warnock’s Algorithm 1. All the polygons are disjoint from the area An area-subdivision algorithm 1. All the polygons are disjoint from the area 2. There is only one intersecting or only one contained polygon 3. There is a single surrounding polygon, but no intersecting or contained polygons 4. More than one polygon is intersecting, contained in, or surrounding the area, but one is a surrounding polygon that is in front of all the other polygons

Warnock’s Algorithm

Warnock’s Algorithm

Performance of Four Algorithms for Visible-Surface Determination Number of Polygons 100 2,500 60,000 Depth sort 1 10 507 Z-buffer 54 Scan line 5 21 Warnock area subdivision 11 64 307