Toda The Graphics Pipeline: Projectie Reiew & Schedule Ra Casting / Tracing s. The Graphics Pipeline Projectie Last Week: Animation & Quaternions Finite Element Simulations collisions, fracture, & deformation Schedule Final Project Post our ideas on the web page Meet with staff to talk about project ideas sign up for an appointment on Frida Proposal due on Monda October 27 th Frida October 24 th : Assignment 5 due Office Hours this week: Tuesda after class (Rob student center) Wednesda 7-9 (Patrick student center) Thursda after class (Fredo student center) Frida 3-5, student center (Barb student center) XForms Forms Librar Questions? GUI (graphical user interface) for Linu buttons, scrollbars, dialog boes, menus, etc. fdesign for interactie laout
Toda Reiew & Schedule Ra Casting / Tracing s. The Graphics Pipeline Projectie What hae we done so far? Ra Casting / Tracing ra/primitie intersections transformations local shading (diffuse, ambient, BRDFs) global effects (shadows, transparenc, caustics,... ) Ra Casting / Tracing for eer piel, construct a ra from the ee for eer object in the scene Grid Acceleration intersect ra with object find closest intersection with the ra compute normal at point of intersection compute color for piel (shoot secondar ras) Ra Casting / Tracing Adantages? Smooth ariation of normal, silhouettes Generalit: can render anthing that can be intersected with a ra Atomic operation, allows recursion Disadantages? Time compleit (N objects, R piels) Usuall too slow for interactie applications Hard to implement in hardware (lacks computation coherence, must fit entire scene in memor) Can we render things interactiel? Of course! games, 3D modeling packages, architectural walkthroughs, assignment 5, etc. How do we render interactiel? Use the graphics hardware (the graphics pipeline), ia OpenGL, MesaGL, or DirectX Most global effects aailable in ra tracing will be sacrificed, but some can be approimated.
Graphics Pipeline Primities are processed one at a time Earl stages inole analtic processing Sampling occurs late in the pipeline Minimal state required Graphics Pipeline for eer object in the scene shade the ertices scan conert the object to the framebuffer interpolate the color computed for each erte remember the closest alue per piel glbegin(gl_triangles) glnormal3f(...) glverte3f(...) glverte3f(...) glverte3f(...) glend(); glbegin(gl_triangles) glnormal3f(...) glverte3f(...) glverte3f(...) glverte3f(...) glend(); Gien the primitie's ertices & the illumination at each erte: Figure out which piels to "turn on" to render the primitie Interpolate the illumination alues to "fill in" the primitie At each piel, keep track of the closest primitie (-buffer) Limitations of Restricted to scan-conertible primities Object polgoniation Faceting, shading artifacts Effectie resolution is hardware dependent No handling of shadows, reflection, transparenc Problem of oerdraw (high depth compleit) What if there are more triangles than piels? Questions? Toda Reiew & Schedule Ra Casting / Tracing s. The Graphics Pipeline Projectie
The Graphics Pipeline The Graphics Pipeline Primities are processed in a series of stages Each stage forwards its result on to the net stage The pipeline can be drawn and implemented in different was Some stages ma be in hardware, others in software Optimiations & additional programmabilit are aailable at some stages 3D models defined in their own coordinate sstem (object space) transforms orient the models within a common coordinate frame (world space) (Lighting) Vertices lit (shaded) according to material properties, surface properties (normal) and light sources Local lighting model (Diffuse, Ambient, Phong, etc.) Object space World space Maps world space to ee space Viewing position is transformed to origin & direction is oriented along some ais (usuall ) Transform to Normalied Deice Coordinates (NDC) World space Ee space Ee space Portions of the object outside the iew olume (iew frustum) are remoed NDC
The objects are projected to the 2D image place (screen space) Rasteries objects into piels Interpolate alues as we go (color, depth, etc.) NDC Screen Space Each piel remembers the closest object (depth buffer) Almost eer step in the graphics pipeline inoles a change of coordinate sstem. are central to understanding 3D computer graphics. Common Coordinate Sstems Object space local to each object World space common to all objects Ee space / Camera space deried from iew frustum Clip space / Normalied Deice Coordinates (NDC) [-,-,-] [,,] Screen space indeed according to hardware attributes Coordinate Sstems in the Pipeline Questions? Object space World space Ee Space / Camera Space Clip Space (NDC) Screen Space
Toda Reiew & Schedule Ra Casting / Tracing s. The Graphics Pipeline Projectie & Homogeneous Coordinates Orthographic & Perspectie s Canonical View Volume Remember? Projectie Affine Similitudes Linear Rigid / Euclidean Scaling Identit Translation Isotropic Scaling Reflection Rotation Shear Perspectie Homogeneous Coordinates Most of the time w, and we can ignore it ' ' ' a e i b f j c g k d h l Homogeneous Visualiation Diide b w to normalie (homogenie) W? Point at infinit (direction) If we multipl a homogeneous coordinate b an affine matri, w is unchanged (,, ) (,, 2) (7,, ) (4, 2, 2) w (4, 5, ) (8,, 2) w 2 Orthographic s. Perspectie Orthographic Simple Orthographic Project all points along the ais to the plane Perspectie
Simple Perspectie Project all points along the ais to the d plane, eepoint at the origin: Alternate Perspectie Project all points along the ais to the plane, eepoint at the (,,-d): homogenie homogenie * d / * d / d / d /d * d / ( + d) * d / ( + d) ( + d)/ d /d In the limit, as d What if the p is ee? this perspectie projection matri......is simpl an orthographic projection /d (ee, ee, ee ) ais What if the p is ee? What if the p is ee? (ee, ee, ee ) ais (ee, ee, ee ) ais
What if the p is ee? What if the p is ee? "clip" geometr to iew frustum (ee, ee, ee ) ais (ee, ee, ee ) ais??? Where are projections in the pipeline? World Space Ee Space Positioning the camera Ee Space / Camera Space Clip Space (NDC) Screen Space Translation + Change of orthonormal basis (Lecture 4) Gien: coordinate frames & un, and point p (,,) Find: p (u,,n) p u u Change of Orthonormal Basis Normalied Deice Coordinates u n u n u n u n is more efficient in a rectangular, ais-aligned olume: (-,-,-) (,,) OR (,,) (,,) u p u where: u. u u. u etc.
Canonical Orthographic Canonical Perspectie Questions? Net Time: Line Rasteriation