David Luebke9/7/2015 CS 551 / 645: Introductory Computer Graphics David Luebke

Slides:



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

Graphics Pipeline.
3D Graphics Rendering and Terrain Modeling
David Luebke5/11/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
CS 551 / 645: Introductory Computer Graphics Visible Surface Determination.
CAP4730: Computational Structures in Computer Graphics Visible Surface Determination.
CS 445 / 645: Introductory Computer Graphics
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2008 Alla Sheffer Advanced Rendering Week.
CGDD 4003 THE MASSIVE FIELD OF COMPUTER GRAPHICS.
Tomas Mőller © 2000 Speeding up your game The scene graph Culling techniques Level-of-detail rendering (LODs) Collision detection Resources and pointers.
(conventional Cartesian reference system)
7M836 Animation & Rendering
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Visibility II Week 7,
CS248 Final Review Derek Chan and Abe Davis. CS248 Final Monday, December 8, 3:30 to 6:30 pm Closed book, closed notes Mainly from material in the second.
Spatial Data Structure: Quadtree, Octree,and BSP tree Mengxia Zhu Fall 2007.
Part I: Basics of Computer Graphics Rendering Polygonal Objects (Read Chapter 1 of Advanced Animation and Rendering Techniques) Chapter
University of British Columbia CPSC 414 Computer Graphics © Tamara Munzner 1 Visibility: Z Buffering Week 10, Mon 3 Nov 2003.
02/04/03 Page 1 Rendering Visibility Lighting Texturing.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Other Rendering Techniques Types of rendering – Wireframe techniques – Scan-line conversion – Reyes.
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.
Hidden Surface Removal
CS 445 / 645: Introductory Computer Graphics
Shadows Computer Graphics. Shadows Shadows Extended light sources produce penumbras In real-time, we only use point light sources –Extended light sources.
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.
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.
02/26/02 (c) 2002 University of Wisconsin, CS 559 Last Time Canonical view pipeline Orthographic projection –There was an error in the matrix for taking.
Visibility Culling David Luebke Computer Science Department University of Virginia
-Global Illumination Techniques
David Luebke10/9/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
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)
CS 445: Introduction to Computer Graphics David Luebke University of Virginia Review.
Real-Time Rendering SPEEDING UP RENDERING Lecture 04 Marina Gavrilova.
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.
COMPUTER GRAPHICS CSCI 375. What do I need to know?  Familiarity with  Trigonometry  Analytic geometry  Linear algebra  Data structures  OOP.
The Rendering Pipeline CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Real-time Graphics for VR Chapter 23. What is it about? In this part of the course we will look at how to render images given the constrains of VR: –we.
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.
Binary Space Partitioning Trees Ray Casting Depth Buffering
1 Visiblity: Culling and Clipping Computer Graphics COMP 770 (236) Spring 2009 January 21 & 26: 2009.
David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
Computer Graphics Zhen Jiang West Chester University.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.
David Luebke 1 12/8/2015 Visibility CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
MIT EECS 6.837, Durand and Cutler The Graphics Pipeline: Projective Transformations.
David Luebke1/10/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
CS 445 / 645 Introduction to Computer Graphics Lecture 24 Final Exam Prep Lecture 24 Final Exam Prep.
CS559: Computer Graphics Final Review Li Zhang Spring 2010.
DPL2/10/2016 CS 551/651: Final Review David Luebke
Real-Time Dynamic Shadow Algorithms Evan Closson CSE 528.
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
CS 445 / 645: Introductory Computer Graphics Review.
David Luebke2/23/2016 CS 551 / 645: Introductory Computer Graphics Color Continued Clipping in 3D.
Computer Graphics Inf4/MSc 1 Computer Graphics Lecture 5 Hidden Surface Removal and Rasterization Taku Komura.
DPL3/10/2016 CS 551/651: Simplification Continued David Luebke
David Luebke3/12/2016 Advanced Computer Graphics Lecture 3: More Ray Tracing David Luebke
David Luebke3/16/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Rendering Pipeline Fall, 2015.
3D Graphics Rendering PPT By Ricardo Veguilla.
The Graphics Rendering Pipeline
CSCE 441: Computer Graphics Hidden Surface Removal
Visibility: Z Buffering Week 10, Mon 3 Nov 2003
Presentation transcript:

David Luebke9/7/2015 CS 551 / 645: Introductory Computer Graphics David Luebke

David Luebke9/7/2015 Administrivia l Final exam: –Tuesday December 14, 9 AM to noon in MEC 339 –Closed-book, closed-note exam l Study notes: – PDF versions of six slides-per-page handouts will be put on the course web page

