Werner Purgathofer

Similar documents
Visible Surface Detection Methods

4.5 VISIBLE SURFACE DETECTION METHODES

CEng 477 Introduction to Computer Graphics Fall 2007

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

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

9. Visible-Surface Detection Methods

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

Hidden-Surface Removal.

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

Computer Graphics. Bing-Yu Chen National Taiwan University

Computer Graphics II

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

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

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

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

8. Hidden Surface Elimination

CSE528 Computer Graphics: Theory, Algorithms, and Applications

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

8. Hidden Surface Elimination

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

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

COMP30019 Graphics and Interaction Scan Converting Polygons and Lines

FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

(Refer Slide Time 03:00)

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

Hidden surface removal. Computer Graphics

Topic #1: Rasterization (Scan Conversion)

Hidden Surface Removal

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

Pipeline Operations. CS 4620 Lecture 10

Visible Surface Determination: Intro

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

Visibility and Occlusion Culling

VIII. Visibility algorithms (II)

Einführung in Visual Computing

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

From Vertices To Fragments-1

CS488. Visible-Surface Determination. Luc RENAMBOT

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

(Refer Slide Time 05:03 min)

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

3D Rasterization II COS 426

CHAPTER 1 Graphics Systems and Models 3

CS 130 Exam I. Fall 2015

Pipeline Operations. CS 4620 Lecture 14

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

Direct Rendering of Trimmed NURBS Surfaces

Computer Graphics: 8-Hidden Surface Removal

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

graphics pipeline computer graphics graphics pipeline 2009 fabio pellacini 1

Visibility: Z Buffering

CS4620/5620: Lecture 14 Pipeline

Shadows. COMP 575/770 Spring 2013

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

Ray Tracing. CS334 Fall Daniel G. Aliaga Department of Computer Science Purdue University

Graphics and Interaction Rendering pipeline & object modelling

SUMMARY. CS380: Introduction to Computer Graphics Ray tracing Chapter 20. Min H. Kim KAIST School of Computing 18/05/29. Modeling

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

2D rendering takes a photo of the 2D scene with a virtual camera that selects an axis aligned rectangle from the scene. The photograph is placed into

Lecture 11: Ray tracing (cont.)

Hidden Surfaces II. Week 9, Mon Mar 15

Computer Graphics. Lecture 9 Hidden Surface Removal. Taku Komura

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

Intro to Modeling Modeling in 3D

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

Announcements. Midterms graded back at the end of class Help session on Assignment 3 for last ~20 minutes of class. Computer Graphics

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

The Traditional Graphics Pipeline

Computer Graphics Viewing

Course Title: Computer Graphics Course no: CSC209

3D Rendering Pipeline (for direct illumination)

CS184 : Foundations of Computer Graphics Professor David Forsyth Final Examination

Drawing the Visible Objects

3D Object Representation

CS 130 Exam I. Fall 2015

The Traditional Graphics Pipeline

Spatial Data Structures

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

Topics. From vertices to fragments

Graphics (Output) Primitives. Chapters 3 & 4

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

THE DEPTH-BUFFER VISIBLE SURFACE ALGORITHM

CS Computer Graphics: Hidden Surface Removal

Sung-Eui Yoon ( 윤성의 )

Chapter 7 - Light, Materials, Appearance

Determination (Penentuan Permukaan Tampak)

Spatial Data Structures

Other Rendering Techniques CSE 872 Fall Intro You have seen Scanline converter (+z-buffer) Painter s algorithm Radiosity CSE 872 Fall

Rasterization. COMP 575/770 Spring 2013

COMP environment mapping Mar. 12, r = 2n(n v) v

521493S Computer Graphics Exercise 1 (Chapters 1-3)

Advanced 3D-Data Structures

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

Computer Graphics. - Rasterization - Philipp Slusallek

lecture 18 - ray tracing - environment mapping - refraction

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

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

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

Polygon Filling. Can write frame buffer one word at time rather than one bit. 2/3/2000 CS 4/57101 Lecture 6 1

CS 488. More Shading and Illumination. Luc RENAMBOT

Transcription:

Einführung in Visual Computing 186.822 Visible Surface Detection Werner Purgathofer

Visibility in the Rendering Pipeline scene objects in object space object capture/creation ti modeling viewing projection vertex stage ( vertex shader ) transformed vertices in clip space clipping + homogenization scene in normalized device coordinates viewport transformation rasterization ti shading raster image in pixel coordinates 2 pixel stage ( fragment shader )

3D Display: Wireframe Display ZwCAD Software Co.,Ltd Werner Purgathofer 3

3D Display: Depth Cueing = or? depth cueing = intensity decreases with increasing distance Werner Purgathofer 4

