David Luebke12/7/2015 CS 551 / 645: Introductory Computer Graphics Review for Midterm.

Slides:



Advertisements
Similar presentations
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
Advertisements

Graphics Pipeline.
10/10/02 (c) 2002 University of Wisconsin, CS 559 Last Time Finished viewing: Now you know how to: –Define a region of space that you wish to view – the.
3D Graphics Rendering and Terrain Modeling
David Luebke5/11/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
CS 551 / 645: Introductory Computer Graphics Clipping Lines and Polygons.
HCI 530 : Seminar (HCI) Damian Schofield.
Implementation Dr. Amy Zhang. Reading 2  Hill, Chapters  Hill, Chapter 10.
Sep 21, Fall 2005ITCS4010/ Computer Graphics Overview Color Displays Drawing Pipeline.
(conventional Cartesian reference system)
Sep 21, Fall 2006IAT 4101 Computer Graphics Overview Color Displays Drawing Pipeline.
IAT 3551 Computer Graphics Overview Color Displays Drawing Pipeline.
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.
CS 445 / 645: Introductory Computer Graphics
Lecture 5: 3D Rendering Pipeline (II) Prof. Hsien-Hsin Sean Lee School of Electrical and Computer Engineering Georgia Institute of Technology.
Polygon Shading. Assigning color to a shape to make graphical scenes look realistic, or artistic, or whatever effect we’re attempting to achieve But first.
Basics of Rendering Pipeline Based Rendering –Objects in the scene are rendered in a sequence of steps that form the Rendering Pipeline. Ray-Tracing –A.
University of Illinois at Chicago Electronic Visualization Laboratory (EVL) CS 426 Intro to 3D Computer Graphics © 2003, 2004, 2005 Jason Leigh Electronic.
COMP 175: Computer Graphics March 24, 2015
Computer Graphics Panos Trahanias ΗΥ358 Spring 2009.
CS 551 / 645: Introductory Computer Graphics
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CS 445 / 645 Introduction to Computer Graphics Lecture 3 Mathematical Primitives Introduction to Transformations Lecture 3 Mathematical Primitives Introduction.
Rasterization Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by David Luebke)
Triangle Scan Conversion. 2 Angel: Interactive Computer Graphics 5E © Addison-Wesley 2009 Rasterization Rasterization (scan conversion) –Determine which.
Computer Graphics An Introduction. What’s this course all about? 06/10/2015 Lecture 1 2 We will cover… Graphics programming and algorithms Graphics data.
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 Going-through.
Clipping Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by David Luebke)
David Luebke10/21/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
CS 445 / 645: Introductory Computer Graphics Light.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Basic Rendering Pipeline and Shading Spring 2012.
2D Output Primitives Points Lines Circles Ellipses Other curves Filling areas Text Patterns Polymarkers.
The Rendering Pipeline CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
CAP4730: Computational Structures in Computer Graphics
David Luebke11/14/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Drawing Triangles CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Basic Ray Tracing CMSC 435/634.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Introduction to Computer Graphics CS 445 / 645 Lecture 9 Chapter 4: Rasterization L. McMillan MIT notes (Fall ’98)
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
MIT EECS 6.837, Durand and Cutler The Graphics Pipeline: Projective Transformations.
David Luebke1/10/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
Local Illumination and Shading
2D Output Primitives Points Lines Circles Ellipses Other curves Filling areas Text Patterns Polymarkers.
CS 445 / 645: Introductory Computer Graphics Review.
David Luebke2/23/2016 CS 551 / 645: Introductory Computer Graphics Color Continued Clipping in 3D.
2/28/2016 CS 551 / 645: Introductory Computer Graphics Framebuffer Mathematical Foundations The Rendering Pipeline.
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.
David Luebke3/16/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Computer Graphics Lecture 08 Taqdees A. Siddiqi Computer Graphics Filled Area Primitives I Lecture 08 Taqdees A. Siddiqi
Graphics Review Geometry, Color & Shading Brad Tennis Leslie Wu
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
3D Ojbects: Transformations and Modeling. Matrix Operations Matrices have dimensions: Vectors can be thought of as matrices: v=[2,3,4,1] is a 1x4 matrix.
Applications and Rendering pipeline
Computer Graphics Overview
CS 551 / 645: Introductory Computer Graphics
- Introduction - Graphics Pipeline
CS 551 / 645: Introductory Computer Graphics
Clipping Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006
CS 551 / 645: Introductory Computer Graphics
3D Graphics Rendering PPT By Ricardo Veguilla.
3D Rendering Pipeline Hidden Surface Removal 3D Primitives
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.
Lecture 13 Clipping & Scan Conversion
Presentation transcript:

