6.837-13 Graphics Pipeline 1: Perspective Transformations,

Add to Favourites
Post to:

MIT EECS 6.837, Durand and Cutler The Graphics Pipeline: Projective TransformationsMIT EECS 6.837, Durand and Cutler Today•Review & Schedule•Ray Casting /Tracing vs. Scan Conversion•The Graphics Pipeline•Projective TransformationsMIT EECS 6.837, Durand and Cutler Last Week:•Animation & Quaternions•Finite Element Simulations –collisions, fracture, & deformationMIT 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 27th•Friday October 24th: 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 Questions?MIT EECS 6.837, Durand and Cutler Today•Review & Schedule•Ray Casting /Tracing vs. Scan Conversion•The Graphics Pipeline•Projective TransformationsMIT 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 /Tracingfor every pixel, construct a ray from the eye for every object in the sceneintersect ray with objectfind closest intersection with the ray compute normal at point of intersectioncompute color for pixel (shoot secondary rays)Grid Acceleration "Inverse-Mapping" Approach For each pixel on the screen go through the display listMIT 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. Image removed due to copyright considerationsMIT 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 requiredglBegin(GL_TRIANGLES)glNormal3f(...)glVertex3f(...)glVertex3f(...)glVertex3f(...)glEnd();MIT EECS 6.837, Durand and Cutler Scan Conversion –Graphics Pipelinefor every object in the sceneshade the vertices scan convert the object to the framebufferinterpolate the color computed for each vertexremember the closest value per pixelglBegin(GL_TRIANGLES)glNormal3f(...)glVertex3f(...)glVertex3f(...)glVertex3f(...)glEnd();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 primitiveMIT 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 TransformationsMIT EECS 6.837, Durand and Cutler The Graphics PipelineModeling TransformationsIllumination(Shading)Viewing Transformation(Perspective /Orthographic)ClippingProjection (to Screen Space)Scan Conversion(Rasterization)Visibility /DisplayMIT 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 stagesModeling TransformationsIllumination(Shading)Viewing Transformation(Perspective /Orthographic)ClippingProjection (to Screen Space)Scan Conversion(Rasterization)Visibility /DisplayMIT 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 TransformationsIllumination(Shading)Viewing Transformation(Perspective /Orthographic)ClippingProjection (to Screen Space)Scan Conversion(Rasterization)Visibility /DisplayObject spaceWorld spaceMIT 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 TransformationsIllumination(Shading)Viewing Transformation(Perspective /Orthographic)ClippingProjection (to Screen Space)Scan Conversion(Rasterization)Visibility /DisplayViewing TransformationModeling Transformations•Maps world space to eye space•Viewing positions is transformed to original &direction is oriented along some axis (usually z)Illumination(Shading)Viewing Transformation(Perspective /Orthographic)ClippingProjection (to Screen Space)Scan Conversion(Rasterization)Visibility /Display P NEAR v u -n o FAR z y x o EYE Seth Teller Image adapted from: WORLD SPACE EYE SPACE Courtesy of Leonard McMillan, Computer Science at the University of North Carolina in Chapel Hill. Used with permission.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 removedModeling TransformationsIllumination(Shading)Viewing Transformation(Perspective /Orthographic)ClippingProjection (to Screen Space)Scan Conversion(Rasterization)Visibility /Display NEAR EYE FAR y z z x y x o Seth Teller Image adapted from: EYE SPACE NDC Courtesy of Leonard McMillan, Computer Science at the University of North Carolina in Chapel Hill. Used with permission.MIT EECS 6.837, Durand and Cutler Projection•The objects are projected to the 2D image place (screen space)Modeling TransformationsIllumination(Shading)Viewing Transformation(Perspective /Orthographic)ClippingProjection (to Screen Space)Scan Conversion(Rasterization)Visibility /Display y y x x z z o NDC SCREEN SPACE Seth Teller Image adapted from:MIT EECS 6.837, Durand and Cutler Scan Conversion (Rasterization)•Rasterizesobjects into pixels•Interpolate values as we go (color, depth, etc.)Modeling TransformationsIllumination(Shading)Viewing Transformation(Perspective /Orthographic)ClippingProjection (to Screen Space)Scan Conversion(Rasterization)Visibility /DisplayMIT 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 TransformationsIllumination(Shading)Viewing Transformation(Perspective /Orthographic)ClippingProjection (to Screen Space)Scan Conversion(Rasterization)Visibility /DisplayMIT 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 near eye far y z x o z x yy x z oMIT EECS 6.837, Durand and Cutler Coordinate Systems in the PipelineModeling TransformationsIllumination(Shading)Viewing Transformation(Perspective /Orthographic)ClippingProjection (to Screen Space)Scan Conversion(Rasterization)Visibility /DisplayObject spaceWorld spaceEye Space /Camera SpaceClip Space (NDC)Screen Space near eye far y z x o z x yy x z oMIT 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?ProjectiveTranslationRotationRigid /EuclideanLinearAffineSimilitudesIsotropic ScalingScalingShearReflectionPerspectiveIdentityMIT 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 unchangedxyz1aei0bfj0cgk0dhl1x'y'z'1=MIT EECS 6.837, Durand and Cutler Homogeneous Visualization•Divide by w to normalize (homogenize)•W = 0? w= 1w= 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•PerspectiveMIT EECS 6.837, Durand and Cutler Simple Orthographic Projection•Project all points along the zaxis to the z= 0 planexy01=xyz11000010000000001MIT EECS 6.837, Durand and Cutler Simple Perspective Projection•Project all points along the zaxis to the z= dplane, eyepointat the origin:xyzz /d=xyz1100001000011/d0000x * d /zy * d /zd1=homogenizeMIT EECS 6.837, Durand and Cutler Alternate Perspective Projection•Project all points along the zaxis to the z= 0 plane, eyepointat the (0,0,-d):xy0(z + d)/d=xyz1100001000001/d0001x * d /(z + d)y * d /(z + d)01=homogenizeMIT EECS 6.837, Durand and Cutler In the limit, as d→∞this perspective projection matrix......is simply an orthographic projection100001000001/d00011000010000000001→MIT EECS 6.837, Durand and Cutler What if the pzis ≤eyez?image plane(eyex, eyey, eyez)z axisMIT EECS 6.837, Durand and Cutler What if the pzis ≤eyez?(eyex, eyey, eyez)image planez axisMIT EECS 6.837, Durand and Cutler What if the pzis ≤eyez?(eyex, eyey, eyez)image planez axisMIT EECS 6.837, Durand and Cutler What if the pzis ≤eyez?(eyex, eyey, eyez)image plane???z axisMIT EECS 6.837, Durand and Cutler What if the pzis ≤eyez?(eyex, eyey, eyez)image planez axis"clip" geometry to view frustumWhere are projections in the pipeline? MIT EECS 6.837, Durand and Cutler Modeling TransformationsIllumination(Shading)Viewing Transformation(Perspective /Orthographic)ClippingProjection (to Screen Space)Scan Conversion(Rasterization)Eye Space /Camera SpaceClip Space (NDC)Screen SpaceVisibility /Display y x z o z x y near eye far y z x oMIT EECS 6.837, Durand and Cutler World Space →Eye SpacePositioning the cameraTranslation + Change of orthonormalbasis (Lecture 4)•Given: coordinate frames xyz& uvn, and point p= (x,y,z) •Find: p= (u,v,n)xyvupxyuvMIT EECS 6.837, Durand and Cutler Change of OrthonormalBasisxyzuxvxnxuyvynyuzvznzuvn=ux= x . uwhere:xyvupxyuvuy= y . uetc.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 ProjectionMIT EECS 6.837, Durand and Cutler Canonical Perspective ProjectionMIT EECS 6.837, Durand and Cutler Questions?MIT EECS 6.837, Durand and Cutler Next Time:Line Rasterization

Description
In this lecture notes we will be learning about the Graphics Pipeline:
Projective Transformations, Scan Conversion and various phases in graphics pipe line : PipelineModeling, Transformations,Illumination(Shading),Viewing Transformation(Perspective / Orthographic),ClippingProjection (to Screen Space),Scan Conversion(Rasterization),Visibility / Display

“Prof. Frédo Durand & Prof. Barbara,6.837-13 Graphics Pipeline 1: Perspective Transformations,6.837 Computer Graphics ,Electrical Engineering and Computer Science, Engineering, Massachusetts Institute of Technology: MIT Open Course Ware,http://ocw.mit.edu (22-08-2011).License: Creative Commons BY-NC-SA: http://ocw.mit.edu/terms/#cc".

Comments

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no:


Area code Number
Subjects you are interested in:
Word verification: (Enter the text as in image)


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
LearnOnline Through OCW
OpenCourseWare
User
102 Followers

Your Facebook Friends on WizIQ

Give live classes, create & sell online courses

Try it free Plans & Pricing

Connect