David Luebke9/7/2015 Review For Test l 3-D graphics: Transform Illuminate Transform Clip Project Rasterize Model & Camera Parameters Rendering Pipeline FramebufferDisplay

David Luebke9/7/2015 Review For Test l Rendering pipeline: 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 All vertices of scene in shared 3-D “world” coordinate system Vertices shaded according to lighting model Vertices shaded according to lighting model Scene vertices in 3-D “view” or “camera” coordinate system Scene vertices in 3-D “view” or “camera” coordinate system Exactly those vertices & portions of polygons in view frustum Exactly those vertices & portions of polygons in view frustum 2-D screen coordinates of clipped vertices 2-D screen coordinates of clipped vertices

David Luebke9/7/2015 Review For Test l Transformations –Shift in coordinate systems (basis sets) –Accomplished via matrix multiplication –Modeling transforms: object->world –Viewing transform: world->view –Projection transform: view->screen

David Luebke9/7/2015 Review For Test l Rigid-body transforms –Rotation: 2-D. 3-D (canonical & arbitrary axis) –Scaling –Translation: homogeneous coords, 4x4 matrices –Composiing transforms n Matrix multiplication n Order from right to left l Projection transforms –Geometry of perspective projection –Derive perspective projection matrix

David Luebke9/7/2015 Recap: 3-D Clipping l Clipping in 3-D –Sutherland-Hodgman extends easily to clipping against six view-frustum planes –Issue: when in the pipeline to clip? n World coordinates: arbitrary planes  expensive n Camera coordinates: two planes easy, four hard n Canonical perspective coordinates: two easy, four okay n Canonical orthographic coordinates/screen coordinates: reduces matrix multiplies, requires clipping in homogeneous coordinates n Common shortcut: clip near-far in camera coordinates, multiply by perspective matrix, clip left-right-top-bottom

David Luebke9/7/ D Clipping l Recall this sequence of diagrams: Clip against view volume Apply projection matrix and homogeneous divide Transform into viewport for 2-D display Apply normalizing transformation projection matrix; homogeneous divide Transform into viewport for 2-D display Clip against canonical view volume Clip against view volume Apply projection matrix Transform into viewport for 2-D display Homogeneous divide

David Luebke9/7/2015 Canonical Perspective Coordinates 1 x or y z Front or hither plane Back or yon plane Why is this going to be simpler?

David Luebke9/7/2015 Visible Surface Determination l Why might a polygon be invisible? –Polygon outside the field of view: view-frustum culling –Polygon is backfacing: backface culling –Polygon is occluded by object(s) nearer the viewpoint: occlusion culling Efficiency Efficiency & Correctness

David Luebke9/7/2015 View-Frustum Culling l Clump primitives and classify clump bounding volumes as inside, outside, or intersecting view frustum l If bounding volume isn’t in frustum, don’t draw primitives in clump l For better performance, use a hierarchy of bounding volumes –Spheres –Bounding boxes –Others

David Luebke9/7/2015 l On the surface of a closed manifold, polygons whose normals point away from the camera are always occluded: Back-Face Culling

David Luebke9/7/2015 Occlusion l Need to find visible polygon fragments: –Upper bound on fragments?

David Luebke9/7/2015 Occlusion l Painter’s Algorithm (and problem cases) l Binary Space Partition (BSP) Tree –Splitting planes, recursively divide space into half- spaces –Allows front-to-back traversal, thus painter’s alg. –Know the pros and cons l Warnock’s Algorithm –Clip objects to viewport –If number of objects is 0 or 1, visibility is trivial –Else subdivide into smaller viewports and recurse

David Luebke9/7/2015 The Z-Buffer Algorithm l Resolve visibility independently at each pixel: l Interpolating Z: just another (planar) parameter

David Luebke9/7/2015 Z-Buffer Pros and Cons l Pros: –Simple –Good for hardware –Handles polygon interpenetration and overlap –Handles polygons in arbitrary order l Cons –Lots of memory (16 bits barely okay, 32 bits best) –Needs fast memory –Hard to do antialiasing/translucent –Precision issues

David Luebke9/7/2015 Visibility: Ray Casting l An example: ScreenEyepointScene

David Luebke9/7/2015 Cells & Portals l Works well for architectural models l Cells are regions of model mostly occluded from each other –Rooms, alcoves, corridors… l Transparent portals connect cells on their boundaries –Doorways, entrances, windows… l Adjacency graph captures cell connectivity l Cells visible if  a line of sight through portals