David Luebke12/7/2015 CS 551 / 645: Introductory Computer Graphics Review for Midterm

David Luebke12/7/2015 Administrivia l Hand out assignment 2 l Hand in assignment 3 l Late day policy: –1 late day = due tomorrow at noon –Subsequent late days add 24 hours each –Weekends and holidays count l Compiling with C++ –UNIX C++ compilers: g++ and /bin/CC –I’ll make sure it works before next assignment

David Luebke12/7/2015 Midterm Examination l Midterm is this Thursday (March 9) l Study aids: –This lecture –Earlier lectures (available on course page) –Last semester’s midterm n See n But, its not quite the same material l No calculators! (you won’t need them)

David Luebke12/7/2015 Display Technologies l Cathode Ray Tubes –Earliest, still most common graphical display –Understand the basic mechanism n Vacuum tube, phosphors, electron beam –Pros: bright, fairly high-res, leverages TV tech –Cons: bulky, size-limited, finicky

David Luebke12/7/2015 Display Technologies l Vector versus raster display –Vector: traces lines like an oscilloscope n Pros: bright, crisp, uniform lines n Cons: wireframe only, flicker for complex scenes –Raster: fixed scan pattern for electron beam, intensity controlled by scan-out from frame buffer n Pros: display solid objects, image complexity limited only by framebuffer resolution n Cons: discreet sampling (aliasing), memory cost

David Luebke12/7/2015 Display Technologies l LCDs –Understand the basic mechanism n Polarized light, crystals twist 90º unless excited n Basically a light valve: reflective or transmissive –Pros: light-weight and thin –Cons: expensive, high-power (when backlit), limited in size

David Luebke12/7/2015 Display Technologies l Also know: –Plasma display panels –Digital Micromirror Devices

David Luebke12/7/2015 Framebuffers l Memory array storing image in pixels l Issues: memory speed, size, bus contention l Different types in common use, motivated mainly by memory cost –True-Color: 24 bits, 8 per RGB (or 32 bits with  ) –Hi-Color: 16 bits (R = 6, G = 6, B = 4) –Pseudo-Color: 8 bits index into 256-entiry color lookup table (entries typically 24-bits)

David Luebke12/7/2015 Mathematical Foundations l Geometry (2-D, 3-D) l Trigonometry l Vector spaces –Elements: scalars and vectors –Operations: n Addition (identity & inverse) n Scalar multiplication (distributive rule) –Linear combinations, dimension, basis sets –Inner (dot) product, vector (cross) product

David Luebke12/7/2015 Mathematical Foundations l Affine spaces –Elements: points –Operations: n Subtraction (point - point = vector) n Addition (vector + point = point) l Matrices –Linear transforms, vector-matrix multiplication –Matrix-matrix multiplication –Composition of linear transforms = matrix concatenation

David Luebke12/7/2015 The Rendering Pipeline Transform Illuminate Transform Clip Project Rasterize Model & Camera Parameters Rendering PipelineFramebufferDisplay

David Luebke12/7/2015 The Rendering Pipeline: 3-D Modeling Transforms Scene graph Object geometry Lighting Calculations Viewing Transform Clipping Projection Transform Result: All vertices of scene in shared 3-D “world” coordinate system Vertices shaded according to lighting model Scene vertices in 3-D “view” or “camera” coordinate system Exactly those vertices & portions of polygons in view frustum 2-D screen coordinates of clipped vertices

David Luebke12/7/2015 Geometric Transforms l Modeling transforms: object coordinates  world coordinates l Viewing transform: world coordinates  eye coordinates –eye coordinates == camera coordinates == view coordinates l Projection transform: eye coordinates  2-D screen coordinates

David Luebke12/7/2015 Geometric Transforms l Understand homogeneous coordinates –[x, y, z, w] T == (x/w, y/w, z/w) –Allows us to capture translation and projection as matrices l Know your 4x4 Euclidean transform matrices: –Translation, scale, rotation about X, Y, Z l Understand rotation about an arbitrary axis l Understand order of composition for matrices –In OpenGL: using column vectors as points  order from right to left

David Luebke12/7/2015 Perspective Projection l Geometry of the perspective projection: P (x, y, z)X Z View plane d (0,0,0) x’ = ?

David Luebke12/7/2015 Perspective Projection l Desired result:

David Luebke12/7/2015 Perspective Projection l A matrix that accomplishes this:

