David Luebke10/21/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.
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
Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.
Vertices and Fragments I CS4395: Computer Graphics 1 Mohan Sridharan Based on slides created by Edward Angel.
CS248 Midterm Review. CS248 Midterm Mon, November 4, 7-9 pm, Terman Aud Mostly “short answer” questions – Keep your answers short and sweet! Covers lectures.
CS248 Midterm Review. CS248 Midterm Mon, November 3, 7-9 pm, Gates B01 Mostly “short answer” questions – Keep your answers short and sweet! Covers lectures.
CS248 Midterm Review Michael Green and Sean Walker (based on the work of previous TAs)
IAT 3551 Computer Graphics Overview Color Displays Drawing Pipeline.
CSCE 641 Computer Graphics: Radiosity Jinxiang Chai.
The Radiosity Method Donald Fong February 10, 2004.
CSCE 641 Computer Graphics: Radiosity Jinxiang Chai.
CSCE 441 Computer Graphics: Radiosity Jinxiang Chai.
Part I: Basics of Computer Graphics Rendering Polygonal Objects (Read Chapter 1 of Advanced Animation and Rendering Techniques) Chapter
CS248 Midterm Review. CS248 Midterm Mon, November 5, 7-9 pm, Terman Aud Mon, November 5, 3-5 pm, Gates 392 Mostly “short answer” questions Covers through.
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.
David Luebke9/7/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
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.
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.
Rasterization Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by David Luebke)
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.
David Luebke 1 10/12/2015 CS 551/651: Advanced Computer Graphics Advanced Ray Tracing Radiosity.
Clipping Aaron Bloomfield CS 445: Introduction to Graphics Fall 2006 (Slide set originally by David Luebke)
09/11/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Graphics Pipeline Texturing Overview Cubic Environment Mapping.
02/16/05© 2005 University of Wisconsin Last Time Re-using paths –Irradiance Caching –Photon Mapping.
CS447/ Realistic Rendering -- Radiosity Methods-- Introduction to 2D and 3D Computer Graphics.
10/26/04© University of Wisconsin, CS559 Fall 2004 Last Time Drawing lines Polygon fill rules Midterm Oct 28.
CS 445 / 645: Introductory Computer Graphics Light.
The Rendering Pipeline CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
CAP4730: Computational Structures in Computer Graphics
Graphics Lecture 13: Slide 1 Interactive Computer Graphics Lecture 13: Radiosity - Principles.
David Luebke11/14/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
Binary Space Partitioning Trees Ray Casting Depth Buffering
Drawing Triangles CS 445/645 Introduction to Computer Graphics David Luebke, Spring 2003.
Radiosity Jian Huang, CS594, Fall 2002 This set of slides reference the text book and slides used at Ohio State.
David Luebke11/26/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
DPL11/27/2015 CS 551/651: Radiosity David Luebke
Komputer Grafik 2 (AK045206) Shading 1/17 Realisme : Shading.
David Luebke 1 12/2/2015 CS 551/651: Advanced Computer Graphics Advanced Ray Tracing Radiosity.
CS 325 Introduction to Computer Graphics 03 / 29 / 2010 Instructor: Michael Eckmann.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.
David Luebke12/7/2015 CS 551 / 645: Introductory Computer Graphics Review for Midterm.
Introduction to Computer Graphics CS 445 / 645 Lecture 9 Chapter 4: Rasterization L. McMillan MIT notes (Fall ’98)
Basic Perspective Projection Watt Section 5.2, some typos Define a focal distance, d, and shift the origin to be at that distance (note d is negative)
MIT EECS 6.837, Durand and Cutler The Graphics Pipeline: Projective Transformations.
David Luebke1/10/2016 CS 551 / 645: Introductory Computer Graphics David Luebke
Real-Time Dynamic Shadow Algorithms Evan Closson CSE 528.
CS 445 / 645 Introduction to Computer Graphics Lecture 16 Radiosity Radiosity.
CS 445 / 645: Introductory Computer Graphics Review.
David Luebke2/23/2016 CS 551 / 645: Introductory Computer Graphics Color Continued Clipping in 3D.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
2/28/2016 CS 551 / 645: Introductory Computer Graphics Framebuffer Mathematical Foundations The Rendering Pipeline.
Global Illumination (2) Radiosity (3). Classic Radiosity Algorithm Mesh Surfaces into Elements Compute Form Factors Between Elements Solve Linear System.
David Luebke3/12/2016 Advanced Computer Graphics Lecture 3: More Ray Tracing David Luebke
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.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
CS 551 / 645: Introductory Computer Graphics
CS 551 / 645: Introductory Computer Graphics
3D Graphics Rendering PPT By Ricardo Veguilla.
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.
CSCE 441 Computer Graphics: Radiosity
Lecture 13 Clipping & Scan Conversion
Presentation transcript:

