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

Size: px
Start display at page:

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

Transcription

1 Utah School of Computing Spring 13 Class of Algorithms Lecture Set Visible Surface Determination CS56 Computer Graphics From Rich Riesenfeld Spring 13 Object (Model) Space Algorithms Work in the model data space Image Space Algorithms Work in the projected space Most common VSD domain Utah School of Computing Back Face Culling: Object Space v Back Face Culling: Object Space n n n v n n n v Utah School of Computing 3 Utah School of Computing 4 Back Face Culling Test Back Face Culling: Image Space For Object Space look at sign of For Image Space look at sign of v n n n n n Utah School of Computing 5 n Utah School of Computing 6

2 Utah School of Computing Spring 13 Back Face Culling: Image Space Back Face Culling n n Completes the job for convex polyhedral objects Nonconvex objects need additional processing beyond back face culling Utah School of Computing 7 Utah School of Computing Back Face Culling: Examples Back Face Culling: Examples Utah School of Computing Utah School of Computing Back Face Culling: Examples Back-Face Culling On the surface of a closed manifold, polygons whose normals point away from the camera are always occluded: Utah School of Computing 11 Note: backface culling alone doesn t solve the hidden-surface problem!

3 Utah School of Computing Spring 13 Back-Face Culling Silhouettes Not rendering backfacing polygons improves performance By how much? Reduces by about half the number of polygons to be considered for each pixel For Object Space vn For Image Space n Utah School of Computing Occlusion Painter s Algortihm For most interesting scenes, some polygons will overlap: How do painter s solve this? To render the correct image, we need to determine which polygons occlude which Painter s Algorithm Simple approach: render the polygons from back to front, painting over previous polygons: Painter s Algortihm How do painter s solve this? Sort the polygons in depth order Draw the polygons back-to-front QED Draw blue, then green, then orange Will this work in the general case?

4 Utah School of Computing Spring 13 Painter s Algorithm: Problems Intersecting polygons present a problem Even non-intersecting polygons can form a cycle with no valid visibility order: Analytic Visibility Algorithms Early visibility algorithms computed the set of visible polygon fragments directly, then rendered the fragments to a display: Now known as analytic visibility algorithms Analytic Visibility Algorithms Analytic Visibility Algorithms What is the minimum worst-case cost of computing the fragments for a scene composed of n polygons? Answer: O(n 2 ) So, for about a decade (late 6s to late 7s) there was intense interest in finding efficient algorithms for hidden surface removal We ll talk about two: Binary Space-Partition (BSP) Trees Warnock s Algorithm Binary Space Partition Trees (17) BSP Trees: Objects BSP tree: organie all of space (hence partition) into a binary tree Preprocess: overlay a binary tree on objects in the scene Runtime: correctly traversing this tree enumerates objects from back to front Idea: divide space recursively into half-spaces by choosing splitting planes Splitting planes can be arbitrarily oriented Notice: nodes are always convex

5 Utah School of Computing Spring 13 BSP Trees: Objects BSP Trees: Objects BSP Trees: Objects BSP Trees: Objects if (T is a leaf node) renderobject(t) { renderbsp(far); renderbsp(near); }

6 Utah School of Computing Spring 13

7 Utah School of Computing Spring 13

8 Utah School of Computing Spring 13 3D Polygons: BSP Tree Construction Split along the plane containing any polygon Classify all polygons into positive or negative half-space of the plane If a polygon intersects plane, split it into two Recurse down the negative half-space Recurse down the positive half-space

9 Utah School of Computing Spring 13 Polygons: BSP Tree Traversal Query: given a viewpoint, produce an ordered list of (possibly split) polygons from back to front: BSPnode::Draw(Vec3 viewpt) Classify viewpt: in + or - half-space of node->plane? /* Call that the near half-space */ farchild->draw(viewpt); render node->polygon; /* always on node->plane */ nearchild->draw(viewpt); Intuitively: at each partition, draw the stuff on the farther side, then the polygon on the partition, then the stuff on the nearer side Discussion: BSP Tree Cons No bunnies were harmed in my example But what if a splitting plane passes through an object? Split the object; give half to each node: Ouch Worst case: can create up to O(n 3 ) objects! Nice demo: BSP Demo Summary: BSP Trees Pros: Simple, elegant scheme Only writes to framebuffer (i.e., painters algorithm) Once very popular for video games (but getting less so) Widely used in ray-tacing Cons: Computationally intense preprocess stage restricts algorithm to static scenes Worst-case time to construct tree: O(n 3 ) Splitting increases polygon count Again, O(n 3 ) worst case Warnock s Algorithm (16) PIXAR uses a similar scheme Elegant scheme based on a powerful general approach common in graphics: if the situation is too complex, subdivide Start with a root viewport and a list of all primitives Then recursively: Clip objects to viewport If number of objects incident to viewport is ero or one, visibility is trivial Otherwise, subdivide into smaller viewports, distribute primitives among them, and recurse What is the terminating condition? How to determine the correct visible surface in this case? Warnock s Algorithm