3D Display: Visibility visible line and surface identification = or! ZwCAD Software Co.,Ltd Werner Purgathofer 5

3D Display: Visibility Snaptu Werner Purgathofer 6

3D Display: Depth Cueing + Visibility only visible lines intensity it decreases with increasing i distance Gerschon Elber Werner Purgathofer 7

3D Display: Shaded Display shading + depth cueing: ZwCAD Software Co.,Ltd 8 Ansgar Philippsen

Visible Surface Detection identifying visible parts of a scene (also hidden surface elimination) type of algorithm depends on: complexity of scene type of objects available equipment static or animated displays object space methods objects compared to each other image space methods point by point at each pixel location often sorting and coherence used Werner Purgathofer 9

Visible Surface Detection Methods the following algorithms are examples for different classes of methods back face detection depth buffer method scan line method depth sorting method area subdivision i i method octree methods ray casting method Werner Purgathofer 10

Back Face Detection (1) surfaces (polygons) with a surface normal pointing away from the eye cannot be visible (back faces) eliminate them before visibility algorithm! viewing direction can be eliminated: i Werner Purgathofer 11

Back Face Detection (2) eliminating back faces of closed polyhedra view point (x,y,z) inside a polygon surface if Ax + By + Cz + D < 0 or polygon with normal N=(A, B, C) is a back face if N = (A, B, C) V view N 0 V view Werner Purgathofer 12

Back Face Detection (3) object description in viewing coordinates V = (0,0,V ) view z V view N V z C sufficient ient condition: if C 0 then back face negative! z v y v N = (A, B, C) x v V view Werner Purgathofer 13

Back Face Detection (4) complete visibility test for non overlapping convex polyhedra face partially ill hidden by other faces preprocessing step for other objects: about 50% of surfaces are eliminated Werner Purgathofer 14

Depth Buffer Method (1) z buffer method image space method hardware implementation no sorting! Werner Purgathofer 15

Depth Buffer Method (2) two buffers refresh buffer (intensity information) depth hbuffer (distance information) i size corresponds to screen resolution (for every pixel: r, g, b, z) draw something = compare z with z in buffer if z closer toviewer then draw and update dt z in buffer else nothing! Werner Purgathofer 16

Depth Buffer Algorithm Example polygons with corresponding z-values.8.7.3.3.7.6.6.5.4.3.3.6.5.4 image back- ground -1-1 -1-1 -1-1 -1-1 -1-1 -1-1 -1-1 -1-1 depth- -1-1 -1-1 -1-1 -1-1 -1.8.7-1.8.7 buffer -1-1 -1-1 -1-1.3.3-1.7.6.3.6.7.6-1 -1-1 -1-1 -1 Werner Purgathofer 17-1 -1.3.3.3-1 -1.3.3.6.5.4.3

Depth Buffer Algorithm for all (x,y) framebuff(x,y) = backgroundcolor depthbuff(x,y) = -1 for each polygon P for each position (x,y) on polygon P calculate depth z if z > depthbuff(x,y) then depthbuff(x,y) = z framebuff(x,y) = surfcolor(x,y) Werner Purgathofer 18

Depth Buffer: Incremental z Values depth at (x,y): z= depth at (x+1,y): z' = Ax By D C A(x+1) By D D C A = z C depth at (x,y 1): y y 1 D z" = Ax B(y 1) D C B = z C constants! x x+1 Werner Purgathofer 19

Depth Buffer: y Coordinate Intervals determine y coordinate extents of polygon P top scan line lft left edge y scan line intersection ti bottom scan line Werner Purgathofer 20

Depth Buffer: Values down an Edge z = Ax By DA B D C y' = y 1 x' = x 1/m z' = A(x 1/m) B(y 1) D( ) (y ) C y scan line (y 1) scan line = z A/m + B C constant! x x' Werner Purgathofer 21

Scan Line Method image space method extension of scan line algorithm for polygon filling Werner Purgathofer 22

Scan Line Method: Edge & Polygon Tables edge table (all edges, y sorted) coordinate endpoints inverse slope pointers into polygon table polygon table (all polygons) coefficients of plane equation intensity information (pointers into edge table) Werner Purgathofer 23

Scan Line Method: Active Edge List active edge list (all edges crossing current scanline, x sorted, flag) Werner Purgathofer 24

Scan Line Method Example Edge Table: 2,3,1,5,1,1,2,2,5,4,3,3,4,4 Polygon Table:,, 2 1 5 2 active edges active polygons 2 3,2 3 1,5,2,1,3,1 1 1,, 1 1 4 2,2,5,3,1,5,, 3 3 5 3,3,1,5, 4 Werner Purgathofer / Computergraphik 1 25 4 3,1