David Luebke10/21/2015 CS 551 / 645: Introductory Computer Graphics David Luebke

David Luebke10/21/2015 Administrivia l Course evaluations on the web –Help make this class better next semester l Looking into alternative location for final –Who wants to move?

David Luebke10/21/2015 The Plan l Today –Finish up radiosity –Recap up till midterm l Tomorrow –Recap since midterm

David Luebke10/21/2015 Recap: Radiosity Fundamentals l Model light transfer between patches as a system of linear equations l Solving this system gives the intensity at each patch –Simplifying assumptions: n Environment is closed n All surfaces are Lambertian (perfectly diffuse) reflectors –Solving for R, G, B intensities produces color at each patch l Render patches as colored polygons

David Luebke10/21/2015 Recap: Radiosity Fundamentals l Radiosity is the rate at which energy leaves a surface l Radiosity = rate at which the surface emits energy + rate at which the surface reflects energy –Notice: previous methods distinguish light sources from surfaces –In radiosity all surfaces can emit light –Thus: all emitters inherently have area

David Luebke10/21/2015 Recap: The Radiosity Equation l For each patch i: B i = E i +  i  B j F ji (A j / A i ) where B i, B j = radiosity of patch i, j A i, A j = area of patch i, j E i = energy/area/time emitted by i  i = reflectivity of patch i F ji = Form factor from j to i

David Luebke10/21/2015 Recap: Form Factors l Form factor: fraction of energy leaving the entirety of patch i that arrives at patch j, accounting for: –The shape of both patches –The relative orientation of both patches –Occlusion by other patches

David Luebke10/21/2015 Recap: The (Expanded) Radiosity Equation 1 -  1 F 11 -  1 F 12 … -  1 F 1n B 1 E 1 -  2 F  2 F 22 … -  2 F 2n B 2 E 2.. …... - p n F n1 -  n F n2 … 1 -  n F nn B n E n Note: E i values zero except at emitters Note: Fii is zero for convex or planar patches l Note: sum of form factors in any row = 1 (Why?) l Note: n equations, n unknowns!

David Luebke10/21/2015 Recap: Evaluating Form Factors (Hemicubes) l Hemicube algorithm: Think Z-buffer –Render the model onto a hemicube as seen from the center of patch i –Store item IDs instead of color –Use Z-buffer to resolve visibility l Advantages of hemicubes –Solves shape, size, orientation, and occlusion problems in one framework –Can use hardware Z-buffers to speed up form factor determination (How?)

David Luebke10/21/2015 Recap: Hemicubes l Disadvantages of hemicubes? –Aliasing! Low resolution buffer can’t capture actual polygon contributions very exactly n Causes “banding” near lights (plate 41) –Actual form factor is over area of patch; hemicube samples visibility at only center point on patch

David Luebke10/21/2015 Form Factors: Ray Casting l Idea: shoot rays from center of patch in hemispherical pattern

David Luebke10/21/2015 Form Factors: Ray Casting l Advantages: –Hemisphere better approximation than hemicube n More even sampling reduces aliasing –Don’t need to keep item buffer –Slightly simpler to calculate coverage