10 Utah School of Computing Spring 13 Warnock s Algorithm Warnock s Algorithm What is the terminating condition? One polygon per cell How to determine the correct visible surface in this case? What is the terminating condition? One polygon per cell How to determine the correct visible surface in this case? Cell = single pixel Warnock s Algorithm The Z-Buffer Algorithm Pros: Very elegant scheme Extends to any primitive type Cons: Hard to embed hierarchical schemes in hardware Complex scenes usually have small polygons and high depth complexity Thus most screen regions come down to the single-pixel case Both BSP trees and Warnock s algorithm were proposed when memory was expensive Example: first 512x512 framebuffer > \$5,! Ed Catmull (mid-7s) proposed a radical new approach called -buffering. The big idea: resolve visibility independently at each pixel The Z-Buffer Algorithm The Z-Buffer Algorithm We know how to rasterie polygons into an image discretied into pixels: What happens if multiple primitives occupy the same pixel on the screen? Which is allowed to paint the pixel?

11 Utah School of Computing Spring 13 The Z-Buffer Algorithm Idea: retain depth (Z in eye coordinates) through projection transform Use canonical viewing volumes Can transform canonical perspective volume into canonical parallel volume with: 1 M min 1 min min n n n f 1 nf -Buffer (Depth Buffer) Conceptually: Sort ( x, y) Sort ( x, y) (max xx xy (min xx xy ) ) Utah School of Computing 62 The Z-Buffer Algorithm Interpolating Z Augment framebuffer with Z-buffer or depth buffer which stores Z value at each pixel At frame beginning initialie all pixel depths to When rasteriing, interpolate depth (Z) across polygon and store in pixel of Z-buffer Suppress writing to a pixel if its Z value is more distant than the Z value already stored there Edge equations: Z is just another planar parameter: = (-D - Ax By) / C If walking across scanline by (x) new = (A/C)(x) Look familiar? Total cost: 1 more parameter to increment in inner loop 3x3 matrix multiply for setup Edge walking: just interpolate Z along edges and across spans The Z-Buffer Algorithm How much memory does the Z-buffer use? Does the image rendered depend on the drawing order? Does the time to render the image depend on the drawing order? How does Z-buffer load scale with visible polygons? With framebuffer resolution? Buffer Spring Utah School of Computing 66

12 Utah School of Computing Spring Buffer (dup) Buffer: Render Spring Utah School of Computing 67 Spring Utah School of Computing Buffer: Render Utah School of Computing 6 -Buffer: Render Utah School of Computing 7 -Buffer: Render Buffer: Render Utah School of Computing 71 Utah School of Computing 72

13 Utah School of Computing Spring 13 -Buffer: Render Buffer: Render Utah School of Computing 73 Utah School of Computing 74 -Buffer: Render Buffer: Render Utah School of Computing 75 Utah School of Computing Buffer: Render Utah School of Computing 77 -Buffer: Render Utah School of Computing 7

14 Utah School of Computing Spring 13 -Buffer: Render Buffer: Render Utah School of Computing 7 1 Utah School of Computing -Buffer: Render Buffer: Render Utah School of Computing 1 1 Utah School of Computing 2 -Buffer: Render Buffer: Render Utah School of Computing 3 1 Utah School of Computing 4

15 Utah School of Computing Spring 13 -Buffer: Render Buffer: Render Utah School of Computing 5 1 Utah School of Computing 6 -Buffer: Render Utah School of Computing 7 -Buffer: Render Utah School of Computing -Buffer: Render Utah School of Computing -Buffer: Render Utah School of Computing

16 Utah School of Computing Spring 13 -Buffer: Render Utah School of Computing 1 -Buffer: Render Utah School of Computing 2 -Buffer: Render Utah School of Computing 3 -Buffer: Render Utah School of Computing 4 -Buffer: Render Utah School of Computing 5 -Buffer: Render Utah School of Computing 6

17 Utah School of Computing Spring 13 -Buffer: Rendering (done) Utah School of Computing 7 -Buffer: Result Utah School of Computing -Buffer: Pros -Buffer: Cons Simple algorithm Easy to implement in hardware Complexity is order N, for polygons No polygon processing order required Easily handles polygon interpenetration Memory intensive Hard to do antialiasing Hard to simulate translucent polygons Precision issues (scintillating, worse with perspective projection) Utah School of Computing Utah School of Computing -Buffer Algorithm Initialie buffer Set background intensity, color <r,g,b> Set depth to max (min) values -Buffer Algorithm As a polygon P is scan converted Calculate depth (x,y) at each pixel (x,y) being processed Compare (x,y) with -Buffer(x,y) Replace -Buffer(x,y) with (x,y) if closer to eye Utah School of Computing 1 Utah School of Computing 2

