MIT EECS 6.837, Durand and Cutler The Graphics Pipeline: Projective Transformations.

Slides:



Advertisements
Similar presentations
Today Composing transformations 3D Transformations
Advertisements

COMPUTER GRAPHICS SOFTWARE.
Graphics Pipeline.
Transformations.
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
3D Graphics Rendering and Terrain Modeling
MIT EECS 6.837, Durand and Cutler Transformations.
HCI 530 : Seminar (HCI) Damian Schofield.
CS6500 Adv. Computer Graphics © Chun-Fa Chang, Spring 2003 Object-Order vs. Screen-Order Rendering April 24, 2003.
(conventional Cartesian reference system)
Lecture 3 – Transformation And Coordinate Systems
Graphics Systems I-Chen Lin’s CG slides, Doug James’s CG slides Angel, Interactive Computer Graphics, Chap 1 Introduction to Graphics Pipeline.
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
Part I: Basics of Computer Graphics Rendering Polygonal Objects (Read Chapter 1 of Advanced Animation and Rendering Techniques) Chapter
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
COMP 175: Computer Graphics March 24, 2015
Computer Graphics Panos Trahanias ΗΥ358 Spring 2009.
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
1. 2 Plan Introduction Overview of the semester Administrivia Iterated Function Systems (fractals)
Week 2 - Wednesday CS361.
Image Synthesis Rabie A. Ramadan, PhD 2. 2 Java OpenGL Using JOGL: Using JOGL: Wiki: You can download JOGL from.
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.
Computer Graphics. Requirements Prerequisites Prerequisites CS 255 : Data Structures CS 255 : Data Structures Math 253 Math 253 Experience with C Programming.
MIT EECS 6.837, Durand and Cutler Graphics Pipeline: Projective Transformations.
CS559: Computer Graphics Lecture 9: Projection Li Zhang Spring 2008.
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.
CS 450: COMPUTER GRAPHICS REVIEW: INTRODUCTION TO COMPUTER GRAPHICS – PART 2 SPRING 2015 DR. MICHAEL J. REALE.
Week 2 - Friday.  What did we talk about last time?  Graphics rendering pipeline  Geometry Stage.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
MIT EECS 6.837, Durand and Teller 1 The Rendering Pipeline Local Illumination Models MIT EECS Lecture 4, September 17 th 2002.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
CSE Real Time Rendering Week 2. Graphics Processing 2.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
COMPUTER GRAPHICS CSCI 375. What do I need to know?  Familiarity with  Trigonometry  Analytic geometry  Linear algebra  Data structures  OOP.
MIT EECS 6.837, Durand and Cutler Transformations.
Computer Graphics Chapter 6 Andreas Savva. 2 Interactive Graphics Graphics provides one of the most natural means of communicating with a computer. Interactive.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
CS559: Computer Graphics Lecture 9: Rasterization Li Zhang Spring 2008.
David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
MIT EECS Frédo Durand and Barb Cutler
Mark Nelson 3d projections Fall 2013
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Global Illumination. Local Illumination  the GPU pipeline is designed for local illumination  only the surface data at the visible point is needed to.
Review on Graphics Basics. Outline Polygon rendering pipeline Affine transformations Projective transformations Lighting and shading From vertices to.
Subject Name: Computer Graphics Subject Code: Textbook: “Computer Graphics”, C Version By Hearn and Baker Credits: 6 1.
1 Angel: Interactive Computer Graphics5E © Addison- Wesley 2009 Image Formation Fundamental imaging notions Fundamental imaging notions Physical basis.
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
1 Perception and VR MONT 104S, Fall 2008 Lecture 20 Computer Graphics and VR.
MIT EECS 6.837, Durand and Cutler The Graphics Pipeline: Line Clipping & Line Rasterization.
RENDERING : Global Illumination
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.
Chapter 1 Graphics Systems and Models Models and Architectures.
1 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Models and Architectures 靜宜大學 資訊工程系 蔡奇偉 副教授 2012.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
- Introduction - Graphics Pipeline
Rendering Pipeline Aaron Bloomfield CS 445: Introduction to Graphics
3D Graphics Rendering PPT By Ricardo Veguilla.
Models and Architectures
Models and Architectures
Models and Architectures
Introduction to Computer Graphics with WebGL
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.
The Graphics Pipeline Lecture 5 Mon, Sep 3, 2007.
Models and Architectures
Models and Architectures
Presentation transcript:

MIT EECS 6.837, Durand and Cutler The Graphics Pipeline: Projective Transformations

MIT EECS 6.837, Durand and Cutler Today Review & Schedule Ray Casting / Tracing vs. Scan Conversion The Graphics Pipeline Projective Transformations

MIT EECS 6.837, Durand and Cutler Last Week: Animation & Quaternions Finite Element Simulations –collisions, fracture, & deformation

