David Luebke 1 10/12/2015 CS 551/651: Advanced Computer Graphics Advanced Ray Tracing Radiosity.

Slides:



Advertisements
Similar presentations
1GR2-00 GR2 Advanced Computer Graphics AGR Lecture 16 Radiosity - continued.
Advertisements

SI31 Advanced Computer Graphics AGR
Computer graphics & visualization Global Illumination Effects.
Computer Graphics In4/MSc Computer Graphics Lecture Notes #15 Illumination III View Independent Rendering.
Radiosity Mel Slater Department of Computer Science University College London
Modeling the Interaction of Light Between Diffuse Surfaces Cindy M. Goral, Keenth E. Torrance, Donald P. Greenberg and Bennett Battaile Presented by: Chris.
Illumination Models Radiosity Chapter 14 Section 14.7 Some of the material in these slides may have been adapted from University of Virginia, MIT, Colby.
Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.
CSCE 641: Photon Mapping Jinxiang Chai. Outline Rendering equation Photon mapping.
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
Radiosity A Fascinating Presentation by Alex Danilevky.
16.1 si31_01 SI31 Advanced Computer Graphics AGR Lecture 16 Radiosity - continued.
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 10: Global Illumination Ravi Ramamoorthi Some images courtesy.
7M836 Animation & Rendering
1 7M836 Animation & Rendering Global illumination, radiosity Arjan Kok
CSCE 641 Computer Graphics: Radiosity Jinxiang Chai.
The Radiosity Method Donald Fong February 10, 2004.
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 21: Radiosity
Paper by Alexander Keller
CSCE 641 Computer Graphics: Radiosity Jinxiang Chai.
1 Dr. Scott Schaefer Radiosity. 2/38 Radiosity 3/38 Radiosity Physically based model for light interaction View independent lighting Accounts for indirect.
CSCE 441 Computer Graphics: Radiosity Jinxiang Chai.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Radiosity What we can do with scan line conversion and ray tracing What we can’t do Radiosity.
Today More raytracing stuff –Soft shadows and anti-aliasing More rendering methods –The text book is good on this –I’ll be using images from the CDROM.
Radiosity 김 성 남. Contents Definition/Goal Basic Radiosity Method Progressive Radiosity Method Mesh substructuring Hierarchical Radiosity Ray.
-Global Illumination Techniques
01/29/03© 2003 University of Wisconsin Last Time Radiosity.
CS 376 Introduction to Computer Graphics 04 / 16 / 2007 Instructor: Michael Eckmann.
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.
02/18/05© 2005 University of Wisconsin Last Time Radiosity –Converting the LTE into the radiosity equation –Solving with Gauss-Seidel relaxation –Form.
CS 638, Fall 2001 Today Project Stage 0.5 Environment mapping Light Mapping.
David Luebke10/21/2015 CS 551 / 645: Introductory Computer Graphics David Luebke
CS 445 / 645: Introductory Computer Graphics Light.
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Stochastic Radiosity K. H. Ko School of Mechatronics Gwangju Institute.
Graphics Lecture 13: Slide 1 Interactive Computer Graphics Lecture 13: Radiosity - Principles.
111/17/ :21 Graphics II Global Rendering and Radiosity Session 9.
Radisoity Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New.
Radiosity Jian Huang, CS594, Fall 2002 This set of slides reference the text book and slides used at Ohio State.
DPL11/27/2015 CS 551/651: Radiosity David Luebke
CPSC 641 Computer Graphics: Radiosity Jinxiang Chai.
David Luebke 1 12/2/2015 CS 551/651: Advanced Computer Graphics Advanced Ray Tracing Radiosity.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.
Global Illumination. Local Illumination  the GPU pipeline is designed for local illumination  only the surface data at the visible point is needed to.
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Hybrid Algorithms K. H. Ko School of Mechatronics Gwangju Institute.
Pure Path Tracing: the Good and the Bad Path tracing concentrates on important paths only –Those that hit the eye –Those from bright emitters/reflectors.
Radiosity 1. 2 Introduction Ray tracing best with many highly specular surfaces ­Not real scenes Rendering equation describes general shading problem.
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Stochastic Path Tracing Algorithms K. H. Ko School of Mechatronics Gwangju.
Illumination and Shading Prof. Lizhuang Ma Shanghai Jiao Tong University.
CS 445 / 645 Introduction to Computer Graphics Lecture 16 Radiosity Radiosity.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
Computer Graphics (Fall 2003) COMS 4160, Lecture 20: Radiosity Ravi Ramamoorthi
Global Illumination (2) Radiosity (3). Classic Radiosity Algorithm Mesh Surfaces into Elements Compute Form Factors Between Elements Solve Linear System.
02/07/03© 2003 University of Wisconsin Last Time Finite element approach Two-pass approaches.
Global Illumination (3) Path Tracing. Overview Light Transport Notation Path Tracing Photon Mapping.
David Luebke3/12/2016 Advanced Computer Graphics Lecture 3: More Ray Tracing David Luebke
01/27/03© 2002 University of Wisconsin Last Time Radiometry A lot of confusion about Irradiance and BRDFs –Clarrified (I hope) today Radiance.
Graphics Lecture 14: Slide 1 Interactive Computer Graphics Lecture 14: Radiosity - Computational Issues.
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
David Luebke 1 7/5/2016 CS 551/651: Advanced Computer Graphics Review for final.
Advanced Computer Graphics
(c) 2002 University of Wisconsin
CSc4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Radiosity.
CSCE 441 Computer Graphics: Radiosity
(c) 2002 University of Wisconsin
© 2003 University of Wisconsin
CSc4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Lecture 25 Radiosity.
Illumination and Shading
Advanced Computer Graphics: Radiosity
Presentation transcript:

