Two basic types: image-precision and object-precision. Image-precision For each pixel, determine which object is visable Requires np operations

Similar documents
9. Visible-Surface Detection Methods

Hidden Surface Removal

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

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

8. Hidden Surface Elimination

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

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

CS488. Visible-Surface Determination. Luc RENAMBOT

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

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

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

Visible Surface Detection Methods

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

Werner Purgathofer

Hidden surface removal. Computer Graphics

CSE528 Computer Graphics: Theory, Algorithms, and Applications

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

4.5 VISIBLE SURFACE DETECTION METHODES

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

Computer Graphics. Bing-Yu Chen National Taiwan University

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

Drawing the Visible Objects

Computer Graphics II

8. Hidden Surface Elimination

2D Graphics Primitives II. Additional issues in scan converting lines. 1)Endpoint order. Want algorithms to draw the same pixels for each line

CEng 477 Introduction to Computer Graphics Fall 2007

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

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

The Graphics Pipeline. Interactive Computer Graphics. The Graphics Pipeline. The Graphics Pipeline. The Graphics Pipeline: Clipping

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

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

Chapter 5. Projections and Rendering

(Refer Slide Time 05:03 min)

THE DEPTH-BUFFER VISIBLE SURFACE ALGORITHM

Must first specify the type of projection desired. When use parallel projections? For technical drawings, etc. Specify the viewing parameters

Visibility and Occlusion Culling

Triangle Rasterization

Determination (Penentuan Permukaan Tampak)

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

Computer Science 426 Midterm 3/11/04, 1:30PM-2:50PM

CS 112 The Rendering Pipeline. Slide 1

Computer Graphics 10 - Shadows

Visualization Concepts

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

CS4620/5620: Lecture 14 Pipeline

Lecture 4. Viewing, Projection and Viewport Transformations

Computer Graphics. Lecture 9 Hidden Surface Removal. Taku Komura

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination

Rendering If we have a precise computer representation of the 3D world, how realistic are the 2D images we can generate? What are the best way to mode

Notes on Assignment. Notes on Assignment. Notes on Assignment. Notes on Assignment

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

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

Topics. From vertices to fragments

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

Pipeline Operations. CS 4620 Lecture 10

Lecture 3 Sections 2.2, 4.4. Mon, Aug 31, 2009

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

Topic #1: Rasterization (Scan Conversion)

Spatial Data Structures

3D Polygon Rendering. Many applications use rendering of 3D polygons with direct illumination

Hidden-Surface Removal.

Spatial Data Structures

Lecture 11: Ray tracing (cont.)

Incremental Form. Idea. More efficient if we look at d k, the value of the decision variable at x = k

COMP30019 Graphics and Interaction Scan Converting Polygons and Lines

3D Rasterization II COS 426

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

Computer Graphics: 8-Hidden Surface Removal

CSE328 Fundamentals of Computer Graphics

Visible Surface Determination: Intro

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

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Realtime 3D Computer Graphics Virtual Reality

Real-Time Rendering (Echtzeitgraphik) Dr. Michael Wimmer

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Convex Polygon Generation

INTRODUCTION TO COMPUTER GRAPHICS. It looks like a matrix Sort of. Viewing III. Projection in Practice. Bin Sheng 10/11/ / 52

Chapter 4. Chapter 4. Computer Graphics 2006/2007 Chapter 4. Introduction to 3D 1

General Hidden Surface Removal Algorithms. Binghamton University. EngiNet. Thomas J. Watson. School of Engineering and Applied Science CS 460/560

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

Rasterization. MIT EECS Frédo Durand and Barb Cutler. MIT EECS 6.837, Cutler and Durand 1

Visibility: Z Buffering

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Computer Graphics 7 - Rasterisation

1999, Denis Zorin. Ray tracing

Projection and viewing. Computer Graphics CSE 167 Lecture 4

Spatial Data Structures

CS 464 Review. Review of Computer Graphics for Final Exam

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

Hidden Surfaces II. Week 9, Mon Mar 15

From Vertices To Fragments-1

Graphics and Interaction Rendering pipeline & object modelling

Culling. Computer Graphics CSE 167 Lecture 12

Spatial Data Structures

CSE 690: GPGPU. Lecture 2: Understanding the Fabric - Intro to Graphics. Klaus Mueller Stony Brook University Computer Science Department

Shadow Algorithms. CSE 781 Winter Han-Wei Shen

Intro to Modeling Modeling in 3D

The Traditional Graphics Pipeline

CSE 167: Introduction to Computer Graphics Lecture #4: Vertex Transformation

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Transcription:

walters@buffalo.edu CSE 480/580 Lecture 21 Slide 1 Visible-Surface Determination (Hidden Surface Removal) Computationaly expensive Two basic types: image-precision and object-precision For n objects and p pixels Image-precision For each pixel, determine which object is visable Requires np operations Object-precision For each object, determine which part(s) hidden by other parts or objects Requires n 2 operations Which is more efficient? n < < p complexity of the "operations" what happens if change the size of the display? Increasing efficiency Basic computations: Intersection of a projector and an object Intersection of two object's projections b c a a' b' c'

walters@buffalo.edu CSE 480/580 Lecture 21 Slide 2 Use coherence to simplify the computations Coherence - the degree to which parts of an environment or it's projections exhibit local similarities Object coherence all of object A may have the same relation to all of object B Face coherence surface properties vary smoothly across a face allows incremental computations ie, depth varies smoothly across the face Edge coherence an edge changes visibility infrequently where?