MIT EECS 6.837, Durand and Cutler Schedule Final Project –Post your ideas on the web page –Meet with staff to talk about project ideas sign up for an appointment on Friday –Proposal due on Monday October 27 th Friday October 24 th : Assignment 5 due Office Hours this week: –Tuesday after class (Rob – student center) –Wednesday 7-9 (Patrick – student center) –Thursday after class (Fredo – student center) –Friday 3-5, student center (Barb – student center)

MIT EECS 6.837, Durand and Cutler XForms Forms Library GUI (graphical user interface) for Linux buttons, scrollbars, dialog boxes, menus, etc. fdesign for interactive layout

MIT EECS 6.837, Durand and Cutler Questions?

MIT EECS 6.837, Durand and Cutler Today Review & Schedule Ray Casting / Tracing vs. Scan Conversion The Graphics Pipeline Projective Transformations

MIT EECS 6.837, Durand and Cutler What have we done so far? Ray Casting / Tracing –ray/primitive intersections –transformations –local shading (diffuse, ambient, → BRDFs) –global effects (shadows, transparency, caustics,... )

MIT EECS 6.837, Durand and Cutler Ray Casting / Tracing for every pixel, construct a ray from the eye for every object in the scene intersect ray with object find closest intersection with the ray compute normal at point of intersection compute color for pixel (shoot secondary rays) Grid Acceleration

MIT EECS 6.837, Durand and Cutler Ray Casting / Tracing Advantages? –Smooth variation of normal, silhouettes –Generality: can render anything that can be intersected with a ray –Atomic operation, allows recursion Disadvantages? –Time complexity (N objects, R pixels) –Usually too slow for interactive applications –Hard to implement in hardware (lacks computation coherence, must fit entire scene in memory)

MIT EECS 6.837, Durand and Cutler Can we render things interactively? Of course! games, 3D modeling packages, architectural walkthroughs, assignment 5, etc.

MIT EECS 6.837, Durand and Cutler How do we render interactively? Use the graphics hardware (the graphics pipeline), via OpenGL, MesaGL, or DirectX Most global effects available in ray tracing will be sacrificed, but some can be approximated.

MIT EECS 6.837, Durand and Cutler Scan Conversion – Graphics Pipeline Primitives are processed one at a time Early stages involve analytic processing Sampling occurs late in the pipeline Minimal state required glBegin(GL_TRIANGLES) glNormal3f(...) glVertex3f(...) glEnd();

MIT EECS 6.837, Durand and Cutler Scan Conversion – Graphics Pipeline glBegin(GL_TRIANGLES) glNormal3f(...) glVertex3f(...) glEnd(); for every object in the scene shade the vertices scan convert the object to the framebuffer interpolate the color computed for each vertex remember the closest value per pixel

MIT EECS 6.837, Durand and Cutler Scan Conversion Given the primitive's vertices & the illumination at each vertex: Figure out which pixels to "turn on" to render the primitive Interpolate the illumination values to "fill in" the primitive At each pixel, keep track of the closest primitive (z-buffer)

MIT EECS 6.837, Durand and Cutler Limitations of Scan Conversion Restricted to scan-convertible primitives –Object polygonization Faceting, shading artifacts Effective resolution is hardware dependent No handling of shadows, reflection, transparency Problem of overdraw (high depth complexity) What if there are more triangles than pixels?

MIT EECS 6.837, Durand and Cutler Questions?

MIT EECS 6.837, Durand and Cutler Today Review & Schedule Ray Casting / Tracing vs. Scan Conversion The Graphics Pipeline Projective Transformations

MIT EECS 6.837, Durand and Cutler The Graphics Pipeline Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display

MIT EECS 6.837, Durand and Cutler The Graphics Pipeline Primitives are processed in a series of stages Each stage forwards its result on to the next stage The pipeline can be drawn and implemented in different ways Some stages may be in hardware, others in software Optimizations & additional programmability are available at some stages Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display

MIT EECS 6.837, Durand and Cutler Modeling Transformations 3D models defined in their own coordinate system (object space) Modeling transforms orient the models within a common coordinate frame (world space) Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display Object spaceWorld space

MIT EECS 6.837, Durand and Cutler Illumination (Shading) (Lighting) Vertices lit (shaded) according to material properties, surface properties (normal) and light sources Local lighting model (Diffuse, Ambient, Phong, etc.) Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display

MIT EECS 6.837, Durand and Cutler Viewing Transformation Maps world space to eye space Viewing position is transformed to origin & direction is oriented along some axis (usually z) Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display Eye space World space

MIT EECS 6.837, Durand and Cutler Clipping Transform to Normalized Device Coordinates (NDC) Portions of the object outside the view volume (view frustum) are removed Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display Eye spaceNDC

MIT EECS 6.837, Durand and Cutler Projection The objects are projected to the 2D image place (screen space) Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display NDC Screen Space

MIT EECS 6.837, Durand and Cutler Scan Conversion (Rasterization) Rasterizes objects into pixels Interpolate values as we go (color, depth, etc.) Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display

