Computer Graphics Visible Surface Determination. Goal of Visible Surface Determination To draw only the surfaces (triangles) that are visible, given a.

Slides:



Advertisements
Similar presentations
Visible-Surface Detection(identification)
Advertisements

15.1 Si23_03 SI23 Introduction to Computer Graphics Lecture 15 – Visible Surfaces and Shadows.
8.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 8 Polygon Rendering.
CSC418 Computer Graphics n Polygon normals n Back Faces n Visibility Algorithms.
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
Graphics Pipeline.
3D Graphics Rendering and Terrain Modeling
David Luebke5/11/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
Lecture Fall 2001 Visibility Back-Face Culling Painter’s Algorithm.
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.
1 Computer Graphics Chapter 9 Rendering. [9]-2RM Rendering Three dimensional object rendering is the set of collective processes which make the object.
Visibility in Computer Graphics Toni Sellarès Unversitat de Girona
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.
CS 4731: Computer Graphics Lecture 18: Hidden Surface Removal Emmanuel Agu.
CGDD 4003 THE MASSIVE FIELD OF COMPUTER GRAPHICS.
Clipping & Scan Conversion
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,
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
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.
Abstract: Digital 3D models are used in industry during the design process. Our client, Siemens PLM, creates software to allow these businesses to view.
Hidden Surface Removal
Adapted from Ben Slides
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CSE 381 – Advanced Game Programming Basic 3D Graphics
CS 325 Introduction to Computer Graphics 03 / 08 / 2010 Instructor: Michael Eckmann.
Buffers Textures and more Rendering Paul Taylor & Barry La Trobe University 2009.
Week 2 - Friday.  What did we talk about last time?  Graphics rendering pipeline  Geometry Stage.
Visible-Surface Detection Jehee Lee Seoul National University.
CAP4730: Computational Structures in Computer Graphics 3D Transformations.
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.
Binary Space Partitioning Trees Ray Casting Depth Buffering
Implementation II.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © Visible Surface Determination (VSD) To render or not to render, that is the question… 1 of.
Computer Graphics I, Fall 2010 Implementation II.
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
BSP Tree Supplement Jyun-Ming Chen. Fall Kd-Tree and BSP tree kd-tree is a special kind of bsp tree.
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.
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.
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
COMPUTER GRAPHICS CS 482 – FALL 2015 NOVEMBER 10, 2015 VISIBILITY CULLING HIDDEN SURFACES ANTIALIASING HALFTONING.
Visible-Surface Detection Methods. To identify those parts of a scene that are visible from a chosen viewing position. Surfaces which are obscured by.
Lecture 30: Visible Surface Detection
Visible Surface Detection
Computer Graphics Implementation II
Week 2 - Friday CS361.
Solid Area Scan Conversion or Visible Surface Detection
Hidden Surface Removal
CSC418 Computer Graphics Back Faces Visibility Algorithms.
Intro to 3D Graphics.
CSCE 441: Computer Graphics Hidden Surface Removal (Cont.)
3D Graphics Rendering PPT By Ricardo Veguilla.
CSCE 441: Computer Graphics Hidden Surface Removal
Implementation II Ed Angel Professor Emeritus of Computer Science
Computer Graphics One of the central components of three-dimensional graphics has been a basic system that renders objects represented by a set of polygons.
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:

Computer Graphics Visible Surface Determination

Goal of Visible Surface Determination To draw only the surfaces (triangles) that are visible, given a view point and a view direction

Three reasons to not draw something 1. It isn’t in the view frustum 2. It is “back facing” 3. Something is in front of it (occlusion) We need to do this computation quickly. How quickly?

Surface Normal Surface Normal - vector perpendicular to the surface Three non-collinear points (that make up a triangle), also describes a plane. The normal is the vector perpendicular to this plane.

What do the normals tell us? Q: How can we use normals to tell us which “face” of a triangle we see?

Examine the angle between the normal and the view direction V N Front if V. N <0

Backface Culling Before scan converting a triangle, determine if it is facing you Compute the dot product between the view vector (V) and triangle normal (N) Simplify this to examining only the z component of the normal If N z <0 then it is a front facing triangle, and you should scan convert it What surface visibility problems does this solve? Not solve? Review OpenGL code

Multiple Objects If we want to draw: We can sort in z. What are the advantages? Disadvantages? Called Painter’s Algorithm or splatting.

Painter’s Algorithm Subtleties What do we mean sort in z? That is for a triangle, what is its representative z value? –Minimum z –Maximum z –Polygon’s centroid Work cost = sort + draw We still use Painter’s Algorithms for blended objects (discussed in the Blending Lesson) An object space visibility algorithm

Side View

Even Worse… Why?

Depth Buffers Goal: We want to only draw something if it appears in front of what is already drawn. What does this require? Can we do this on a per object basis?

Depth Buffers We can’t do it object based, it must be image based. What do we know about the x,y,z points where the objects overlap? Remember our “eye” or “camera” is at the origin of our view coordinates. What does that mean need to store?

Side View

Algorithm We need to have an additional value for each pixel that stores the depth value. What is the data type for the depth value? How much memory does this require? Playstation 1 had 2 MB. The first commercial 512 x 512 framebuffer cost $15,000 Called Depth Buffering or Z buffering

Depth Buffer Algorithm Begin frame –Clear color –Clear depth to z = z max Draw Triangles –When scan converting z new pixel < z value at the pixel, set color and z value at the pixel = z new pixel –What does it mean if z new pixel > z value at the pixel ? –Why do we clear the depth buffer? –Now we see why it is sometimes called the z buffer

Computing the z new pixel Q: We can compute the z nsc at the vertices, but what is the z nsc as we scan convert? A: We interpolate z nsc while we scan convert too!

Z Buffer Precision What does the # of bits for a depth buffer element mean? The z from eye space to normalized screen space is not linear. That is we do not have the same precision across z. (we divided by z). In fact, half of our precision is in z=0 and z=0.5. What does this mean? What happens if we do NOT have enough precision?

Z Fighting If we do not have enough precision in the depth buffer, we can not determine which fragment should be “in front”. What does this mean for the near and far plane? We want them to as closely approximate our volume

Z Fighting Zoomed In Run Demo

Depth Buffer Algorithm Pros: –Easy to understand and implement –per pixel “correct” answer –no preprocess –draw objects in any order –no need to redivide objects Cons: –Z precision –additional memory –Z fighting