David Luebke 1 10/12/2015 CS 551/651: Advanced Computer Graphics Advanced Ray Tracing Radiosity

David Luebke 2 10/12/2015 Administrivia l Quiz 1: Tuesday, Feb 20 n Yes, I’ll have your homework graded by then (somehow) n Normal written exam (oral later)

David Luebke 3 10/12/2015 Recap: Distributed Ray Tracing l Distributed ray tracing: an elegant stochastic approach that distributes rays across: n Pixel for antialiasing n Light source for soft shadows n Reflection function for soft (glossy) reflections n Time for motion blur n Lens elements for depth of field l Cook: 16 rays suffice for all of these

David Luebke 4 10/12/2015 Recap: Backwards Ray Tracing l Two-pass algorithm: n Rays are cast from light into scene n Rays are cast from the eye into scene, picking up illumination showered on the scene in the first pass l Backwards ray tracing can capture: n Indirect illumination n Color bleeding n Caustics

David Luebke 5 10/12/2015 Recap: Backwards Ray Tracing l Arvo: illumination maps tile surfaces with regular grids, like texture maps n Shoot rays outward from lights n Every ray hit deposits some of its energy into surface’s illumination map u Ignore first generation hits that directly illuminate surface (Why?) n Eye rays look up indirect illumination using bilinear interpolation

David Luebke 6 10/12/2015 Recap: Radiosity l Ray tracing: n Models specular reflection easily n Diffuse lighting is more difficult n View-dependent, generates a picture l Radiosity methods explicitly model light as an energy-transfer problem n Models diffuse interreflection easily n But only diffuse; no shiny (specular) surfaces n View-independent, generates a 3-D model

David Luebke 7 10/12/2015 Recap: Radiosity l Basic idea: represent surfaces in environment as many discrete patches n A patch, or element, is a polygon over which light intensity is constant n Model light transfer between patches as a system of linear equations n Solve this system for the intensity at each patch n Solve for R,G,B intensities; get color at each patch n Render patches as colored polygons in OpenGL

David Luebke 8 10/12/2015 Recap: Fundamentals l Definition: n The radiosity of a surface is the rate at which energy leaves the surface u Radiosity = rate at which the surface emits energy + rate at which the surface reflects energy l Simplifying assumptions n Environment is closed n All surfaces have Lambertian reflectance n Surface patches emit and reflect light uniformly over their entire surface

David Luebke 9 10/12/2015 Radiosity l For each surface 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 Luebke 10 10/12/2015 Form Factors l Form factor: fraction of energy leaving the entirety of patch i that arrives at patch j, accounting for: n The shape of both patches n The relative orientation of both patches n Occlusion by other patches l We’ll return later to the calculation of form factors

David Luebke 11 10/12/2015 Form Factors l Some examples… Form factor: nearly 100%

David Luebke 12 10/12/2015 Form Factors l Some examples… Form factor: roughly 50%

David Luebke 13 10/12/2015 Form Factors l Some examples… Form factor: roughly 10%

David Luebke 14 10/12/2015 Form Factors l Some examples… Form factor: roughly 5%

David Luebke 15 10/12/2015 Form Factors l Some examples… Form factor: roughly 30%

David Luebke 16 10/12/2015 Form Factors l Some examples… Form factor: roughly 2%

David Luebke 17 10/12/2015 Form Factors l In diffuse environments, form factors obey a simple reciprocity relationship: A i F ij = A i F ji l Which simplifies our equation: B i = E i +  i  B j F ij l Rearranging to: B i -  i  B j F ij = E i

David Luebke 18 10/12/2015 Form Factors l So…light exchange between all patches becomes a matrix: l What do the various terms mean?

David Luebke 19 10/12/2015 Form Factors 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 l Note: E i values zero except at emitters l Note: F ii 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 Luebke 20 10/12/2015 Radiosity l Now “just” need to solve the matrix! n W&W: matrix is “diagonally dominant” n Thus Guass-Siedel must converge (what’s that?) l End result: radiosities for all patches l Solve RGB radiosities separately, color each patch, and render! l Caveat: for rendering, we actually color vertices, not patches (see F&vD p 795)