18 Utah School of Computing Spring 13 -Buffer Algorithm a-buffer Algorithm Convert all polygons Correct image gets generated when done OpenGL: depth-buffer = -Buffer Generates linked list for each pixel Memory of all contributions allows for proper handling of many advanced techniques Even more memory intensive Widely used for high quality rendering Utah School of Computing 3 Utah School of Computing 4 a-buffer Algorithm: Example Utah School of Computing a-buffer Utah School of Computing Utah School of Computing 7 Utah School of Computing

19 Utah School of Computing Spring Utah School of Computing Utah School of Computing Utah School of Computing Utah School of Computing Utah School of Computing 113 Utah School of Computing 1

20 Utah School of Computing Spring Utah School of Computing 1 Utah School of Computing Utah School of Computing 1 Utah School of Computing Utah School of Computing 11 1 Utah School of Computing 1

21 Utah School of Computing Spring Utah School of Computing Utah School of Computing Utah School of Computing Utah School of Computing Utah School of Computing Utah School of Computing 126

22 Utah School of Computing Spring Utah School of Computing Utah School of Computing Utah School of Computing Utah School of Computing Utah School of Computing Utah School of Computing 132

23 Utah School of Computing Spring Utah School of Computing Utah School of Computing Utah School of Computing 135 ing (done) Utah School of Computing 136 a-buffer: Result Utah School of Computing 137 CPU Display List OpenGL Architecture Polynomial Evaluator Pixel Operations Per Vertex Operations & Primitive Assembly Rasteriation Texture Memory Per Fragment Operations Frame Buffer

24 Utah School of Computing Spring 13 Depth Buffering and Hidden Surface Removal Depth Buffering Using OpenGL Color Buffer Display Depth Buffer Request a depth buffer glutinitdisplaymode( GLUT_RGB GLUT_DOUBLE GLUT_DEPTH ); Enable depth buffering glenable( GL_DEPTH_TEST ); Clear color and depth buffers glclear( GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT ); Render scene Swap color buffers An Updated Program Template An Updated Program Template (cont.) void main( int argc, char** argv ) { glutinit( &argc, argv ); glutinitdisplaymode( GLUT_RGB GLUT_DOUBLE GLUT_DEPTH ); glutcreatewindow( Tetrahedron ); init(); glutidlefunc( idle ); glutdisplayfunc( display ); glutmainloop(); } void init( void ) { glclearcolor(.,., 1., 1. ); glenable( GL_DEPTH_TEST ); } void idle( void ) { glutpostredisplay(); } An Updated Program Template (cont.) void drawscene( void ) { GLfloat vertices[] = { }; GLfloat colors[] = { }; glclear( GL_COLOR_BUFFER_BIT GL_DEPTH_BUFFER_BIT ); glbegin( GL_TRIANGLE_STRIP ); /* calls to glcolor*() and glvertex*() */ glend(); glutswapbuffers(); } Lecture Set The End Visible Surface Determination 4

### Visibility: Z Buffering

University of British Columbia CPSC 414 Computer Graphics Visibility: Z Buffering Week 1, Mon 3 Nov 23 Tamara Munzner 1 Poll how far are people on project 2? preferences for Plan A: status quo P2 stays

### Hidden Surfaces II. Week 9, Mon Mar 15

University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2010 Tamara Munzner Hidden Surfaces II Week 9, Mon Mar 15 http://www.ugrad.cs.ubc.ca/~cs314/vjan2010 ews yes, I'm granting the request

### University of British Columbia CPSC 314 Computer Graphics Jan-Apr Tamara Munzner. Hidden Surfaces.

University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2013 Tamara Munzner Hidden Surfaces http://www.ugrad.cs.ubc.ca/~cs314/vjan2013 Clarification: Blinn-Phong Model only change vs Phong model

### CEng 477 Introduction to Computer Graphics Fall 2007

Visible Surface Detection CEng 477 Introduction to Computer Graphics Fall 2007 Visible Surface Detection Visible surface detection or hidden surface removal. Realistic scenes: closer objects occludes the

### CSE528 Computer Graphics: Theory, Algorithms, and Applications

CSE528 Computer Graphics: Theory, Algorithms, and Applications Hong Qin State University of New York at Stony Brook (Stony Brook University) Stony Brook, New York 11794--4400 Tel: (631)632-8450; Fax: (631)632-8334

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

CSE328 Fundamentals of Computer Graphics: Concepts, Theory, Algorithms, and Applications Hong Qin Stony Brook University (SUNY at Stony Brook) Stony Brook, New York 11794-4400 Tel: (631)632-8450; Fax:

### Hidden Surfaces / Depth Test

University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2016 Tamara Munzner Hidden Surfaces / Depth Test http://www.ugrad.cs.ubc.ca/~cs314/vjan2016 Hidden Surface Removal 2 THE REDERIG PIPELIE

