Global Illumination. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/26/07 1

Similar documents
Discussion. History and Outline. Smoothness of Indirect Lighting. Irradiance Caching. Irradiance Calculation. Advanced Computer Graphics (Fall 2009)

Discussion. History and Outline. Smoothness of Indirect Lighting. Irradiance Calculation. Irradiance Caching. Advanced Computer Graphics (Fall 2009)

Global Illumination and Radiosity

Monte Carlo Rendering

Global Illumination: Radiosity

Monte Carlo 1: Integration

Monte Carlo 1: Integration

Computer Graphics. Jeng-Sheng Yeh 葉正聖 Ming Chuan University (modified from Bing-Yu Chen s slides)

Global Illumination and Radiosity

Global Illumination and Radiosity

Real-time. Shading of Folded Surfaces

Color in OpenGL Polygonal Shading Light Source in OpenGL Material Properties Normal Vectors Phong model

Topic 13: Radiometry. The Basic Light Transport Path

Monte Carlo Integration

Complex Filtering and Integration via Sampling

Introduction to Radiosity

Form-factors Josef Pelikán CGG MFF UK Praha.

Motivation. Motivation. Monte Carlo. Example: Soft Shadows. Outline. Monte Carlo Algorithms. Advanced Computer Graphics (Fall 2009)

Plane Sampling for Light Paths from the Environment Map

Photon Mapping. Photon Mapping. Why Map Photons? Sources. What is a Photon? Refrac=on of a Caus=c. Jan Kautz

Diffuse and specular interreflections with classical, deterministic ray tracing

Surface Integrators. Digital Image Synthesis Yung-Yu Chuang 12/20/2007

Some Tutorial about the Project. Computer Graphics

Computer graphics III Light reflection, BRDF. Jaroslav Křivánek, MFF UK

Surface Mapping One. CS7GV3 Real-time Rendering

Scan Conversion & Shading

Scan Conversion & Shading

Interactive Rendering of Translucent Objects

Lighting. Dr. Scott Schaefer

Computer Sciences Department

Fast, Arbitrary BRDF Shading for Low-Frequency Lighting Using Spherical Harmonics

R s s f. m y s. SPH3UW Unit 7.3 Spherical Concave Mirrors Page 1 of 12. Notes

Robust Soft Shadow Mapping with Backprojection and Depth Peeling

Physics 132 4/24/17. April 24, 2017 Physics 132 Prof. E. F. Redish. Outline

Kiran Joy, International Journal of Advanced Engineering Technology E-ISSN

Robust Soft Shadow Mapping with Depth Peeling

Slide 1 SPH3UW: OPTICS I. Slide 2. Slide 3. Introduction to Mirrors. Light incident on an object

Accounting for the Use of Different Length Scale Factors in x, y and z Directions

CS 534: Computer Vision Model Fitting

Computer Animation and Visualisation. Lecture 4. Rigging / Skinning

The Rendering Equation and Path Tracing

Fitting & Matching. Lecture 4 Prof. Bregler. Slides from: S. Lazebnik, S. Seitz, M. Pollefeys, A. Effros.

Range images. Range image registration. Examples of sampling patterns. Range images and range surfaces

MIT Monte-Carlo Ray Tracing. MIT EECS 6.837, Cutler and Durand 1

SLAM Summer School 2006 Practical 2: SLAM using Monocular Vision

Light Factorization for Mixed-Frequency Shadows in Augmented Reality

6.854 Advanced Algorithms Petar Maymounkov Problem Set 11 (November 23, 2005) With: Benjamin Rossman, Oren Weimann, and Pouya Kheradpour

Schedule. MIT Monte-Carlo Ray Tracing. Radiosity. Review of last week? Limitations of radiosity. Radiosity

Face Recognition University at Buffalo CSE666 Lecture Slides Resources:

AMath 483/583 Lecture 21 May 13, Notes: Notes: Jacobi iteration. Notes: Jacobi with OpenMP coarse grain