David Luebke 21 10/12/2015 Radiosity l Q: How many form factors must be computed? l A: O(n 2 ) l Q: What primarily limits the accuracy of the solution? l A: The number of patches

David Luebke 22 10/12/2015 Roadmap l So, we know the basic radiosity algorithm n Represent light transfer as a matrix n Solve the matrix to get radiosity (=color) per patch l Next topics: n Evaluating form factors n Progressive radiosity: viewing an approximate solution early n Hierarchical radiosity: increasing patch resolution on an as-needed basis

David Luebke 23 10/12/2015 Form Factors l Calculating form factors is hard n Analytic form factor between two polygons in general case: open problem till last few years l Q: So how might we go about it? l Hint: Clearly form factors are related to visibility: how much of patch j can patch i “see”?

David Luebke 24 10/12/2015 Form Factors: Hemicube l Hemicube algorithm: Think Z-buffer n Render the model onto a hemicube as seen from the center of patch i n Store item IDs instead of color n Use Z-buffer to resolve visibility n See W&W p 278 l Q: Why hemicube, not hemisphere?

David Luebke 25 10/12/2015 Form Factors: Hemicubes l Advantages of hemicubes n Solves shape, size, orientation, and occlusion problems in one framework n Can use hardware Z-buffers to speed up form factor determination (How?)

David Luebke 26 10/12/2015 Form Factors: Hemicubes l Q: What are some disadvantages of hemicubes? n Aliasing! Low resolution buffer can’t capture actual polygon contributions very exactly u Causes “banding” near lights (plate 41) n Actual form factor is over area of patch; hemicube samples visibility at only center point on patch (So?)

David Luebke 27 10/12/2015 Form Factors: Ray Casting l Idea: shoot rays from center of patch in hemispherical pattern

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

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

David Luebke 30 10/12/2015 Form Factors l Source-to-vertex form factors n 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 n Q: What are the problems with this approach?

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

David Luebke 32 10/12/2015 Substructuring l More patches  better results l Problem: # form factors grows quadratically with # patches l Substructuring: adaptively subdivide patches into elements where high radiosity gradient is found

David Luebke 33 10/12/2015 Substructuring l Elements are second-class patches: n When a patch is subdivided, form factors are computed from the elements to other patches n But form factors from the other patches to the elements are not computed u However, the form factors from other patches to the subdivided patch are updated using more accurate area- weighted average of elements

David Luebke 34 10/12/2015 Substructuring l Elements vs. patches, cont. n Elements “gather” radiosity from other patches n But those other patches only gather radiosity from the “parent” patch, not the individual elements n So an element’s contribution to other patches is approximated coarsely by it’s patch’s radiosity

David Luebke 35 10/12/2015 Substructuring l Bottom line: n Substructuring allows subpatch radiosities to be computed without changing the size of the form- factor matrix n Show examples: u W&W plate 38, F&vD plate III.21 n Note: texts aren’t clear about adaptive subdivision vs substructuring

David Luebke 36 10/12/2015 Progressive Radiosity l Good news: iterative solver of radiosity matrix will converge l Bad news: can take a long time l Progressive radiosity: reorder computation to allow viewing of partial results

David Luebke 37 10/12/2015 Progressive Radiosity l Radiosity as described uses Gauss-Seidel iterative solver n Must do an entire iteration to get an estimate of patch radiosities n Must precompute and store all O(n 2 ) form factors

David Luebke 38 10/12/2015 Progressive Radiosity 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 l Evaluating row i estimates radiosity of patch i based on all other patches l We say the patch gathers light from the environment

David Luebke 39 10/12/2015 Progressive Radiosity l Progressive radiosity shoots light from a patch into the environment: B j due to B i =  j B j F ji  j rather than B i due to B j =  i B j F ij  j l Given an estimate of B i, evaluating this equation estimates patch i’s contribution to the rest of the scene

David Luebke 40 10/12/2015 Progressive Radiosity l A problem: evaluating the equation B j due to B i =  j B j F ji  j requires knowing F ji for each patch j l Determining these values requires a hemicube computation per patch l Use reciprocity relationship to get B j due to B i =  j B j F ij (A i /A j )  j

David Luebke 41 10/12/2015 Progressive Radiosity l Now evaluation requires only a single hemicube about patch i n Compute, use, and discard form factors n Drastically reduces total storage! l Reorder radiosity computation: n Pick patch w/ highest estimated radiosity u Shoot to all other patches u Update their estimates n Pick new “brightest” patch and repeat

David Luebke 42 10/12/2015 Progressive Radiosity l We can look at the scene after every iteration through this loop l Q: How will it look after 1 loop? l Q: 2 loops? l Q: If m = # of light sources, how will it look after m loops? After 2m loops?

David Luebke 43 10/12/2015 Progressive Radiosity l Subtleties: n Pick patch with most energy to shoot u Energy = radiosity * area = B j A i n A patch may be selected to shoot again after new light has been shot to it n So don’t shoot B j, shoot  B j, the amount of radiosity patch i has received since it was last shot

David Luebke 44 10/12/2015 The End