Photon Maps. The photon map stores the lighting information on points or photons in 3D space ( on /near 2D surfaces)

Similar documents
Global Illumination. COMP 575/770 Spring 2013

Advanced Graphics. Path Tracing and Photon Mapping Part 2. Path Tracing and Photon Mapping

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

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

Raytracing & Epsilon. Today. Last Time? Forward Ray Tracing. Does Ray Tracing Simulate Physics? Local Illumination

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

Path Tracing part 2. Steve Rotenberg CSE168: Rendering Algorithms UCSD, Spring 2017

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

Global Illumination CS334. Daniel G. Aliaga Department of Computer Science Purdue University

Final Project: Real-Time Global Illumination with Radiance Regression Functions

CS 563 Advanced Topics in Computer Graphics Irradiance Caching and Particle Tracing. by Stephen Kazmierczak

Today. Participating media. Participating media. Rendering Algorithms: Participating Media and. Subsurface scattering

Monte Carlo Ray Tracing. Computer Graphics CMU /15-662

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

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

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

Rendering: Reality. Eye acts as pinhole camera. Photons from light hit objects

Lecture 7 - Path Tracing

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

Today. Anti-aliasing Surface Parametrization Soft Shadows Global Illumination. Exercise 2. Path Tracing Radiosity

Consider a partially transparent object that is illuminated with two lights, one visible from each side of the object. Start with a ray from the eye

To Do. Real-Time High Quality Rendering. Motivation for Lecture. Monte Carlo Path Tracing. Monte Carlo Path Tracing. Monte Carlo Path Tracing

Choosing the Right Algorithm & Guiding

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

GAMES Webinar: Rendering Tutorial 2. Monte Carlo Methods. Shuang Zhao

Lecture 18: Primer on Ray Tracing Techniques