David Luebke9/7/2015 Cells & Portals l View-dependent vs. view-independent solutions l pfPortals algorithm: –Recursive traversal of adjacency graph: –Treat portals as special polygons n If portal is visible, render adjacent cell n But clip to boundaries of portal! n Recursively check portals in that cell against new clip boundaries (and render) –Each visible portal sequence amounts to a series of nested portal boundaries n Kept implicitly on recursion stack

David Luebke9/7/2015 Lighting l Simulate physics/optics of surface illumination l Definitions: illumination vs. lighting vs. shading l Components of illumination: –Light sources n Position, direction, shape n Spectrum of emittance (color) & attenuation –Surface properties n Position, orientation n Reflectance spectrum (color) & micro-structure l Simplifications of various components

David Luebke9/7/2015 Phong-Style Lighting l Light-source approximations: –Ambient light sources –Directional light sources –Point light sources l Lambert’s Cosine Law and Lambertian surfaces l Specular reflection –Microgeometry (underlying reasoning) –Cosine-to-a-power (empirical hack)

David Luebke9/7/2015 Phong-Style Lighting l Understand this equation and where its terms all came from:

David Luebke9/7/2015 Lighting & Shading l Lighting: applying illumination calculations l Shading: coloring pixels (interpolation) –Flat shading –Gouraud shading –Phong shading

David Luebke9/7/2015 Texture Mapping

David Luebke9/7/2015 Texture Mapping l Texture coordinates l Perspective-correct interpolation of texture coordinates –Basically, interpolate u/z and v/z rather than u and v l Texture-map antialiasing –The problem: uneven pixel-texel coverage –Bilinear interpolation –MIP-maps and trilinear interpolation

David Luebke9/7/2015 Texture Maps l Value stored in texels can modulate other parameters besides color: –Bump-mapping: use texture to perturb surface normal used for lighting calculations –Displacement mapping: actually displace geometry, applying texture as a height-field –Illumination mapping: combine a low-res brightness map with a high-res texture map –Shadow maps: store depth from light source l 3-D textures work well for marble, wood

David Luebke9/7/2015 OpenGL l Conventions: –glVertex3fv, etc –gluPerspective l Specifying geometry (list of vertices) l Triangle strips & fans l Be able to reason about simple OpenGL lighting code l Modeling transforms l Double-buffering for flicker-free animation

David Luebke9/7/2015 Animation & The Scene Graph l Instancing –OpenGL display lists l The scene graph captures transformations and object-object relationships in a DAG l Traversing the scene graph with the OpenGL matrix stack

David Luebke9/7/2015 Ray Tracing l Recursive ray tracing: primary and secondary (reflected & refracted) rays l Shadow rays l Representing rays parametrically: R = O + tD l Intersecting rays with spheres –Don’t know the details l Intersecting rays with polygons –Know (or be able to derive) the details

David Luebke9/7/2015 Shadow Rays l The concept l The problems: –Lots of computation n Light buffer n Shadow ray cahcing –Infinitely sharp shadows n Shoot more shadow rays or larger shadow rays –No translucent object shadows (caustics) n Can fake it though

David Luebke9/7/2015 Accelerating Ray Tracing l Hierarchical bounding volumes –Spheres vs. AABBs vs. OBBs l Spatial partitions –Grid vs. octree vs BSP tree

David Luebke9/7/2015 Level of Detail l Traditional static LOD: start with original highly-detailed object and create multiple levels of detail (LODs) in a preprocess l Creating levels of detail: mechanisms –Sample-and-reconstruct –Decimation –Vertex-merging –Adaptive subdivision l Creating levels of detail: criteria –Geometric criteria (e.g., curvature) –Visual criteria (e.g., coloration or texture maps)

David Luebke9/7/2015 Dynamic LOD l Create a data structure (the vertex tree) in preprocess and extract desired LOD at runtime l Enables view-dependent LOD, for example: –Distant regions in lower detail than nearby regions –Silhouette regions in higher detail l Vertex tree: hierarchical clustering of vertices –Folding/unfolding nodes –Tris and subtris

David Luebke9/7/2015 Radiosity l Models light transfer among surfaces in a scene l Simplifying assumptions: –Surface consists of uniformly lit patches –Surfaces are Lambertian (perfectly diffuse) –Environment is closed l Definitions: radiosity, reflectivity, form factors

David Luebke9/7/2015 Radiosity The radiosity equation: B i = E i +  i  B j F ij l Know the matrix form and what it means l Computing form factors –Relevant factors (distance, shape, etc). –Hemicube algorithm (pros & cons) –Ray casting (pros & cons) l End result: a colored polygonal model –View-independent solution!