David Luebke12/7/2015 Rasterizing Lines l Review McMillan’s great java-enabled lecture l First stab: slope-intercept + symmetry l A case study in optimization –Special case boundary conditions if necessary –Optimize inner loops n Incremental update using DDA (biggest win) n Low-level tricks: integer arithmetic, compare to 0, etc. n Culmination: Bresenham’s algorithm –Be aware of diminishing returns and readability/portability tradeoffs

David Luebke12/7/2015 Rasterizing Triangles l Triangles are nice to deal with because they are always planar and always convex l Triangle rasterization techniques: –REYES: recursive subdivision of primitive –Warnock: recursive subdivision of screen –Edge walking –Edge equations

David Luebke12/7/2015 Rasterizing Triangles l Edge walking: –Draw edges vertically –Fill in horizontal spans for each scanline –Interpolate colors down edges –At each scanline, interpolate edge colors across span –Pros: n Fast: touch only lit pixels, touch pixels only once –Cons: n Finicky: lots of special cases, hard to get just right

David Luebke12/7/2015 Rasterizing Triangles l Edge Equations –Equation of a line defines two half-spaces –Triangle can be represented as intersection of three half-spaces: A 1 x + B 1 y + C 1 < 0 A 2 x + B 2 y + C 2 < 0 A 3 x + B 3 y + C 3 < 0 A 1 x + B 1 y + C 1 > 0 A 3 x + B 3 y + C 3 > 0 A 2 x + B 2 y + C 2 > 0

David Luebke12/7/2015 Rasterizing Triangles l Basic algorithm: –Walk pixels in bounding box –Evaluate three edge equations –If all are greater than zero, shade pixel l Issues: –Computing edge equations: numerical precision –Interpolating parameters (i.e., color): just like another edge equation (why?) l Optimizing the algorithm –Like line rasterization: DDA, early termination, etc.

David Luebke12/7/2015 Rasterizing General Polygons l Parity test: –Starting outside polygon, count edges crossed. –Odd = inside, even = outside l Big cost: testing every edge against every pixel l Solution: the active edge table algorithm –Sort edges by Y –Keep a list of edges that intersect current scanline, sorted by their X-intersection w/ scanline A B C D E F G I H

David Luebke12/7/2015 Clipping Lines l Cohen-Sutherland Algorithm –Clip 2-D line segments to rectangular viewport –Designed for rapid trivial accept & trivial reject ops n 4-bit outcodes divide screen into 9 regions n Bitwise operations determine whether to accept, reject, or intersect with a viewport edge & recurse n May require multiple iterations

David Luebke12/7/2015 Clipping Polygons l Clipping polygons fundamentally more difficult –Polygons can gain or lose edges –Concave polygons can even multiply l Sutherland-Hodgman Algorithm –Simplify by divide-and-conquer: consider each clipping plane individually n Input: polygon as ordered list of vertices n Output: polygon as ordered list of vertices n Lends itself to pipelined hardware implementation

David Luebke12/7/2015 Clipping Polygons l Sutherland-Hodgman Algorithm –Know the details: n Point-plane test n Line-plane intersection n Rules: insideoutside s p p output insideoutside s p no output insideoutside s p i output insideoutside s p i output p output

David Luebke12/7/2015 Clipping in 3-D l Problem: clipping under perspective must happen before homogeneous divide –Solution 1: clip to hither plane in eye coordinates, then multiply by projection matrix, then do homogeneous divide n Better: transform to canonical perspective coordinates to simplify clipping –Solution 2: clip after projection (must clip all 4 homogeneous coordinates) –Solution 3 (ugly but common): clip to hither & yon before projection, clip to 2-D viewport after projection and divide

David Luebke12/7/2015 Color l Rods and cones l Cones and color perception –Metamers –3-D color: X, Y, and Z; CIE color space l Gamma correction

David Luebke12/7/2015 Lighting l Definitions: illumination, lighting, shading l Illumination: –Direct versus indirect –Light properties: geometry, spectrum n Common simplifications: ambient, directional, and point –Surface material: geometry, reflectance, microstructure n Common simplification: Phong lighting  Diffuse (Lambertian) reflection: incoming light reflected equally in all directions, proportional to N L  Specular reflection: approximate falloff with (V R) n shiny

David Luebke12/7/2015 Lighting l Putting it all together: the Phong lighting model l Note: evaluate per light, per color component Common simplification: constant V (viewer infinitely far away)

David Luebke12/7/2015 Shading l Where to apply lighting calculations? –Once per face: flat shading –Once per vertex, interpolate resulting color: Gouraud shading –Once per pixel, interpolating normal vectors from vertices: Phong shading Flat shadingPhong Shading