### Hidden surface removal. Computer Graphics

Lecture Hidden Surface Removal and Rasterization Taku Komura Hidden surface removal Drawing polygonal faces on screen consumes CPU cycles Illumination We cannot see every surface in scene We don t want

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

Computer Graphics Bing-Yu Chen National Taiwan University The University of Tokyo Hidden-Surface Removal Back-Face Culling The Depth-Sort Algorithm Binary Space-Partitioning Trees The z-buffer Algorithm

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

Computing Visibility BSP Trees Ray Casting Depth Buffering Quiz Power of Plane Equations We ve gotten a lot of mileage out of one simple equation. Basis for D outcode-clipping Basis for plane-at-a-time

### Computer Graphics. Lecture 9 Hidden Surface Removal. Taku Komura

Computer Graphics Lecture 9 Hidden Surface Removal Taku Komura 1 Why Hidden Surface Removal? A correct rendering requires correct visibility calculations When multiple opaque polygons cover the same screen

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

Visible-Surface Detection Methods Chapter? Intro. to Computer Graphics Spring 2008, Y. G. Shin The Visibility Problem [Problem Statement] GIVEN: a set of 3-D surfaces, a projection from 3-D to 2-D screen,

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

Visible Surface Detection Identifying those parts of a scene that are visible from a chosen viewing position, and only process (scan convert) those parts Two approaches: 1. Object space methods 2. Image

### Computer Graphics. Bing-Yu Chen National Taiwan University

Computer Graphics Bing-Yu Chen National Taiwan University Visible-Surface Determination Back-Face Culling The Depth-Sort Algorithm Binary Space-Partitioning Trees The z-buffer Algorithm Scan-Line Algorithm

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

Visible Surface Detection (Chapt. 15 in FVD, Chapt. 13 in Hearn & Baker) 1 Given a set of 3D objects and a viewing specifications, determine which lines or surfaces of the objects should be visible. A

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

Visible Surface Determination Visibility Culling Area-Subdivision Algorithms z-buffer Algorithm List Priority Algorithms BSP (Binary Space Partitioning Tree) Scan-line Algorithms Divide-and-conquer strategy:

### OpenGL refresher. Advanced Computer Graphics 2012

Advanced Computer Graphics 2012 What you will see today Outline General OpenGL introduction Setting up: GLUT and GLEW Elementary rendering Transformations in OpenGL Texture mapping Programmable shading

### ERKELEY DAVIS IRVINE LOS ANGELES RIVERSIDE SAN DIEGO SAN FRANCISCO EECS 104. Fundamentals of Computer Graphics. OpenGL

ERKELEY DAVIS IRVINE LOS ANGELES RIVERSIDE SAN DIEGO SAN FRANCISCO SANTA BARBARA SANTA CRUZ EECS 104 Fundamentals of Computer Graphics OpenGL Slides courtesy of Dave Shreine, Ed Angel and Vicki Shreiner

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

Clipping & Culling Trivial Rejection Outcode Clipping Plane-at-a-time Clipping Backface Culling Lecture 11 Spring 2015 What is Clipping? Clipping is a procedure for spatially partitioning geometric primitives,

### Drawing the Visible Objects

Drawing the Visible Objects We want to generate the image that the eye would see, given the objects in our space How do we draw the correct object at each pixel, given that some objects may obscure others

### CS4620/5620: Lecture 14 Pipeline

CS4620/5620: Lecture 14 Pipeline 1 Rasterizing triangles Summary 1! evaluation of linear functions on pixel grid 2! functions defined by parameter values at vertices 3! using extra parameters to determine

### Painter s Algorithm: Problems

Universit of British Columbia CPSC Computer Graphics Jan-Apr 0 Tamara Munzner Hidden Surfaces Clarification: Blinn-Phong Model onl change vs Phong model is to have the specular calculation to use (h n)

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

CSE 167: Introduction to Computer Graphics Lecture #9: Visibility Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2018 Announcements Midterm Scores are on TritonEd Exams to be

### Computer Graphics. Bing-Yu Chen National Taiwan University

Computer Graphics Bing-Yu Chen National Taiwan University Introduction to OpenGL General OpenGL Introduction An Example OpenGL Program Drawing with OpenGL Transformations Animation and Depth Buffering

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

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

### Ulf Assarsson Department of Computer Engineering Chalmers University of Technology

Ulf Assarsson Department of Computer Engineering Chalmers University of Technology Tracing Photons One way to form an image is to follow rays of light from a point source finding which rays enter the lens

### Programming with OpenGL Part 2: Complete Programs Computer Graphics I, Fall

Programming with OpenGL Part 2: Complete Programs 91.427 Computer Graphics I, Fall 2008 1 1 Objectives Refine first program Alter default values Introduce standard program structure Simple viewing 2-D

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