walters@buffalo.edu CSE 480/580 Lecture 21 Slide 3 Implied Edge Coherence when two planar faces intersect, their line of intersection (their implied edge) can be determined from two points on the intersection Scan-line coherence The set of visible spans of objects differs little from one scan-line to the next For how many scan lines will there be big changes? (assume no accidental alignment) Area coherence A group of adjacent pixels is often covered by the same object When not true?

walters@buffalo.edu CSE 480/580 Lecture 21 Slide 4 Depth coherence neighboring points on a single surface have similar depth adjacent screen points corresponding to different surfaces usually have different depths a b Frame coherence Pictures of same environment at t and t + 1 will be similar Animation - in general most of scene remains the same The perspective transformation Can you do visible surface determination in 2D screen coordinates? Can you do visible surface determination in 3D world coordinates before applying the projection transformation? If do it after the normalizing transformation has been applied (Normalizing transformation transforms the view volume into the canonical view volume) x or y x or y 1 1 -z -1-1 -z -1-1

walters@buffalo.edu CSE 480/580 Lecture 21 Slide 5 x or y 1 x or y 1 -z -1-1 -z -1-1 For parallel projection: How tell if points on the same projector? x1 = x 2 and y1 = y 2 For points on same projector, how tell which is visible? compare z values For perspective projection: How tell if points on the same projector? x1/z1 = x 2/z2 and y2/z2 = y 1/z1 Thus need to do four divisions - expensive Avoid this by first transforming in 3D screen-coordinate system

walters@buffalo.edu CSE 480/580 Lecture 21 Slide 6 y (-1,1,-1) y (-1,1,-1) z z x (a,-a,-a) x (1,-1,0) Canonical Perspective View Volume View Volume in 3D screen coordinates To transform between these two spaces: 1 0 0 0 0 1 0 0 M = 0 0 1/(1+z min) -zmin/(1+z min), 0 > z min > -1 0 0-1 0 Why is it easier to do hidden surface removal in the 3D screen coordinate system? When to clip? Apply Nper to get canonical view volume, then clip then apply M and do hidden surface removal versus Compose Nper and M and apply then clip Is M necessary for parallel projections?

walters@buffalo.edu CSE 480/580 Lecture 21 Slide 7 Extents and Bounding Volumes Simplify visible surface determination by using extents Compute extents (bounding boxes) of objects in 2D screen coordinates If extents don't overlap - no object occlusion If extents do overlap - object occlusion? Also simplifies computing intersection of projector and object If projector doesn't intersect extent - no intersection If projector does intersect extent - intersection with object? Back-face culling For solid polyhedron objects Define surface normal for each face of polyhedron (points out from polyhedron) In eye coordinates, face not visible if dot product of surface normal and projector to any point on surface is nonnegative

walters@buffalo.edu CSE 480/580 Lecture 21 Slide 8 Assume: nf = outwards surface normal of a face q = any point on the face e = eye position (center of projection) Then direction of projector is: v = vector from e to q Face is not a back face if: angle between vectors v and n f is <= ¹/2 dot product of v and n f >= 0

walters@buffalo.edu CSE 480/580 Lecture 21 Slide 9 In 3D screen coordinates y If surface normal has negative z coordinate, then not visable y z z Is this all we have to do for hidden surface determination? For a scene with a single convex polyhedron? DOP For a scene with a single concave polyhedron? DOP For a scene containing multiple polyhedrons? DOP

walters@buffalo.edu CSE 480/580 Lecture 21 Slide 10 Painter's algorithm Sort surfaces by their depth Render in order of furthest to closest Close surfaces overdraw the further surfaces a b c d Rendering order: d, c, b, a When will this work? Let mina be the minimum depth of surface a Let maxa be the maximum depth of surface a What has to be true for the painter's algorithm to always be correct? Problem images

walters@buffalo.edu CSE 480/580 Lecture 21 Slide 11 The z-buffer Algorithm Image-precision algorithm Catmull (1974) Requires additional z-buffer of same width and height in image pixels with depth corresponding to required depth precision of scene Frame Buffer z-buffer Initialize all values in frame buffer to background color Initialize all values in z-buffer to z value of back clipping plane For each pixel in each polygon, If z is closer than value of that pixel in z-buffer, Write z into pixel's location in z-buffer Write polygon pixel value into frame buffer Very simple algorithm to implement Not space efficient Not time efficient How improve space efficiency? Use a scan-line sized z-buffer instead of image sized z-buffer What is the additional cost of this?

walters@buffalo.edu CSE 480/580 Lecture 21 Slide 12 Use depth coherence to reduce computational cost Since polygons are planar, if know the depth of one point on a scan line, then simple to find depth of next point if on same plane for plane defined by: if at (x,y), z = (-D -Ax -By) / C z = z 1 then at (x+1,y) z = z 1 - (A/C)( x) so just one subtraction (A/C) is a constant x = 1 Can do same thing for finding first z value on next scan line To get cutaway views: when do z-buffer algorithm, don't update frame buffer and z-buffer if depth is in front of cut plane Do you need to recompute the z-buffer for this?

walters@buffalo.edu CSE 480/580 Lecture 21 Slide 13 How to add a new object to a scene projection? If saved z-buffer, just apply z-buffer algorithm to the new object using old z-buffer and frame buffer How to add and remove a new object? If want new object in scene, and then be able to remove it without rescanning entire scene Use old z-buffer, but don't update it when scanning new object Use overlay frame buffer Example: move little box of given depth around the scene to get idea of depth of objects