1. Answer the following. a. A beam of vertically polarized light of intensity W/m2 encounters two polarizing filters as shown below.

Global Illumination. CSCI 420 Computer Graphics Lecture 18. BRDFs Raytracing and Radiosity Subsurface Scattering Photon Mapping [Ch

Wavefront Reconstructor

Simulation: Solving Dynamic Models ABE 5646 Week 11 Chapter 2, Spring 2010

Complex Numbers. Now we also saw that if a and b were both positive then ab = a b. For a second let s forget that restriction and do the following.

Consistent Illumination within Optical See-Through Augmented Environments

Lecture #15 Lecture Notes

Radial Basis Functions

A Brief Overview of. Global Illumination. Thomas Larsson, Afshin Ameri Mälardalen University

Global Illumination. Global Illumination. Direct Illumination vs. Global Illumination. Indirect Illumination. Soft Shadows.

PBRT core. Announcements. pbrt. pbrt plug-ins

Global Illumination. Global Illumination. Direct Illumination vs. Global Illumination. Indirect Illumination. Soft Shadows.

REFRACTION. a. To study the refraction of light from plane surfaces. b. To determine the index of refraction for Acrylic and Water.

FEATURE EXTRACTION. Dr. K.Vijayarekha. Associate Dean School of Electrical and Electronics Engineering SASTRA University, Thanjavur

Real-time Joint Tracking of a Hand Manipulating an Object from RGB-D Input

Comparison of calculation methods and models in software for computer graphics and radiative heat exchange

An Accurate Evaluation of Integrals in Convex and Non convex Polygonal Domain by Twelve Node Quadrilateral Finite Element Method

Biostatistics 615/815

Parallelism for Nested Loops with Non-uniform and Flow Dependences

Vanishing Hull. Jinhui Hu, Suya You, Ulrich Neumann University of Southern California {jinhuihu,suyay,

Korrigeringar: An introduction to Global Illumination. Global Illumination. Examples of light transport notation light

Global Illumination. CMPT 361 Introduction to Computer Graphics Torsten Möller. Machiraju/Zhang/Möller

Reading. 14. Subdivision curves. Recommended:

Accelerating X-Ray data collection using Pyramid Beam ray casting geometries

Lecture 7 - Path Tracing

Real-time Rendering of Enhanced Shallow Water Fluid Simulations

NUMERICAL SOLVING OPTIMAL CONTROL PROBLEMS BY THE METHOD OF VARIATIONS

TEST-05 TOPIC: OPTICS COMPLETE

Global Illumination. Why Global Illumination. Pros/Cons and Applications. What s Global Illumination

DIFFRACTION SHADING MODELS FOR IRIDESCENT SURFACES

Determining the Optimal Bandwidth Based on Multi-criterion Fusion

Electrical analysis of light-weight, triangular weave reflector antennas

Barycentric Coordinates. From: Mean Value Coordinates for Closed Triangular Meshes by Ju et al.

Simulation and Animation of Fire

Lobachevsky State University of Nizhni Novgorod. Polyhedron. Quick Start Guide

Machine Learning 9. week

Recognizing Faces. Outline

Interactive Virtual Relighting of Real Scenes

Short Papers. Toward Accurate Recovery of Shape from Shading Under Diffuse Lighting 1 INTRODUCTION 2 PROBLEM FORMULATION

Loop Permutation. Loop Transformations for Parallelism & Locality. Legality of Loop Interchange. Loop Interchange (cont)

MOTION PANORAMA CONSTRUCTION FROM STREAMING VIDEO FOR POWER- CONSTRAINED MOBILE MULTIMEDIA ENVIRONMENTS XUNYU PAN

Improvement of Spatial Resolution Using BlockMatching Based Motion Estimation and Frame. Integration

Ray tracing. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 3/19/07 1

2/1/10. Outline. The Radiance Equation. Light: Flux Equilibrium. Light: Radiant Power. Light: Equation. Radiance. Jan Kautz

Part I The Basic Algorithm. Principles of Photon Mapping. A two-pass global illumination method Pass I Computing the photon map

Simplification of 3D Meshes

3D Shape of Specular Surface Measurement Using Five Degrees of Freedom Camera System

LECTURE : MANIFOLD LEARNING

Mathematics 256 a course in differential equations for engineering students

Modeling, Manipulating, and Visualizing Continuous Volumetric Data: A Novel Spline-based Approach

Transcription:

Global Illumnaton Computer Graphcs COMP 770 (236) Sprng 2007 Instructor: Brandon Lloyd 3/26/07 1

From last tme Robustness ssues Code structure Optmzatons Acceleraton structures Dstrbuton ray tracng ant-alasng depth of feld soft shadows moton blur 3/26/07 2

Today s topcs Renderng equaton Path tracng Photon mappng Radosty 3/26/07 3

Global Illumnaton Technques The Renderng Equaton theoretcal bass for lght transport Path Tracng attempts to trace lght paths to the eye Photon Mappng deposts lght energy from the source for later collecton Radosty Computes equlbrum for dffuse nterreflectons 3/26/07 4

Kajya s Renderng Equaton ( ρ ) I( xx, ) g( xx, ) e( xx, ) ( xx,, x )I( x, x )dx = + I(x,x ) Lght transported at x from x g(x,x ) geometry (vsblty) term fracton of lght from x that reaches x e.g. shadows, occluson e(x,x ) emssve term lght emtted by x toward x e.g. lght sources ρ(x,x,x ) reflectvty fracton of ntensty ncdent at x from x reflected n the x drecton 3/26/07 5

Soluton Methods I = ge + gr(i) R( ) Integrals are lnear operators Reflected ntensty s twce the power f the ncdent radance s twce the power (homogenety) R(cI) = cr(i) Reflected ntensty from two lght sources s equal to the sum of the ntenstes reflected from each (superposton) R(I 1 + I 2 ) = R(I 1 ) + R(I 2 ) Solve for ntensty I (1 gr)i = ge I= (1 gr) -1 ge ( ρ ) I( xx, ) g( xx, ) e( xx, ) ( xx,, x )I( x, x )dx = + I = ge + grge + grgrge + grgrgrge +... 1 1+ A + A A 1 1 A A A A A A A 2 2 3 2 A 3 2 + One bounce; Two bounces drect llumnaton 3/26/07 6

Grammar for Lght Paths L Lght source E Eye D Ideal dffuse reflector ρ(x,x,x ) = ρ( x j,x,x ) for all and j In general, any nteracton where lght s scattered across hemsphere S Ideal specular reflector Mrror Reflecton, Ideal Refracton ρ(x,x,x ) = δ(ang(x,x ) ang(x,x )) In general, any nteracton where lght s reflected n a sngle drecton Regular expressons X* (0 or more) X+ (1 or more) X? (0 or 1) (X Y) (X or Y) 3/26/07 7 D S

Paths OpenGL L(D S)E I = ge + gde (no shadows) I = ge + gdge (shadow buffer) Ray tracng LD?S*E I = ge + g(sg)*dge Radosty LD*E I = g(dg)*e 3/26/07 8

Energy Transport L = Radance power per unt projected area perpendcular to the ray, per unt sold angle n the drecton of the ray (W m - 2 sr -1 ) dω dω Fundamental unt of lght transport Invarant along ray da 1 da 2 da da L 1 L 2 dω 2 dω 1 L = 2 d Φ (n r)dadω = 2 d Φ cos θdadω Φ= Radant Flux (Photons/sec - W) dφ/da = Irradance (from emtter W/m 2 ) dφ/da = Radosty (from surfaces W/m 2 ) dφ/dω = Radant Intensty (W/sr) Ths term factors n the projected area of the nfntesmal surface patch along the transport drecton 3/26/07 9

Radance Form of Renderng Equaton L( x, ω) L ( x, ω) f( x, ω, ω )G( x, x )L( x, ω )da = + e r Ths s the same equaton that we saw before, but the ntegraton doman s over orented nfntesmal surface patches rather than ponts ω θ x θ x ω Surface BRDF cosθ cosθ G( xx, ) = 2 V( xx, ) x x V(x, x ) vsblty term 1 f vsble 0 f occluded 3/26/07 10

Kajya s Path Tracng At each ht, Cast one random reflected or refracted ray and weght result based on specular, dffuse, and transmsson coeffcents Termnate path when contrbuton s mperceptble (harder than you mght thnk wth hgh dynamc range lght sources) Augment wth mportance samplng (add one random ray to a lght) Cast a large constant number of rays per pxel (40-1000) 3/26/07 11

Results 256 x 256 mage Ray Traced Path Traced Lght scattered 401 mnutes 533 mnutes by reflectve sphere 3/26/07 12

Results All objects are gray, except for spheres and base. Color bleedng Caustcs 3/26/07 13

Path Tracng Postulates that even for ray tracng, followng one random path statstcally s better, than computng a *bushy* ray tree and ntegratng the results. Why? Largest contrbuton from frst ray, and ths approach ncludes more frst-ray samples as a fracton of the total. Key Issues Samplng s extremely mportant Need to be careful about proporton of reflecton, refracton, and shadow rays. Want to avod basng the results. An unbased samplng has the same mean as the fnal result, only the varance (nose) s reduced by samplng Current Methods B-drectonal path tracng (Lafortune and Veach) Metropols (Veach & Gubas) Path trace some, then carefully perturb exstng paths rather than generatng new ones (substantal beneft far from the root) 3/26/07 14

Pure Path Tracng Traces many rays forward from the eye randomly choosng reflecton drectons and weghts them accordng to the BRDF 3/26/07 15

Pure Path Tracng Best for large lght sources. Small lghts lead to few hts and large varance. 3/26/07 16

Wth Shadow Ray to Lghts Adds n Dge terms at each bounce 3/26/07 17

Wth Shadow Ray to Lghts Small lghts OK. Best for specular surfaces. 3/26/07 18

Lght Tracng Traces many rays backward from the lght source, and n a second pass ntegrates n vewng drecton 3/26/07 19

Lght Tracng Small lghts OK. Best for caustcs. 3/26/07 20

B-Drectonal Path Tracng Traces some rays forward from the eye, and others backwards from the lght source 3/26/07 21

B-Drectonal Path Tracng Slow. Must sample carefully Best for caustcs. 3/26/07 22

Bdrectonal Path Tracng Path Tracng Bdrectonal Path Tracng 3/26/07 23

Caustcs Monte-Carlo ray tracng handles all paths of lght L(D S)*E, but not equally well Has dffculty samplng LS*DS*E paths, e.g. refracton of a caustc Path tracng would need a very lucky frst ht Bdrectonal ray tracng can fnd caustc, but reflecton of caustc stll needs lucky frst ht durng path tracng Metropols lght transport can fnd a caustc path, but would need lucky perturbaton to fnd ts reflecton 3/26/07 24

Photon Mappng Photon Mappng has become the most practcal soluton for accurate global llumnaton models Jensen EGRW 95, 96 Smulates the transport of ndvdual photons Photons emtted from lght sources Photons bounce off of specular surfaces Two passes Pass 1: Photons *deposted* on dffuse surfaces, bounced off, and re-deposted - Held n a 3-D spatal data structure - Surfaces need not be parameterzed Pass 2: Photons collected by path tracng from eye 3/26/07 25

Why Map Photons? Hgh varance n Monte-Carlo renderngs results n nose Collecton of deposted photons nto a photon map (a 3-D spatal data structure) provdes a flux densty estmate Flux samples can be nterpolated easer than path samples, because flux generally vares slowly over surfaces (lower frequency) Introduces bas, whch decreases as the number of photons ncrease 3/26/07 26

Why Map Photons? And, oh yeah, t s a lot faster The The scene scene on on the the left left contans contans glossy glossy surfaces, surfaces, and and was was rendered rendered n n 50 50 mnutes mnutes usng usng photon photon mappng. mappng. The The same same scene scene took took 6 hours hours for for render render wth wth Radance, Radance, a a renderng renderng system system that that uses uses radosty radostyfor for dffuse dffuse reflecton reflecton and and path path tracng tracng for for glossy glossy reflecton. reflecton. 3/26/07 27

What s a Photon? A photon p s a partcle of lght that carres flux Φ p (x p, ω p ) Power: Φ p magntude (n Watts) and color of the flux t carres, stored as an RGB trple Poston: x p locaton of the photon Drecton: ω p the ncdent (ncomng) drecton ω used to compute rradance Photons vs. rays Photons propogate radant flux Rays gather radance ω p You must ntegrate flux over sold angle and projected area to convert t to radance Φ p 3/26/07 28 x p

Sources Pont source Photons emtted unformly n all drectons Power of source (W) dstrbuted evenly among photons Flux of each photon equal to source power dvded by total # of photons For example, a 100W lght bulb that sent out 100K photons, would have each carry a flux Φ of 1 mw Photons sent out once per smulaton as a preprocess. Can be reused f only vewpont changes. 3/26/07 29

Russan Roulette Arvo & Krk, SIGGRAPH90 Reflected flux only a fracton of ncdent flux. We could attenuate the flux of our photon based on the reflectance coeffcent, and send t off n a random drecton. After several reflectons, spendng a lot of tme keepng track of very lttle flux Instead, completely absorb some photons and completely reflect others at full power. Spend tme tracng fewer full power photons. Probablty of reflectance s the reflectance ρ. Probablty of absorpton s 1 ρ.? ρ = 60% 3/26/07 30

Mxed Surfaces If surfaces have specular and dffuse components ρ d dffuse reflectance ρ s specular reflectance ρ d + ρ s < 1 (conservaton of energy) Let ζ be a unform random value from 0 to 1 If ζ < ρ d then reflect dffuse (send off n a random drecton) Else f ζ < ρ d + ρ s then reflect specular (send off *near* reflected drecton) Otherwse absorb ρ d = 50% ρ s = 30% 3/26/07 31

Storng Photons Uses a Kd-tree (axs-algned varant of BSP tree) 2-D parttons are lnes 3-D parttons are planes Axs of parttons alternates wrt depth of the tree Average access tme s O(log n) Worst case O(n) when tree s severely lopsded Need to mantan a balanced tree, whch can be done n O(n log n) Can fnd k nearest neghbors n O(k + log n) tme usng a heap 3/26/07 32

3/26/07 33 Reflected Radance Recall the reflected radance equaton Convert ncdent radance nto ncdent flux Reflected radance n terms of ncdent flux Numercally Ω = r r r r d N L f L ω ω ω ω ω ω ) )(, ( ), ( ), ( x x da d N d L ω ω ω ω ) ( ), ( ), ( 2 Φ = x x Ω Φ = r r r r da d f L ), ( ), ( ), ( 2 ω ω ω ω x x = Φ n p p p r p r r r f A L 1 ), ( ), ( 1 ), ( ω ω ω ω x x A = πr 2

How Many Photons? How bg s the dsk radus r? Large enough that the dsk surrounds the n nearest photons. The number of photons used for a radance estmate n s usually between 50 and 500. Radance estmate usng 50 photons A = πr 2 Radance estmate usng 500 photons 3/26/07 34

3/26/07 35 Flterng Too few photons cause blurry results Smple averagng produces a box flterng of photons Photons nearer to the sample should be weghted more heavly Results n a cone flterng of photons = Φ n p p p p r p r p k r r f kr r L 1 2 3 2 ), ( ), ( 1 ) (1 1 ), ( ω ω ω π ω x x x x

Multple Photon Maps Global L(S D)*D photon map Photon stcks to dffuse surface and bounces to next surface (f t survves Russan roulette) Photons don t stck to specular surfaces Caustc LSS*D photon map Hgh resoluton Lght source usually emts photons only n drectons that ht the object creatng the caustc Caustc map photons Global map photons 3/26/07 36

Renderng Rendered by glossy-surface dstrbuted ray tracng When ray hts frst dffuse surface Compute reflected radance of caustc map photons Ignore global map photons Importance sample BRDF f r as usual Use global photon map to mportance sample ncdent radance functon L Evaluate reflectance ntegral by castng rays and accumulatng radances from global photon map Frst dffuse ntersecton. Return radance of caustc map photons here, but gnore global map photons Use global map photons to return radance when evaluatng L at frst dffuse ntersecton. 3/26/07 37

Radosty Radosty: Total rate of energy leavng a surface: Emtted Reflected Model the scene as a set of patches wth constant radosty emtters are patches too Set up lnear system Solve 3/26/07 38

Radosty Equaton Parts: BdA = B : Radosty at da : dfferental area E : emsson rate at ρ : reflectvty at EdA + ρ j B j da F j : form factor Wavelength dependence s mplct Usually just use three (RGB) j F j 3/26/07 39

Form Factors The form factor, F j s the fracton of energy leavng da j that arrves (drectly) at da Form factors consder: Dstance between surfaces Relatve Sze Relatve orentaton Occluson by ntervenng surfaces [Draw Examples] 3/26/07 40

3/26/07 41 Dscretzaton Dscretze the scene nto patches of constant radosty Recprocty relatonshp of form factors [SIEG84]: + = j j j j A B F A E A B d d d ρ + = j j j j A B F E A A B ρ becomes j j j j j j A A F F A F A F = = + = j j j F B E B ρ

3/26/07 42 System of Equatons = j j j F B B E ρ = n n nn n n n n n n n E E E B B B F F F F F F F F F 2 1 2 1 2 1 2 2 22 2 21 2 1 1 12 1 11 1 1 1 1 ρ ρ ρ ρ ρ ρ ρ ρ ρ What can we say about about F? Form factors n any row or column sum to 1 (n a closed envronment)

Solvng The matrx s dagonally domnant and Gauss- Sedel teraton s guaranteed to converge Soluton proceeds one row at a tme usng estmates from prevous rows At each step the radosty of a patch s updated based on other approxmaton of other patches Emtters appear frst 3/26/07 43

Renderng The radostes are constant across the entre patch area Smply renderng the patches produces tled appearance Instead nterpolate radostes to the vertces and use Gourad shadng from Baum et al. [1991] 3/26/07 44

Calculatng Form Factors 1 cosφcosφj Fj = 2 V( x, y)dxdy x P r A y P π j Orgnal Radosty paper [Goral et al. 84] used analytcal approach Expensve Dffcult to ncorporate occluson Common technques: Hemcube Ray castng 3/26/07 45

Form factor between two polygons (actually just a part of t) 3/26/07 46

Hemcube Dspenses wth outer ntegral (assumes lttle varaton over ) Uses fact that projecton of surface onto boundng volume has same form factor as orgnal surface Surround the center of patch wth a pxelated half cube Precompute form factor of each pxel Rasterze the scene onto the faces of the hemcube Form factor approxmated as the sum form factors of each pxel t covers 3/26/07 47

Hemcube Lmtatons Alasng Occluson close to surface Close surfaces (why?) Lght sources (why?) 3/26/07 48

Ray castng Compute pont to patch form factor analytcally Use raytracng to determne vsblty factor Generally, less effcent than hemcube 3/26/07 49