Photon Mapping. Kadi Bouatouch IRISA

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

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

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

Biased Monte Carlo Ray Tracing:

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

Global Illumination. COMP 575/770 Spring 2013

Biased Monte Carlo Ray Tracing

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

Illumination Algorithms

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

Lecture 12: Photon Mapping. Biased Methods

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

Warped parallel nearest neighbor searches using kd-trees

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

Virtual Spherical Lights for Many-Light Rendering of Glossy Scenes

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

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

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

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

Choosing the Right Algorithm & Guiding

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

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

Spatial Data Structures for Computer Graphics

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

Sorted Arrays. Operation Access Search Selection Predecessor Successor Output (print) Insert Delete Extract-Min

CS580: Ray Tracing. Sung-Eui Yoon ( 윤성의 ) Course URL:

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

kd-trees Idea: Each level of the tree compares against 1 dimension. Let s us have only two children at each node (instead of 2 d )

Chapter 11 Global Illumination. Part 1 Ray Tracing. Reading: Angel s Interactive Computer Graphics (6 th ed.) Sections 11.1, 11.2, 11.

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

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

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

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

Lecture 18: Primer on Ray Tracing Techniques

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

Spatial Data Structures

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

Ambien Occlusion. Lighting: Ambient Light Sources. Lighting: Ambient Light Sources. Summary

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

COMPUTER GRAPHICS COURSE. LuxRender. Light Transport Foundations

Spatial Data Structures

The Rendering Equation and Path Tracing

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

SOME THEORY BEHIND REAL-TIME RENDERING

Spatial Data Structures

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

Recent Advances in Monte Carlo Offline Rendering

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

Photon Mapping. Michael Doggett Department of Computer Science Lund university

Spatial Data Structures

Stochastic Path Tracing and Image-based lighting

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

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

The Rendering Equation & Monte Carlo Ray Tracing

TDA361/DIT220 Computer Graphics, January 15 th 2016

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

Announcements. Written Assignment2 is out, due March 8 Graded Programming Assignment2 next Tuesday

Intersection Acceleration

6. Illumination, Lighting

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

Geometric data structures:

Interactive Methods in Scientific Visualization

Lighting. Figure 10.1

Topic 12: Texture Mapping. Motivation Sources of texture Texture coordinates Bump mapping, mip-mapping & env mapping

Outline of Lecture. Real-Time High Quality Rendering. Geometry or Vertex Pipeline. Basic Hardware Pipeline. Pixel or Fragment Pipeline

Monte Carlo Ray-tracing and Rendering

Task Description: Finding Similar Documents. Document Retrieval. Case Study 2: Document Retrieval

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

COMP371 COMPUTER GRAPHICS

Ray Tracing. Cornell CS4620/5620 Fall 2012 Lecture Kavita Bala 1 (with previous instructors James/Marschner)

Computational Geometry

The Photon Pipeline Revisited

Efficient Simulation of Light Transport in Scenes with Participating Media using Photon Maps

Ray Tracing III. Wen-Chieh (Steve) Lin National Chiao-Tung University

Sung-Eui Yoon ( 윤성의 )

Computational Optimization ISE 407. Lecture 16. Dr. Ted Ralphs

Visual cues to 3D geometry. Light Reflection and Advanced Shading. Shading. Recognizing materials. size (perspective) occlusion shading

Improved Radiance Gradient Computation

Philipp Slusallek Karol Myszkowski. Realistic Image Synthesis SS18 Instant Global Illumination

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

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

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

Data Mining and Machine Learning: Techniques and Algorithms

Ray Tracing. CSCI 420 Computer Graphics Lecture 15. Ray Casting Shadow Rays Reflection and Transmission [Ch ]

Accelerated Raytracing

Topic 11: Texture Mapping 11/13/2017. Texture sources: Solid textures. Texture sources: Synthesized

Global Illumination The Game of Light Transport. Jian Huang

Lightcuts. Jeff Hui. Advanced Computer Graphics Rensselaer Polytechnic Institute

Datenbanksysteme II: Multidimensional Index Structures 2. Ulf Leser

Introduction to Photon Mapping RADIANCE Workshop 2010 Course Advanced Fenestration

Advanced Algorithm Design and Analysis (Lecture 12) SW5 fall 2005 Simonas Šaltenis E1-215b

rendering equation computer graphics rendering equation 2009 fabio pellacini 1

Lighting and Materials

Geometric Structures 2. Quadtree, k-d stromy

The Rendering Equation. Computer Graphics CMU /15-662

Lighting and Shading

Lecture 7 - Path Tracing

Topic 9: Lighting & Reflection models 9/10/2016. Spot the differences. Terminology. Two Components of Illumination. Ambient Light Source

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

Topic 11: Texture Mapping 10/21/2015. Photographs. Solid textures. Procedural

