Learning Objectives Classification of Visible Surface Detection Algorithms Classification of Visible Surface Detection Algorithms Back-Face Detection Back-Face.

Slides:



Advertisements
Similar presentations
Visible-Surface Detection(identification)
Advertisements

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:
CAP4730: Computational Structures in Computer Graphics Visible Surface Determination.
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.
1 Computer Graphics Chapter 9 Rendering. [9]-2RM Rendering Three dimensional object rendering is the set of collective processes which make the object.
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
May Visible Surface Detection Shmuel Wimer Bar Ilan Univ., Eng. Faculty Technion, EE Faculty.
UBI 516 Advanced Computer Graphics
Course Website: Computer Graphics 15: More Surface Detection Methods.
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.
CS 4731: Computer Graphics Lecture 18: Hidden Surface Removal Emmanuel Agu.
Hidden Line Removal Adopted from U Strathclyde’s course page.
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.
Visible-surface Detection Computer Graphics Seminar MUM
Vertices and Fragments III Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
Part I: Basics of Computer Graphics Rendering Polygonal Objects (Read Chapter 1 of Advanced Animation and Rendering Techniques) Chapter
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.
CS 450: COMPUTER GRAPHICS VISIBLE SURFACE DETECTION SPRING 2015 DR. MICHAEL J. REALE.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Modeling of worlds A complicated object be decomposed into simple objects and represented by hierarchical model A world scene usually contain many objects.
Visible-Surface Detection Methods
Visible-Surface Detection Jehee Lee Seoul National University.
Quadratic Surfaces. SPLINE REPRESENTATIONS a spline is a flexible strip used to produce a smooth curve through a designated set of points. We.
Hidden Surface Removal 1.  Suppose that we have the polyhedron which has 3 totally visible surfaces, 4 totally invisible/hidden surfaces, and 1 partially.
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.
Chris Mayer & Nic Shulver Hidden Surface Wire frame drawings Wire frame drawings are quick to produce but are often confusing It is difficult to determine.
Visible-Surface Detection Methods
Binary Space Partitioning Trees Ray Casting Depth Buffering
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.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Graphic pipeline  Scan-conversion algorithm (high level)  Pixels.
Visible Surface Detection
Computer Graphics I, Fall 2010 Implementation II.
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.
CS 325 Introduction to Computer Graphics 03 / 10 / 2010 Instructor: Michael Eckmann.
1 Computer Graphics Week11 : Hidden Surface Removal.
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 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.)
BACK FACE DETECTION back-face detection Determination of whether a face of an object is facing backward and therefore invisible. The usual test is whether.
Visible-Surface Detection Methods
Hidden Surfaces Dr. Scott Schaefer.
3D Rendering Pipeline Hidden Surface Removal 3D Primitives
Implementation II Ed Angel Professor Emeritus of Computer Science
Visibility (hidden surface removal)
CSCE 441: Computer Graphics Hidden Surface Removal (Cont.)
CSCE 441: Computer Graphics Hidden Surface Removal (Cont.)
Introduction to Computer Graphics with WebGL
Implementation II Ed Angel Professor Emeritus of Computer Science
Presentation transcript:

Learning Objectives Classification of Visible Surface Detection Algorithms Classification of Visible Surface Detection Algorithms Back-Face Detection Back-Face Detection Depth-Buffer Method Depth-Buffer Method Scan-Line Method Scan-Line Method Depth-Sorting Method Depth-Sorting Method Wire-Frame Visibility Methods Wire-Frame Visibility Methods OpenGL Visibility Detection Functions OpenGL Visibility Detection Functions

Visible Surface Detection A major consideration in the generatation of realistic graphics is determining what is visible within a scene from a chosen viewing position A major consideration in the generatation of realistic graphics is determining what is visible within a scene from a chosen viewing position Algorithms to detect visible objects are referred to as visible-surface detection methods Algorithms to detect visible objects are referred to as visible-surface detection methods

Classification of Visible Surface Detection Algorithms Object-space methods Object-space methods Compares objects and parts of object to each other within the scene definition to determine which surfaces should be marked as visible Compares objects and parts of object to each other within the scene definition to determine which surfaces should be marked as visible Image-space methods Image-space methods Visibility is decided point by point at each pixel position Visibility is decided point by point at each pixel position