Scan Line Method Coherence coherence between adjacent scan lines incremental calculations active edge lists very similar il (easy sorting, avoid depth calculations) Werner Purgathofer / Einführung in Visual Computing 26

Depth Sorting Method: Overview surfaces sorted in order of decreasing depth (viewing in z direction) approximate sorting using smallest z value (greatest depth) fine tuning to get correct depth order surfaces scan converted in order sorting both thin image and object space scan conversion in image space also called painter s algorithm Werner Purgathofer 27

Depth Sorting Method: Sorting (1) surface S with greatest depth is compared to all other surfaces S' no depth overlap ordering correct depth overlap do further tests in increasing order of complexity z min z max S z' min S' 2 surfaces with no depth overlap z' max Werner Purgathofer 28 z viewing direction x

Depth Sorting Method: Sorting (2) ordering correct if bounding rectangles in xy plane do not overlap check x,y direction separately 2 surfaces with depth overlap but no overlap in the x direction S viewing direction S' Werner Purgathofer 29 z x x' x' min x max min x max

Depth Sorting Method: Sorting (3) ordering correct if S completely behind S' substitute vertices of S into equation of S' overlap in z direction overlap in x direction S S is completely behind ( inside ) the overlapping S' viewing direction S' z Werner Purgathofer 30 x

Depth Sorting Method: Sorting (4) ordering correct if S' completely in front of S substitute vertices of S' into equation of S overlap in x and z direction overlapping S' is completely ltl in S front t( ( outside ) of S, but ts is viewing not completely ltl bhids behind direction S' z Werner Purgathofer 31 x

Depth Sorting Method: Sorting (4) ordering correct if S' completely in front of S substitute vertices of S' into equation of S S is not completely behind ( inside ) the overlapping S' viewing direction S S' z Werner Purgathofer 32 x

Depth Sorting Method: Sorting (5) ordering correct if projections of S, S' in xy plane don t overlap surfaces with overlapping bounding rectangles Werner Purgathofer 33

Depth Sorting Method: Sorting (6) all five tests fail ordering probably wrong interchange surfaces S, S' repeat process for reordered dsurfaces S' S viewing direction S S" S' z x z x surface S has greater depth sorted surface list: S, S', S" should be but obscures S' reordered: S', S", S Werner Purgathofer / Computergraphik 1 34

Depth Sorting: Special Cases avoiding infinite loops due to cyclic overlap reordered surfaces S' are flagged if S' would have to be reordered again divide S' into two parts intersecting or cyclically overlapping surfaces! Werner Purgathofer / Einführung in Visual Computing 35

Area Subdivision Method (1) image space method area coherence exploited viewing area subdivided until visibility decision very easy Werner Purgathofer 36

Area Subdivision Method (2) relationship polygon rectangular view area outside inside overlapping surrounding surface surface surface surface only these four possibilities Werner Purgathofer 37

Area Subdivision Method (3) three easy visibility ibilit decisions i all surfaces are outside tid of viewing i area only one inside,, overlapping, or surrounding surface is in the area one surrounding surface obscures all other surfaces within the viewing area Werner Purgathofer 38

Area Subdivision Method (4) a surrounding obscuring surface surfaces ordered according to minimum depth maximum depth of surrounding surface closest to view plane? test is conservative viewing direction z surrounding surface area z max z min x Werner Purgathofer 39

Area Subdivision Method (5) if all three tests fail do subdivision subdivide area into four equal subareas outside and surrounding surfaces will remain in this status for all subareas some inside and overlapping surfaces will be eliminated if no further subdivision possible (pixel resolution reached) sort surfaces and take tk intensity it of nearest surface Werner Purgathofer 40

Area Subdivision Method Example 1 2 3 4 finished Werner Purgathofer

Octree Methods recursive traversal of octree traversal order depends on processing direction front to back: to pixel(xy) pixel(x,y) written once completely obscured nodes are not traversed back to front: t painter s algorithm viewing i direction Werner Purgathofer 42

Octree Methods recursive traversal of octree traversal order depends on processing direction front to back: to pixel(xy) pixel(x,y) written once completely obscured nodes are not traversed viewing direction back to front: t painter s algorithm Werner Purgathofer 43

Ray Casting Method (1) line of sight of each pixel is intersected with all surfaces take closest intersected surface closest viewing intersection direction point Werner Purgathofer 44

Ray Casting Method (2) based on geometric optics, tracing paths of light rays backward tracing of light rays suitable for complex, curved surfaces special case of ray tracing algorithms efficient ray surface intersection techniques necessary intersection point normal vector Werner Purgathofer 45