Transcription:

Kadi Bouatouch IRISA Email: kadi@irisa.fr 1

Photon emission and transport 2

Photon caching 3

Spatial data structure for fast access 4

Radiance estimation 5

Kd-tree Balanced Binary Tree When a splitting dimension of a set is selected, the median of the points in that dimension is chosen as the root node of the tree representing the set The left and right subtrees are constructed from the two sets separated by the median point. The choice of a splitting dimension is based on the distribution of points within the set. 6

Kd-tree Splitting plane: based upon maximum distance since it can be computed very efficiently. The splitting dimension is thus chosen as the one which has the largest maximum distance between the points. To speed up the balancing process it is convenient to use an array of pointers to the photons. Store the Kd-tree in a linear array. 7

Kd-tree construction Photon Mapping kdtree *balance( points ) { Find the cube surrounding the points Select dimension dim in which the cube is largest Find median of the points in dim s1 = all points below median s2 = all points above median node = median node.left = balance( s1 ) node.right = balance( s2 ) return node } 8

Kd-tree: locating the nearest photons Efficiently locating the nearest photons is critical for good performance of the photon map algorithm. Fortunately the simplicity of the kd-tree permits us to implement a simple but quite efficient search algorithm. A generic nearest neighbors search algorithm begins at the root of the kd-tree, and adds photons to a list if they are within a certain distance. For the n nearest neighbors the list is sorted such that the photon that is furthest away can be deleted if the list contains n photons and a new closer photon is found. 9

Kd-tree: locating the nearest photons Instead of naive sorting of the full list it is better to use a max-heap. A max-heap (also known as a priority queue) is a very efficient way of keeping track of the element that is furthest away from the point of interest. This furthest element is placed as the first position of the heap. When the max-heap is full, we can use the distance d to the root element (ie. the photon that is furthest away, say the first element of the heap) to adjust the range of the query. Thus we skip parts of the kd-tree that are further away than d. 10

Given the photon map, a position x and a max search distance d2 this recursive function returns a heap h with the N nearest photons. Call with locate_photons(1) to initiate search at the root of the kd-tree locate_photons( p ) { if ( 2p + 1 < number of photons ) { examine child nodes Compute distance to plane (just a subtract)! = signed distance to splitting plane of node n if (! < 0) { We are left of the plane - search left subtree first locate_photons( 2p ) if (! 2 < d 2 ) locate_photons( 2p + 1 ) check right subtree } else { We are right of the plane - search right subtree first locate_photons( 2p + 1 ) if (! 2 < d 2 ) locate_photons( 2p ) check left subtree } } 11

} Compute true squared distance to photon! 2 = squared distance from photon p to x if (! 2 < d 2 ) { Check if the photon is close enough? insert photon into max heap h } Adjust maximum distance to prune the search if (number of photons in the max heap > N) { } save the new maximum distance d 2 = squared distance to photon in root node of h 12

Reflection, Transmission or Absorption: Phong 13

14

15

The illumination model The BRDF is separated into a sum of two components: A specular/glossy, f r,s, and a diffuse, f r,d The incoming radiance is classified using three components: L i,l () is direct illumination by light coming from the light sources. L i,c () is caustics: indirect illumination from the light sources via specular reflection or transmission L i,d () is indirect illumination from the light sources which has been reflected diffusely at least once. 16

The illumination model 17

Specular and Glossy Reflection The photon map is not used in the evaluation of this integral since it is strongly dominated by f r,s which has a narrow peak around the mirror direction. Using the photon map to optimize the integral would require a huge number of photons in order to make a useful classification of the different directions within the narrow peak of f r,s To save memory this strategy is not used and the integral is evaluated using standard Monte Carlo ray tracing optimized with importance sampling based on f r,s. This is still quite efficient for glossy surfaces and the integral can in most situations be computed using only a small number of sample rays. 18

Specular and Glossy Reflection 19

Caustics Evaluation: dependent on whether an accurate or an approximate computation is required. Accurate computation: the term is solved by using a radiance estimate from the caustics photon map. The number of photons in the caustics photon map is high and we can expect good quality of the estimate. Caustics are never computed using Monte Carlo ray tracing since this is a very inefficient method when it comes to rendering caustics. The approximate evaluation of the integral is included in the radiance estimate from the global photon map. 20

Caustics 21

Multiple Diffuse Reflection This term represents incoming light that has been reflected diffusely at least once since it left the light source. The light is then reflected diffusely by the surface (using f r,d ). Consequently the resulting illumination is very soft. The approximate evaluation of this integral is a part of the radiance estimate based on the global photon map. The accurate evaluation of the integral is calculated using Monte Carlo ray tracing optimized using the BRDF 22

Multiple Diffuse Reflection 23