CSE 167: Introduction to Computer Graphics Lecture #5: Rasterization Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2015 Announcements Project 2 due tomorrow at 2pm Grading window

### Exercise 1 Introduction to OpenGL

Exercise 1 Introduction to OpenGL What we are going to do OpenGL Glut Small Example using OpenGl and Glut Alexandra Junghans 2 What is OpenGL? OpenGL Two Parts most widely used and supported graphics API

### CS Computer Graphics: Hidden Surface Removal

CS 543 - Computer Graphics: Hidden Surface Removal by Robert W. Lindeman gogo@wpi.edu (with help from Emmanuel Agu ;-) Hidden Surface Removal Drawing polygonal faces on screen consumes CPU cycles We cannot

### Computer Graphics II

Computer Graphics II Autumn 2017-2018 Outline Visible Surface Determination Methods (contd.) 1 Visible Surface Determination Methods (contd.) Outline Visible Surface Determination Methods (contd.) 1 Visible

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

VISIBILITY & CULLING Don t draw what you can t see. Thomas Larsson, Afshin Ameri DVA338, Spring 2018, MDH Visibility Visibility Given a set of 3D objects, which surfaces are visible from a specific point

### 9. Visible-Surface Detection Methods

9. Visible-Surface Detection Methods More information about Modelling and Perspective Viewing: Before going to visible surface detection, we first review and discuss the followings: 1. Modelling Transformation:

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

Computer Graphics Rendering by Brian Wyvill University of Calgary cpsc/enel P Rendering Techniques Wire Frame Z Buffer Ray Tracing A Buffer cpsc/enel P 2 Rendering Visible Surface Determination Many Algorithms,

### Pipeline Operations. CS 4620 Lecture 10

Pipeline Operations CS 4620 Lecture 10 2008 Steve Marschner 1 Hidden surface elimination Goal is to figure out which color to make the pixels based on what s in front of what. Hidden surface elimination

### Introduction to Computer Graphics with OpenGL/GLUT

Introduction to Computer Graphics with OpenGL/GLUT What is OpenGL? A software interface to graphics hardware Graphics rendering API (Low Level) High-quality color images composed of geometric and image

### FROM VERTICES TO FRAGMENTS. Lecture 5 Comp3080 Computer Graphics HKBU

FROM VERTICES TO FRAGMENTS Lecture 5 Comp3080 Computer Graphics HKBU OBJECTIVES Introduce basic implementation strategies Clipping Scan conversion OCTOBER 9, 2011 2 OVERVIEW At end of the geometric pipeline,

### OpenGL/GLUT Intro. Week 1, Fri Jan 12

University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2007 Tamara Munzner OpenGL/GLUT Intro Week 1, Fri Jan 12 http://www.ugrad.cs.ubc.ca/~cs314/vjan2007 News Labs start next week Reminder:

### Lecture 4 of 41. Lab 1a: OpenGL Basics

Lab 1a: OpenGL Basics William H. Hsu Department of Computing and Information Sciences, KSU KSOL course pages: http://snipurl.com/1y5gc Course web site: http://www.kddresearch.org/courses/cis636 Instructor

### EECE 478. Learning Objectives. Learning Objectives. Rasterization & Scenes. Rasterization. Compositing

EECE 478 Rasterization & Scenes Rasterization Learning Objectives Be able to describe the complete graphics pipeline. Describe the process of rasterization for triangles and lines. Compositing Manipulate

### Triangle Rasterization

Triangle Rasterization Computer Graphics COMP 770 (236) Spring 2007 Instructor: Brandon Lloyd 2/07/07 1 From last time Lines and planes Culling View frustum culling Back-face culling Occlusion culling

### UNIT 7 LIGHTING AND SHADING. 1. Explain phong lighting model. Indicate the advantages and disadvantages. (Jun2012) 10M

UNIT 7 LIGHTING AND SHADING 1. Explain phong lighting model. Indicate the advantages and disadvantages. (Jun2012) 10M Ans: Phong developed a simple model that can be computed rapidly It considers three

### Topic #1: Rasterization (Scan Conversion)

Topic #1: Rasterization (Scan Conversion) We will generally model objects with geometric primitives points, lines, and polygons For display, we need to convert them to pixels for points it s obvious but

### Basic Graphics Programming

CSCI 480 Computer Graphics Lecture 2 Basic Graphics Programming January 11, 2012 Jernej Barbic University of Southern California http://www-bcf.usc.edu/~jbarbic/cs480-s12/ Graphics Pipeline OpenGL API

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

CSE 167: Introduction to Computer Graphics Lecture #5: Rasterization Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2012 Announcements Homework project #2 due this Friday, October

### Lecture 2 2D transformations Introduction to OpenGL