Back-Face Detection A fast and simple object-space method for locating back faces A fast and simple object-space method for locating back faces A point (x,y,z) is “inside” a polygon surface with plane parameters A, B, C, D if : A point (x,y,z) is “inside” a polygon surface with plane parameters A, B, C, D if : Ax + By + Cz + D < 0 When an inside point is along the line of sight to the surface, the polygon must be a back face and so cannot be seen When an inside point is along the line of sight to the surface, the polygon must be a back face and so cannot be seen

Back-Face Detection The test is simplified by considering the normal vector N to the polygon and the viewing vector V The test is simplified by considering the normal vector N to the polygon and the viewing vector V This is back face if This is back face if V · N > 0

Depth Buffer Method A commonly used image-space approach A commonly used image-space approach Each surface is processed separately, one point at a time Each surface is processed separately, one point at a time Also called the z-buffer method Also called the z-buffer method It is generally hardware implemented It is generally hardware implemented

Depth Buffer Method 3 surfaces overlap at (x,y). S 1 has the smallest depth value 3 surfaces overlap at (x,y). S 1 has the smallest depth value

Depth Buffer Method Two buffers are needed Two buffers are needed Depth buffer (distance information) Depth buffer (distance information) Frame buffer (intensity/color information) Frame buffer (intensity/color information)

Depth Buffer Method Depth-Buffer Algorithm Depth-Buffer Algorithm for all (x,y) depthBuff(x,y) = 1.0, frameBuff(x,y)=backgndcolor 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) frameBuff(x,y)=surfColor(x,y)

Scan-Line Method Image space method Image space method Extension of scan-line algorithm for polygon filling Extension of scan-line algorithm for polygon filling As each scan line is processed, all polygon surface projections intersecting that line are examined to determine which are visible As each scan line is processed, all polygon surface projections intersecting that line are examined to determine which are visible

Scan-Line Method Example Example

Depth-Sorting Method Both image-space and object-space operations Both image-space and object-space operations Also called painter’s algorithm Also called painter’s algorithm Surfaces sorted in order of increasing depth Surfaces sorted in order of increasing depth Surfaces scan-converted in order, starting with the surface of greatest depth Surfaces scan-converted in order, starting with the surface of greatest depth B behind A as seen by viewer Fill B then A

Display all object edges – difficult to determine front and back Display all object edges – difficult to determine front and back Depth cueing – displayed intensity of a line is a function of its distance from the viewer Depth cueing – displayed intensity of a line is a function of its distance from the viewer Wire-Frame Visibility Methods

Detect hidden lines and display them differently Detect hidden lines and display them differently

Wire-Frame Surface-Visibility Compare edge positions with surface positions Compare edge positions with surface positions Similar to line clipping, but we need to compare depths as well Similar to line clipping, but we need to compare depths as well

Wire-Frame Depth Cueing Vary the brightness of objects in a scene as a function of distance from the viewing position Vary the brightness of objects in a scene as a function of distance from the viewing position Multiply each pixel color by: Where d is the distance of a point from the viewing position

OpenGL Visibility Detection Functions Back-face removal: Back-face removal: glEnable(GL_CULL_FACE); glCullFace(mode); GL_BACK, GL_FRONT, GL_FRONT_AND_BACK glDisable(GL_CULL_FACE); default GL_BACK is default. Sometimes we want to see the back faces, for example if we are in a room we can use GL_FRONT GL_BACK is default. Sometimes we want to see the back faces, for example if we are in a room we can use GL_FRONT

OpenGL Visibility Detection Functions Depth-buffer functions: Request depth buffer when initializing: Request depth buffer when initializing:glutInitDisplayMode(GLUT_SINGLE|GLUT_RGB|GLUT_DEPTH); Clear depth buffer each time a new frame is displayed: Clear depth buffer each time a new frame is displayed: glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); OpenGL depth-buffer visibility-detection routines can be activated with OpenGL depth-buffer visibility-detection routines can be activated with glEnable(GL_DEPTH_TEST); and deactivated with and deactivated with glDisable(GL_DEPTH_TEST);

OpenGL Visibility Detection Functions Wire-frame surface visibility: Wire-frame surface visibility: glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);

OpenGL Visibility Detection Functions Depth cueing: Depth cueing:glEnable(GL_FOG); glFogi(GL_FOG_MODE, GL_LINEAR); This applies the linear depth function to object colors using d min =0.0 and d max =1.0. We can set different values for d min and d max with the following function calls This applies the linear depth function to object colors using d min =0.0 and d max =1.0. We can set different values for d min and d max with the following function calls glFogf(GL_FOG_START, minDepth); glFogf(GL_FOG_END, maxDepth);