David Luebke10/21/2015 Form Factors: Ray Casting l Disadvantages: –Regular sampling still invites aliasing –Visibility at patch center still isn’t quite the same as form factor –Ray tracing is generally slower than Z-buffer-like hemicube algorithms n Depends on scene, though n What kind of scene might ray tracing actually be faster on?

David Luebke10/21/2015 Form Factors l Source-to-vertex form factors –Calculating form factors at the patch vertices helps address some problems: for every patch vertex for every source patch sample source evenly with rays visibility = % rays that hit –What are the problems with this approach?

David Luebke10/21/2015 Form Factors l Summary of form factor computation –Analytical: n Expensive or impossible (in general case) –Hemicube n Fast, especially using graphics hardware n Not very accurate; aliasing problems –Ray casting n Conceptually cleaner than hemicube n Usually slower; aliasing still possible

David Luebke10/21/2015 Radiosity Continued l Lots more to know about radiosity: –Progressive radiosity: viewing an approximate solution early –Hierarchical radiosity: increasing patch resolution on an as-needed basis

David Luebke10/21/2015 Review for Exam l Quick recap of lecture topics for exam… –Display technologies n Vector versus raster: what’s a pixel? n CRT (black & white, color): shadow mask, phosphors, electron guns n LCD: polarizing crystals that line up under an E-field, losing their polarization and acting as light valves n Pros and cons of different technologies –Framebuffers n Fast, dual-ported memory bank for holding pixels n True-color (24-bit) vs Pseudocolor (8-bit indexed) vs hi- color (16-bit, ?)

David Luebke10/21/2015 Review For Exam l Color –Basic physiology: retina, rods, cones –Different types of cones: L, M, S –Metamers: perceptually identical color senstions caused by different spectra –CIE Color Space (X, Y, Z) n Color mix-and-match experiment n Hypothetical light sources X, Y, Z (why?) n Three dimensional shape, often simplified to 2-D gamut –Other color spaces (RGB, HSV) –Gamma correction: linearize non-linear response of display device

David Luebke10/21/2015 Review For Exam l Rasterizing lines –A methodology in optimizing code –Simplest way: solve slope-intercept equation n Check slope and step in X or Y –DDA: find incremental change per inner loop –Bresenham: take advantage of rational slope, endpoints to optimize with integer arithmetic

David Luebke10/21/2015 Review For Exam l Rasterizing polygons –Can break into triangles for convenience n Trivial for convex polys, difficult for complex polys –Edge equations: n Evaluate equation of edge (linear expression) per pixel n If all three edges are positive, light pixel n Can evaulate R,G,B, Z as linear expressions too n Hardware: SIMD array n Software: bounding box n Issues: ensuring consistent edge equations, numerical stability when evaluating edge equations

David Luebke10/21/2015 Review For exam l Rasterizing triangles: edge walking –Find edges (DDA) –Interpolate colors down edges –Interpolate colors across scanlines –Fast: touches only pixels necessary –Difficult: lots of special cases, fractional offsets, precision worries l Rasterizing triangles: general issues –Need consistent rules about pixels right on edge

David Luebke10/21/2015 Review For Test l Can also rasterize general polygons –Active edge table: sort edges by y min and y max, then by x intersection w/ scanline –March up scanline by scanline, filling pixels according to parity rule –Hard to interpolate color, etc. correctly -- not planar in color space, in general

David Luebke10/21/2015 Review For Test l Clipping –Want only portions of lines, polygons in viewport –Cohen-Sutherland line clipping: binary outcodes –Polygon clipping is harder n Triangle in, 7-gon out n Concave polyon in, 2 polygons out –Sutherland-Hodgman: clip against view planes in succession n In-out rules n Line-plane intersection

David Luebke10/21/2015 Review For Test 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 Luebke10/21/2015 Review For Test l 3-D graphics: Transform Illuminate Transform Clip Project Rasterize Model & Camera Parameters Rendering Pipeline FramebufferDisplay

David Luebke10/21/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 Luebke10/21/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 Luebke10/21/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