MIT EECS 6.837, Durand and Cutler Visibility / Display Each pixel remembers the closest object (depth buffer) Almost every step in the graphics pipeline involves a change of coordinate system. Transformations are central to understanding 3D computer graphics. Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display

MIT EECS 6.837, Durand and Cutler Common Coordinate Systems Object space –local to each object World space –common to all objects Eye space / Camera space –derived from view frustum Clip space / Normalized Device Coordinates (NDC) –[-1,-1,-1] → [1,1,1] Screen space –indexed according to hardware attributes

MIT EECS 6.837, Durand and Cutler Coordinate Systems in the Pipeline Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display Object space World space Eye Space / Camera Space Clip Space (NDC) Screen Space

MIT EECS 6.837, Durand and Cutler Questions?

MIT EECS 6.837, Durand and Cutler Today Review & Schedule Ray Casting / Tracing vs. Scan Conversion The Graphics Pipeline Projective Transformations –Transformations & Homogeneous Coordinates –Orthographic & Perspective Projections –Canonical View Volume

MIT EECS 6.837, Durand and Cutler Remember Transformations? Translation Rotation Rigid / Euclidean Linear Affine Projective Similitudes Isotropic Scaling Scaling Shear Reflection Perspective Identity

MIT EECS 6.837, Durand and Cutler Homogeneous Coordinates Most of the time w = 1, and we can ignore it If we multiply a homogeneous coordinate by an affine matrix, w is unchanged x' y' z' 1 = xyz1xyz1 aei0aei0 bfj0bfj0 cgk0cgk0 dhl1dhl1

MIT EECS 6.837, Durand and Cutler Homogeneous Visualization Divide by w to normalize (homogenize) W = 0? w = 1 w = 2 (0, 0, 1) = (0, 0, 2) = … (7, 1, 1) = (14, 2, 2) = … (4, 5, 1) = (8, 10, 2) = … Point at infinity (direction)

MIT EECS 6.837, Durand and Cutler Orthographic vs. Perspective Orthographic Perspective

MIT EECS 6.837, Durand and Cutler Simple Orthographic Projection Project all points along the z axis to the z = 0 plane xy01xy01 = xyz1xyz

MIT EECS 6.837, Durand and Cutler Simple Perspective Projection Project all points along the z axis to the z = d plane, eyepoint at the origin: x y z z / d = xyz1xyz /d x * d / z y * d / z d 1 = homogenize

MIT EECS 6.837, Durand and Cutler Alternate Perspective Projection Project all points along the z axis to the z = 0 plane, eyepoint at the (0,0,-d): x y 0 (z + d)/ d = xyz1xyz /d x * d / (z + d) y * d / (z + d) 0 1 = homogenize

MIT EECS 6.837, Durand and Cutler In the limit, as d → ∞ /d →...is simply an orthographic projection this perspective projection matrix...

MIT EECS 6.837, Durand and Cutler What if the p z is ≤ eye z ? (eye x, eye y, eye z ) image plane z axis

MIT EECS 6.837, Durand and Cutler What if the p z is ≤ eye z ? (eye x, eye y, eye z ) image plane z axis

MIT EECS 6.837, Durand and Cutler What if the p z is ≤ eye z ? (eye x, eye y, eye z ) image plane z axis

MIT EECS 6.837, Durand and Cutler What if the p z is ≤ eye z ? (eye x, eye y, eye z ) image plane z axis ???

MIT EECS 6.837, Durand and Cutler What if the p z is ≤ eye z ? (eye x, eye y, eye z ) image plane z axis "clip" geometry to view frustum

MIT EECS 6.837, Durand and Cutler Where are projections in the pipeline? Modeling Transformations Illumination (Shading) Viewing Transformation (Perspective / Orthographic) Clipping Projection (to Screen Space) Scan Conversion (Rasterization) Visibility / Display Eye Space / Camera Space Clip Space (NDC) Screen Space

MIT EECS 6.837, Durand and Cutler World Space → Eye Space Positioning the camera Translation + Change of orthonormal basis (Lecture 4) Given: coordinate frames xyz & uvn, and point p = (x,y,z) Find: p = (u,v,n) x y v u p x y u v

MIT EECS 6.837, Durand and Cutler Change of Orthonormal Basis uvnuvn = xyzxyz uxvxnxuxvxnx uyvynyuyvyny uzvznzuzvznz u x = x. u where: etc. u y = y. u x y v u p x y u v

MIT EECS 6.837, Durand and Cutler Normalized Device Coordinates Clipping is more efficient in a rectangular, axis-aligned volume: (-1,-1,-1) → (1,1,1) OR (0,0,0) → (1,1,1)

MIT EECS 6.837, Durand and Cutler Canonical Orthographic Projection

MIT EECS 6.837, Durand and Cutler Canonical Perspective Projection

MIT EECS 6.837, Durand and Cutler Questions?

MIT EECS 6.837, Durand and Cutler Next Time: Line Rasterization