Lecture 2 2D transformations Introduction to OpenGL OpenGL where it fits what it contains how you work with it OpenGL parts: GL = Graphics Library (core lib) GLU = GL Utilities (always present) GLX, AGL,

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

Pipeline Operations CS 4620 Lecture 11 1 Pipeline you are here APPLICATION COMMAND STREAM 3D transformations; shading VERTEX PROCESSING TRANSFORMED GEOMETRY conversion of primitives to pixels RASTERIZATION

### 8. Hidden Surface Elimination

8. Hidden Surface Elimination Identification and Removal of parts of picture that are not visible from a chosen viewing position. 1 8. Hidden Surface Elimination Basic idea: Overwriting Paint things in

### Intro to OpenGL III. Don Fussell Computer Science Department The University of Texas at Austin

Intro to OpenGL III Don Fussell Computer Science Department The University of Texas at Austin University of Texas at Austin CS354 - Computer Graphics Don Fussell Where are we? Continuing the OpenGL basic

### Ulf Assarsson Department of Computer Engineering Chalmers University of Technology

Ulf Assarsson Department of Computer Engineering Chalmers University of Technology 1. I am located in room 4115 in EDIT-huset 2. Email: 3. Phone: 031-772 1775 (office) 4. Course assistant: Tomas Akenine-Mőller

### Lecture 4. Viewing, Projection and Viewport Transformations

Notes on Assignment Notes on Assignment Hw2 is dependent on hw1 so hw1 and hw2 will be graded together i.e. You have time to finish both by next monday 11:59p Email list issues - please cc: elif@cs.nyu.edu

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

Notes on Assignment Notes on Assignment Objects on screen - made of primitives Primitives are points, lines, polygons - watch vertex ordering The main object you need is a box When the MODELVIEW matrix

### CSE 167: Introduction to Computer Graphics Lecture #5: Visibility, OpenGL

CSE 167: Introduction to Computer Graphics Lecture #5: Visibility, OpenGL Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016 Announcements Tomorrow: assignment 1 due Grading

### Rasterization Overview