In the real world, light sources emit light particles, which travel in space, reflect at objects or scatter in volumetric media (potentially multiple

Photon Mapping. Due: 3/24/05, 11:59 PM

The Rendering Equation & Monte Carlo Ray Tracing

Global Illumination The Game of Light Transport. Jian Huang

Lighting. Figure 10.1

Monte Carlo Path Tracing. The Rendering Equation

The Rendering Equation. Computer Graphics CMU /15-662

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

CPSC GLOBAL ILLUMINATION

COMPUTER GRAPHICS COURSE. LuxRender. Light Transport Foundations

Monte Carlo Ray-tracing and Rendering

Motivation: Monte Carlo Path Tracing. Sampling and Reconstruction of Visual Appearance. Monte Carlo Path Tracing. Monte Carlo Path Tracing

Monte Carlo Integration of The Rendering Equation. Computer Graphics CMU /15-662, Spring 2017

Introduction. Chapter Computer Graphics

Monte-Carlo Ray Tracing. Antialiasing & integration. Global illumination. Why integration? Domains of integration. What else can we integrate?

Lecture 7: Monte Carlo Rendering. MC Advantages

11/2/2010. In the last lecture. Monte-Carlo Ray Tracing : Path Tracing. Today. Shadow ray towards the light at each vertex. Path Tracing : algorithm

Monte Carlo Integration COS 323

Computer Graphics. Lecture 13. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura

The Rendering Equation. Computer Graphics CMU /15-662, Fall 2016

Virtual Reality for Human Computer Interaction

The Rendering Equation and Path Tracing

Assignment 3: Path tracing

Anti-aliasing and Monte Carlo Path Tracing. Brian Curless CSE 557 Autumn 2017

The Traditional Graphics Pipeline

INFOMAGR Advanced Graphics. Jacco Bikker - February April Welcome!

Anti-aliasing and Monte Carlo Path Tracing

13 Distribution Ray Tracing

Motivation. Advanced Computer Graphics (Fall 2009) CS 283, Lecture 11: Monte Carlo Integration Ravi Ramamoorthi

Lecture 12: Photon Mapping. Biased Methods

Virtual Spherical Lights for Many-Light Rendering of Glossy Scenes

Rendering Part I (Basics & Ray tracing) Lecture 25 December 1, 2015

Interactive Methods in Scientific Visualization

Biased Monte Carlo Ray Tracing

Global Rendering. Ingela Nyström 1. Effects needed for realism. The Rendering Equation. Local vs global rendering. Light-material interaction

Stochastic Path Tracing and Image-based lighting

To Do. Advanced Computer Graphics. Course Outline. Course Outline. Illumination Models. Diffuse Interreflection

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

Computer Graphics. Lecture 10. Global Illumination 1: Ray Tracing and Radiosity. Taku Komura 12/03/15

Sung-Eui Yoon ( 윤성의 )

rendering equation camera all

Illumination Algorithms

The Traditional Graphics Pipeline

I have a meeting with Peter Lee and Bob Cosgrove on Wednesday to discuss the future of the cluster. Computer Graphics

We want to put a CG object in this room

The Traditional Graphics Pipeline

Comp 410/510 Computer Graphics. Spring Shading

Monte Carlo Integration

Lighting. To do. Course Outline. This Lecture. Continue to work on ray programming assignment Start thinking about final project

CS770/870 Spring 2017 Radiosity

Monte Carlo Simulations

Wednesday, 26 January 2005, 14:OO - 17:OO h.

Motivation. Monte Carlo Path Tracing. Monte Carlo Path Tracing. Monte Carlo Path Tracing. Monte Carlo Path Tracing

An introduction to Global Illumination. Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology

03 RENDERING PART TWO

6. Illumination, Lighting

CS770/870 Spring 2017 Radiosity

Photon Mapping. Kadi Bouatouch IRISA

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Shading Models. Welcome!

CS130 : Computer Graphics Lecture 8: Lighting and Shading. Tamar Shinar Computer Science & Engineering UC Riverside

Reflection and Shading

Paths, diffuse interreflections, caching and radiometry. D.A. Forsyth

Efficient Caustic Rendering with Lightweight Photon Mapping

An Approach to Point Based Approximate Color Bleeding With Volumes

The V-Ray installer will automatically remove any previous installations. This will allow you to seamlessly upgrade from previous versions.

rendering equation computer graphics rendering equation 2009 fabio pellacini 1

CS Computer Graphics: Introduction to Ray Tracing

CS Computer Graphics: Introduction to Ray Tracing

Local vs. Global Illumination & Radiosity

Lighting and Shading

CSCI 4972/6963 Advanced Computer Graphics Quiz 2 Tuesday April 17, 2007 noon-1:30pm

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

Introduction to Photon Mapping RADIANCE Workshop 2010 Course Advanced Fenestration

GLOBAL ILLUMINATION. Christopher Peters INTRODUCTION TO COMPUTER GRAPHICS AND INTERACTION

Transcription:

Photon Mapping 1/36

Photon Maps The photon map stores the lighting information on points or photons in 3D space ( on /near 2D surfaces) As opposed to the radiosity method that stores information on surface triangles 2/36

Monte Carlo Integration 3/36

Monte Carlo Method The finite element method is a Newton-Cotes quadrature approach, and as such it does not scale well to higher dimensions 3D space + 2D angles = 5D (or 4D ignoring participating media) Thus we previously made the approximation that the lighting was purely diffuse in order to reduce the dimensionality of the problem and make it tractable Integrated over angles to drop two dimensions; results was 2D (or 3D) Although Monte Carlo integration is worse than Newton-Cotes quadrature for lower dimensional problems, it scales well on higher dimensional problems No curse of dimensionality The Monte Carlo method allows us to tackle the full higher dimensional lighting equation, without assuming that the lighting is purely diffuse Monte Carlo methods rely on repeated random sampling 4/31

Example Consider calculating ππ 3.14 using both a finite element method and a Monte Carlo method. 5/31

Finite Element Approach 6/31

Monte Carlo Approach Randomly choose NN points in a 2 by 2 square enclosing the circle Let NN iiiiiiiiiiii denote points whose distance to the center of the square is less than 1 The approximation for ππ is given by 4 NN iiiiiiiiiiii, since AA cccccccccccc NN AA bbbbbb each point in the box is equally likely to be chosen = ππ 4 and NN = 1000, ππ 3.136 NN = 2000, ππ 3.1440 7/31

Random Numbers Random variables are expressions whose value is the outcome of a random experiment The sample space is the set of all outcomes A probability distribution pp xx describes the probability of selecting each outcome in the sample space We sample the value of a random variable by choosing a random element in the sample space with a probability determined by pp(xx) Pseudorandom number generators (PRNGs) are deterministic algorithms that allow us to generate sequences of quasi- random numbers based on an initial seed (a starting point in the predetermined sequence) PRNGs allow us to generate a (pseudo) random real number between 0 and 1 with an equal, or uniform, probability Uniformly sampling [0,1] allows us to sample any other sample space with its non-uniform probability distribution 8/31

Monte Carlo Integration Consider the integral aa bb ff xx d xx The Monte Carlo estimator is given by bb aa FF NN = NN NN ii=1 ff XX ii where N is the number of samples and the XX ii are uniformly randomly generated in the interval [a,b] The expected value of the estimator, is the value of the integral 9/31

Importance Sampling 10/36

Importance Sampling Suppose ff(xx) is only nonzero in aa 1, bb 1 which is a subset of aa, bb, i.e., bb bb 1ff ff xx d xx = xx d xx aa aa 1 Only need to sample XX ii uniformly over aa 1, bb 1, since all samples outside aa 1, bb 1 do not contribute to the integral Change the probability distribution pp(xx) from which we sample XX ii from the uniform distribution over aa, bb to the uniform distribution over aa 1, bb 1 More generally, the probability distribution pp(xx) should prefer samples in areas with higher contributions, or importance, to the integral bb For a general pp(xx) with aa pp(xx)d xx = 1 (and pp xx = 0 outside aa, bb ), the Monte Carlo estimator is FF NN = 1 NN NN ff(xxii ) pp(xx ii ) ii=1 reduces to the usual case if we uniformly sample with pp xx = 1 bb aa 11/31

Importance Sampling Monte Carlo estimates for 0 1 xx 2 d xx with NN = 100 samples: pp(xx) Estimate using FF NN Relative Error 1 0.33671 1.01% 2xx 0.33368 0.105% 3xx 2 0.3333 3 0.000% Importance sampling does not necessarily reduce the error it does not always work and can give worse results The more p(x) resembles f(x), the lower the error for a fixed number of samples ff xx If pp xx = bb then we obtain the analytic answer with a single sample aa ff xx dxx However, this pp(xx) depends on the integral we want to compute Instead, choose pp(xx) based on information that does not require knowing ff(xx) such as physical principles or an approximate solution 12/31

Photon Maps 13/36

Photon Maps Monte Carlo integration methods can be used to create light maps The photon map stores the lighting information on points or photons in 3D space ( on /near 2D surfaces) As opposed to the radiosity method that stores information on surface triangles For efficiency and ease of implementation, every photon is given the same strength Thus, for example, brighter lights emit more photons instead of higher energy photons 14/36

Photon Maps - Emission Given an overall desired number of photons, divide them up amongst the various lights in the scene proportionally based on the relative power of each light Using random numbers, emit all of a light s photons into the scene For point lights, all the photons are emitted from a single point For area lights, use random numbers to select a point to emit each photon Sometimes semi-random emission is used For example: first divide a rectangular light into a uniform 2D grid of some resolution, and then emit a certain number of photons per 2D grid cell the position within a 2D grid cell can still be randomized Every photon needs to be emitted in some direction, so use random numbers to choose a direction on the sphere (or hemisphere) for emission Or a subset of the sphere for a spotlight, etc. For some scenes, such as those outdoors (consider the sun), many or most photons will miss the scene entirely As an optimization, one can simply ignore those photons Typically, it is efficient to only consider the fraction of the light that interacts with your scene, and to only generate and emit photons for this sub-light (don t forget to scale down the energy of a sub-light when dividing up photons) 15/36

Photon Map - Storage For each photon, use the standard ray tracer to find the first piece of geometry that it intersects Every time a photon intersects a surface, its data is added to the photon map representing incoming light Simply create a new particle to store in the photon map Store the photon s current location in 3D space along with the incoming ray direction that brought it to that intersection location don t need to record the energy, since all photons have the same energy Don t delete the photon, or move it into the photon map, since we may still need it to bounce around more Simply create a new storage photon in the photon map 16/36

Photon Map - Absorption After storing the photon s incoming light direction in the photon map, use random numbers to determine what the photon does next There is some chance that the photon is absorbed by the surface objects absorb some of the incoming light, which is what gives them their color Absorbing some fraction of the photon s energy results in photons with unequal energy - so we do not do that Instead, we use the fraction of light energy that would be absorbed in order to create a probability that a photon is absorbed Then we uniformly generate a random number and compare it to that probability in order to see if the photon is absorbed or not When a photon is absorbed, the process stops and we move on to the next photon Otherwise we bounce the current photon and continue following it to the next surface 17/36

Photon Map - Bouncing Reflected photons need a new direction This is computed by first mapping the directions of the BRDF into probabilities E.g. a purely diffuse BRDF has an equal probability for all directions on the hemisphere Then a random number is generated and compared to the BRDF table in order to determine the bounce direction The photon travels off in this new direction until it intersects another surface The new surface intersection location and the current incoming light direction are then stored in the photon map The photon is once again checked for absorption, and if it s not absorbed, it is again bounced according to the BRDF A maximum number of bounces before termination is typically set It can be set rather high as photons typically have a diminishing chance of avoiding absorption as the number of bounces increases 18/36

Photon Map Physically Based Rendering by Pharr and Humphreys 19/36

Rendered Image Physically Based Rendering by Pharr and Humphreys 20/36

Using Photon Maps 21/36

Photon Map Direct Lighting It s more accurate to evaluate direct lighting at a point using the typical shadow rays from that point to the lights rather then interpolating lighting information from nearby photons in the photon map Thus, the first time a photon emitted from a light hits an object, it is not stored in the photon map (you will store it for your HW assignment though) This makes the photon map a lot more efficient since we don t need to store any photons for direct illumination 22/36

Photon Map Specular It is often more convenient to create separate BRDFs for the diffuse and specular lighting Then when bouncing a photon, first use a random number to determine if the photon is absorbed, or undergoes a diffuse bounce, or undergoes a specular bounce Afterwards, a second random number is used to pick the direction for the diffuse or specular bounce We make two photon maps: A caustic photon map stores samples from photons that have undergone only specular bounces up to the point at which they are stored in the map An indirect lighting map stores any photon that has undergone at least one diffuse bounce 23/36

Photon Maps 24/36

Reminder: Caustics 25/36

Gathering Radiance Trace rays from the camera and at each intersection point: Use traditional shadow rays to account for direct lighting Estimate the radiance contribution to the ray from caustics and indirect lighting using the respective photon maps Find the NN closest photons to a point on the surface of an object Use an acceleration structure to store the photons: K-D tree, uniform grid, etc. 26/36

Photon Map Color If all photons are white light, then the entire photon map will be white light Create three photon maps, one for each color channel: red, green, blue Then objects of a certain color will tend to absorb photons of different colors creating differences in the photon maps This gives color bleeding and related effects 27/36

And 28/36

Question 1: Name? Don t forget make-up 29/31