Rendering Overview The process of generating an image given a virtual camera objects light sources Various techniques rasterization (topic of this course) raytracing (topic of the course Advanced Computer

### Projection and viewing. Computer Graphics CSE 167 Lecture 4

Projection and viewing Computer Graphics CSE 167 Lecture 4 CSE 167: Computer Graphics Review: transformation from the object (or model) coordinate frame to the camera (or eye) coordinate frame Projection

### Pipeline Operations. CS 4620 Lecture 14

Pipeline Operations CS 4620 Lecture 14 2014 Steve Marschner 1 Pipeline you are here APPLICATION COMMAND STREAM 3D transformations; shading VERTEX PROCESSING TRANSFORMED GEOMETRY conversion of primitives

### Today s Agenda. Basic design of a graphics system. Introduction to OpenGL

Today s Agenda Basic design of a graphics system Introduction to OpenGL Image Compositing Compositing one image over another is most common choice can think of each image drawn on a transparent plastic

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

More Visible Surface Detection CS116B Chris Pollett Mar. 16, 2005. Outline The A-Buffer Method The Scan-Line Method The Depth Sorting Method BSP Trees, Area Subdivision, and Octrees Wire-frame Visibility

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

CS 498 VR Lecture 18-4/4/18 go.illinois.edu/vrlect18 Review and Supplement for last lecture 1. What is aliasing? What is Screen Door Effect? 2. How image-order rendering works? 3. If there are several

### University of British Columbia CPSC 314 Computer Graphics May-June Tamara Munzner Sampling, Virtual Trackball, Hidden Surfaces

University of British Columbia CPSC 314 Computer Graphics May-June 2005 Tamara Munzner Sampling, Virtual Trackball, Hidden Surfaces Week 5, Tue Jun 7 http://www.ugrad.cs.ubc.ca/~cs314/vmay2005 ews Midterm

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

CSE 167: Introduction to Computer Graphics Lecture #5: Projection Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2017 Announcements Friday: homework 1 due at 2pm Upload to TritonEd

### COMP30019 Graphics and Interaction Scan Converting Polygons and Lines

COMP30019 Graphics and Interaction Scan Converting Polygons and Lines Department of Computer Science and Software Engineering The Lecture outline Introduction Scan conversion Scan-line algorithm Edge coherence

### CS559: Computer Graphics. Lecture 12: Antialiasing & Visibility Li Zhang Spring 2008

CS559: Computer Graphics Lecture 12: Antialiasing & Visibility Li Zhang Spring 2008 Antialising Today Hidden Surface Removal Reading: Shirley ch 3.7 8 OpenGL ch 1 Last time A 2 (x 0 y 0 ) (x 1 y 1 ) P

### 11/1/13. Basic Graphics Programming. Teaching Assistant. What is OpenGL. Course Producer. Where is OpenGL used. Graphics library (API)

CSCI 420 Computer Graphics Lecture 2 Basic Graphics Programming Teaching Assistant Yijing Li Office hours TBA Jernej Barbic University of Southern California Graphics Pipeline OpenGL API Primitives: Lines,

### Spatial Data Structures

CSCI 420 Computer Graphics Lecture 17 Spatial Data Structures Jernej Barbic University of Southern California Hierarchical Bounding Volumes Regular Grids Octrees BSP Trees [Angel Ch. 8] 1 Ray Tracing Acceleration

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

Overview Pipeline implementation I Preliminaries Clipping Line clipping Hidden Surface removal Overview At end of the geometric pipeline, vertices have been assembled into primitives Must clip out primitives

### Spatial Data Structures

CSCI 480 Computer Graphics Lecture 7 Spatial Data Structures Hierarchical Bounding Volumes Regular Grids BSP Trees [Ch. 0.] March 8, 0 Jernej Barbic University of Southern California http://www-bcf.usc.edu/~jbarbic/cs480-s/

### Intro to OpenGL II. Don Fussell Computer Science Department The University of Texas at Austin

Intro to OpenGL II Don Fussell Computer Science Department The University of Texas at Austin University of Texas at Austin CS354 - Computer Graphics Don Fussell Where are we? Last lecture, we started the

### Visibility and Occlusion Culling

Visibility and Occlusion Culling CS535 Fall 2014 Daniel G. Aliaga Department of Computer Science Purdue University [some slides based on those of Benjamin Mora] Why? To avoid processing geometry that does

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

Clipping 1 Objectives Clipping lines First of implementation algorithms Clipping polygons (next lecture) Focus on pipeline plus a few classic algorithms 2 Clipping 2D against clipping window 3D against

### Interaction. CSCI 480 Computer Graphics Lecture 3

CSCI 480 Computer Graphics Lecture 3 Interaction January 18, 2012 Jernej Barbic University of Southern California Client/Server Model Callbacks Double Buffering Hidden Surface Removal Simple Transformations

### CHAPTER 1 Graphics Systems and Models 3

?????? 1 CHAPTER 1 Graphics Systems and Models 3 1.1 Applications of Computer Graphics 4 1.1.1 Display of Information............. 4 1.1.2 Design.................... 5 1.1.3 Simulation and Animation...........

### 2 Transformations and Homogeneous Coordinates

Brief solutions to Exam in Computer Graphics Time and place: 08:00 3:00 Tuesday March 7, 2009, Gimogatan 4, sal Grades TD388: 3: 20pts; 4: 26pts; 5: 34pts. Glossary API Application Programmer s Interface.

### Hidden Surface Removal

Outline Introduction Hidden Surface Removal Hidden Surface Removal Simone Gasparini gasparini@elet.polimi.it Back face culling Depth sort Z-buffer Introduction Graphics pipeline Introduction Modeling Geom

### VR-programming tools (procedural) More VRML later in this course! (declarative)

Realtime 3D Computer Graphics & Virtual Reality OpenGL Introduction VR-programming Input and display devices are the main hardware interface to users Immersion embeds users through the generation of live-like

### Determination (Penentuan Permukaan Tampak)

Visible Surface Determination (Penentuan Permukaan Tampak) Visible Surface Determination 1/26 Outline Definisi VSD Tiga Kelas Algoritma VSD Kelas : Conservative Spatial Subdivison Bounding Volume Back

### Spatial Data Structures and Speed-Up Techniques. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

Spatial Data Structures and Speed-Up Techniques Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology Spatial data structures What is it? Data structure that organizes

### Binary Space Partition Trees. Overview. Binary Space Partitioning Trees (Fuchs, Kedem and Naylor `80)

Binary Space Partition Trees Anthony Steed, Yiorgos Chrysanthou 999-200, Celine Loscos 200, Jan Kautz 2007-2009 Overview Previous list priority algorithms fail in a number of cases, non of them is completely

### Graphics and Interaction Rendering pipeline & object modelling

433-324 Graphics and Interaction Rendering pipeline & object modelling Department of Computer Science and Software Engineering The Lecture outline Introduction to Modelling Polygonal geometry The rendering

### Basic Graphics Programming

15-462 Computer Graphics I Lecture 2 Basic Graphics Programming Graphics Pipeline OpenGL API Primitives: Lines, Polygons Attributes: Color Example January 17, 2002 [Angel Ch. 2] Frank Pfenning Carnegie

### Interaction. CSCI 420 Computer Graphics Lecture 3

CSCI 420 Computer Graphics Lecture 3 Interaction Jernej Barbic University of Southern California Client/Server Model Callbacks Double Buffering Hidden Surface Removal Simple Transformations [Angel Ch.

### Hidden Surface Elimination: BSP trees

Hidden Surface Elimination: BSP trees Outline Binary space partition (BSP) trees Polygon-aligned 1 BSP Trees Basic idea: Preprocess geometric primitives in scene to build a spatial data structure such

### Computer Graphics: 8-Hidden Surface Removal

Computer Graphics: 8-Hidden Surface Removal Prof. Dr. Charles A. Wüthrich, Fakultät Medien, Medieninformatik Bauhaus-Universität Weimar caw AT medien.uni-weimar.de Depth information Depth information is

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

Rendering Pipeline Rendering Converting a 3D scene to a 2D image Rendering Light Camera 3D Model View Plane Rendering Converting a 3D scene to a 2D image Basic rendering tasks: Modeling: creating the world

### Announcements. Written Assignment2 is out, due March 8 Graded Programming Assignment2 next Tuesday

Announcements Written Assignment2 is out, due March 8 Graded Programming Assignment2 next Tuesday 1 Spatial Data Structures Hierarchical Bounding Volumes Grids Octrees BSP Trees 11/7/02 Speeding Up Computations

### Interaction Computer Graphics I Lecture 3

15-462 Computer Graphics I Lecture 3 Interaction Client/Server Model Callbacks Double Buffering Hidden Surface Removal Simple Transformations January 21, 2003 [Angel Ch. 3] Frank Pfenning Carnegie Mellon

### Lecture 2. Determinants. Ax = 0. a 11 x 1 + a 12 x a 1n x n = 0 a 21 x 1 + a 22 x a 2n x n = 0

A = a 11 a 12... a 1n a 21 a 22... a 2n. a n1 a n2... a nn x = x 1 x 2. x n Lecture 2 Math Review 2 Introduction to OpenGL Ax = 0 a 11 x 1 + a 12 x 2 +... + a 1n x n = 0 a 21 x 1 + a 22 x 2 +... + a 2n

### 2/3/16. Interaction. Triangles (Clarification) Choice of Programming Language. Buffer Objects. The CPU-GPU bus. CSCI 420 Computer Graphics Lecture 3

CSCI 420 Computer Graphics Lecture 3 Interaction Jernej Barbic University of Southern California [Angel Ch. 2] Triangles (Clarification) Can be any shape or size Well-shaped triangles have advantages for

### Computer graphic -- Programming with OpenGL I

Computer graphic -- Programming with OpenGL I A simple example using OpenGL Download the example code "basic shapes", and compile and run it Take a look at it, and hit ESC when you're done. It shows the

### An Interactive Introduction to OpenGL Programming

Define a buffer by its spatial resolution (n n x m) ) and its depth (or precision) k,, the number of bits/pixel Buffers pixel Angel and Shreiner: Interactive Computer Graphics 7E Addison-Wesley 2015 2

### Lectures OpenGL Introduction

Lectures OpenGL Introduction By Tom Duff Pixar Animation Studios Emeryville, California and George Ledin Jr Sonoma State University Rohnert Park, California 2004, Tom Duff and George Ledin Jr 1 What is

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

CS452/552; EE465/505 Clipping & Scan Conversion 3-31 15 Outline! From Geometry to Pixels: Overview Clipping (continued) Scan conversion Read: Angel, Chapter 8, 8.1-8.9 Project#1 due: this week Lab4 due:

### To Do. Computer Graphics (Fall 2008) Course Outline. Course Outline. Methodology for Lecture. Demo: Surreal (HW 3)

Computer Graphics (Fall 2008) COMS 4160, Lecture 9: OpenGL 1 http://www.cs.columbia.edu/~cs4160 To Do Start thinking (now) about HW 3. Milestones are due soon. Course Course 3D Graphics Pipeline 3D Graphics

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

INFOGR Computer Graphics J. Bikker - April-July 2016 - Lecture 11: Visibility Welcome! Smallest Ray Tracers: Executable 5692598 & 5683777: RTMini_minimal.exe 2803 bytes 5741858: ASM_CPU_Min_Exe 994 bytes

### Today. CS-184: Computer Graphics. Lecture #10: Clipping and Hidden Surfaces. Clipping. Hidden Surface Removal

Today CS-184: Computer Graphics Lecture #10: Clipping and Hidden Surfaces!! Prof. James O Brien University of California, Berkeley! V2015-S-10-1.0 Clipping Clipping to view volume Clipping arbitrary polygons

### GL_COLOR_BUFFER_BIT, GL_PROJECTION, GL_MODELVIEW

OpenGL Syntax Functions have prefix gl and initial capital letters for each word glclearcolor(), glenable(), glpushmatrix() glu for GLU functions glulookat(), gluperspective() constants begin with GL_,

### CMSC 425: Lecture 4 More about OpenGL and GLUT Tuesday, Feb 5, 2013

CMSC 425: Lecture 4 More about OpenGL and GLUT Tuesday, Feb 5, 2013 Reading: See any standard reference on OpenGL or GLUT. Basic Drawing: In the previous lecture, we showed how to create a window in GLUT,