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

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

The Rendering Equation & Monte Carlo Ray Tracing

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

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

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

Global Illumination and Monte Carlo

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

The Rendering Equation and Path Tracing

Local vs. Global Illumination & Radiosity

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

The Rendering Equation. Computer Graphics CMU /15-662

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

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

Global Illumination The Game of Light Transport. Jian Huang

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

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

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

Motivation: Monte Carlo Rendering. Sampling and Reconstruction of Visual Appearance. Caustics. Illumination Models. Overview of lecture.

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

Lecture 7 - Path Tracing

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

Illumination Algorithms

COMP371 COMPUTER GRAPHICS

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.

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

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

Biased Monte Carlo Ray Tracing

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

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

Assignment 3: Path tracing

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

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

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

Choosing the Right Algorithm & Guiding

Lighting and Shading

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

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

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

MIT Ray Tracing Ray Tracing

Recent Advances in Monte Carlo Offline Rendering

INFOMAGR Advanced Graphics. Jacco Bikker - February April Welcome!

Last Time. Correct Transparent Shadow. Does Ray Tracing Simulate Physics? Does Ray Tracing Simulate Physics? Refraction and the Lifeguard Problem

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

THE goal of rendering algorithms is to synthesize images of virtual scenes. Global illumination

Realistic Image Synthesis

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

Virtual Spherical Lights for Many-Light Rendering of Glossy Scenes

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

Monte Carlo Path Tracing. The Rendering Equation

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

Global Illumination and the Rendering Equation

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

Lecture 10: Ray tracing

Biased Monte Carlo Ray Tracing:

Announcements. Written Assignment 2 out (due March 8) Computer Graphics

Physically Realistic Ray Tracing

Monte Carlo Integration COS 323

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

Raytracing. COSC 4328/5327 Scott A. King

The Rendering Equation Philip Dutré. Course 4. State of the Art in Monte Carlo Global Illumination Sunday, Full Day, 8:30 am - 5:30 pm

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

13 Distribution Ray Tracing

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

Distribution Ray Tracing. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

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

Indirect Illumination

Lecture 7: Monte Carlo Rendering. MC Advantages

Reading. 8. Distribution Ray Tracing. Required: Watt, sections 10.6,14.8. Further reading:

rendering equation computer graphics rendering equation 2009 fabio pellacini 1

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

Global Illumination. COMP 575/770 Spring 2013

Sampling, Aliasing, & Mipmaps

Photorealism: Ray Tracing

A Survey of Radiosity and Ray-tracing. Methods in Global Illumination

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

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

COMPUTER GRAPHICS COURSE. LuxRender. Light Transport Foundations

Indirect Illumination

EECS 487: Interactive Computer Graphics

Monte Carlo Ray-tracing and Rendering

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

INFOGR Computer Graphics. J. Bikker - April-July Lecture 10: Ground Truth. Welcome!

CS-184: Computer Graphics. Today. Lecture #16: Global Illumination. Sunday, November 8, 2009

CS 428: Fall Introduction to. Radiosity. Andrew Nealen, Rutgers, /7/2009 1

Stochastic Path Tracing and Image-based lighting

Sung-Eui Yoon ( 윤성의 )

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

Interactive Methods in Scientific Visualization

RAYTRACING. Christopher Peters INTRODUCTION TO COMPUTER GRAPHICS AND INTERACTION. HPCViz, KTH Royal Institute of Technology, Sweden

Irradiance Gradients. Media & Occlusions

S U N G - E U I YO O N, K A I S T R E N D E R I N G F R E E LY A VA I L A B L E O N T H E I N T E R N E T

CS 488. More Shading and Illumination. Luc RENAMBOT

Introduction to Radiosity

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

GLOBAL ILLUMINATION. Christopher Peters INTRODUCTION TO COMPUTER GRAPHICS AND INTERACTION

Spherical Harmonic Lighting: The Gritty Details Robin Green

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

Global Illumination. Connelly Barnes CS 4810: Graphics

Lighting. Figure 10.1

Transcription:

Raytracing & Epsilon intersects light @ t = 25.2 intersects sphere1 @ t = -0.01 & Monte Carlo Ray Tracing intersects sphere1 @ t = 10.6 Solution: advance the ray start position epsilon distance along the ray direction OR ignore all intersections < epsilon (rather than < 0) Image from Zachary Lynn Last Time? Local Illumination Radiosity Equation/Matrix Calculating the Form Factors intersects sphere2 @ t = 0.01 intersects sphere2 @ t = 14.3 eye BRDF Ideal Diffuse Reflectance Ideal Specular Reflectance The Phong Model intersects light @ t = 26.9 What s a good value for epsilon? Depends on hardware precision & scene dimensions Does Ray Tracing Simulate Physics? Monte-Carlo Integration Sampling Monte-Carlo Ray Tracing vs. Path Tracing Aj Ai Does Ray Tracing Simulate Physics? Forward Ray Tracing No. traditional ray tracing is also called backward ray tracing In reality, photons actually travel from the light to the eye Start from the light source But very, very low probability to reach the eye What can we do about it? Always send a ray to the eye. still not efficient 1

Transparent Shadows? Is this Traditional Ray Tracing? What to do if the shadow ray sent to the light source intersects a transparent object? Pretend it s opaque? Multiply by transparency color? (ignores refraction & does not produce caustics) Unfortunately, ray tracing is full of dirty tricks Images by Henrik Wann Jensen No, Refraction and complex reflection for illumination are not handled properly in traditional (backward) ray tracing Refraction and the Lifeguard Problem Running is faster than swimming Water Lifeguard Beach Does Ray Tracing Simulate Physics? Monte-Carlo Integration Sampling Monte-Carlo Ray Tracing vs. Path Tracing Run Person in trouble Swim Clean mathematical framework for lighttransport simulation At each point, outgoing light in one direction is the integral of incoming light in all directions multiplied by reflectance property L(,) = E(,) + ρ(ω,)l(x,ω)g(x,)v(x,) da L (,) is the radiance from a point on a surface in a given direction 2

L(,) = E(,) + ρ x '(ω,)l(x,ω)g(x,)v(x,) da L(,) = E(,) + ρ x '(ω,)l(x,ω)g(x,)v(x,) da E(,) is the emitted radiance from a point: E is non-zero only if is emissive (a light source) Sum the contribution from all of the other surfaces in the scene ω x ω x L(,) = E(,) + ρ x '(ω,)l(x,ω)g(x,)v(x,) da L(,) = E(,) + ρ x '(ω,)l(x,ω)g(x,)v(x,) da For each x, compute L(x, ω), the radiance at point x in the direction ω (from x to ) scale the contribution by ρ (ω,), the reflectivity (BRDF) of the surface at ω x ω x For each x, compute V(x,), the visibility between x and : 1 when the surfaces are unobstructed along the direction ω, 0 otherwise L(,) = E(,) + ρ x '(ω,)l(x,ω)g(x,)v(x,) da L(,) = E(,) + ρ x '(ω,)l(x,ω)g(x,)v(x,) da For each x, compute G(x, ), which describes the on the geometric relationship between the two surfaces at x and x 3

Intuition about G(x,)? Which arrangement of two surfaces will yield the greatest transfer of light energy? Why? Rendering Equation Radiosity L(,) = E(,) + ρ(ω,)l(x,ω)g(x,)v(x,) da Radiosity assumption: perfectly diffuse surfaces (not directional) B = E + ρ Bx G(x,)V(x,) discretize n B i = E i + ρ i Fij B j j=1 Reading for :, Kajiya, SIGGRAPH 1986 Does Ray Tracing Simulate Physics? Monte-Carlo Integration Probabilities and Variance Analysis of Monte-Carlo Integration Sampling Monte-Carlo Ray Tracing vs. Path Tracing Monte-Carlo Computation of π Convergence & Error Take a random point (x,y) in unit square Test if it is inside the ¼ disc Let s compute 0.5 by flipping a coin: Is x2 + y2 < 1? Probability of being inside disc? area of ¼ unit circle / area of unit square = π /4 π 4 * number inside disc / total number The error depends on the number or trials 1 flip: 0 or 1 average error = 0.5 2 flips: 0, 0.5, 0.5 or 1 average error = 0. 25 4 flips: 0 (*1),0.25 (*4), 0.5 (*6), 0.75(*4), 1(*1) average error = 0.1875 Unfortunately, doubling the number of samples does not double accuracy 4

Another Example: Review of (Discrete) Probability We know it should be 1.0 In practice with uniform samples: error σ 2 - σ 2 Random variable can take discrete values x i Probability p i for each x i 0 < p i < 1, Σ p i =1 Expected value Expected value of function of random variable f(x i ) is also a random variable N Variance & Standard Deviation Variance σ 2 : deviation from expected value Expected value of square difference Also Standard deviation σ: square root of variance (notion of error, RMS) Monte Carlo Integration Turn integral into finite sum Use n random samples As n increases Expected value remains the same Variance decreases by n Standard deviation (error) decreases by Thus, converges with Advantages of MC Integration Few restrictions on the integrand Doesn t need to be continuous, smooth,... Only need to be able to evaluate at a point Extends to high-dimensional problems Same convergence Conceptually straightforward Efficient for solving at just a few points Disadvantages of MC Integration Noisy Slow convergence Good implementation is hard Debugging code Debugging math Choosing appropriate techniques Punctual technique, no notion of smoothness of function (e.g., between neighboring pixels) 5

Questions? 1 glossy sample per pixel 256 glossy samples per pixel Does Ray Tracing Simulate Physics? Monte-Carlo Integration Sampling Stratified Sampling Importance Sampling Monte-Carlo Ray Tracing vs. Path Tracing Domains of Integration Pixel, lens (Euclidean 2D domain) Time (1D) Hemisphere Work needed to ensure uniform probability Example: Light Source We can integrate over surface or over angle But we must be careful to get probabilities and integration measure right! Sampling the source uniformly Sampling the hemisphere uniformly source hemisphere Stratified Sampling Stratified Sampling Example With uniform sampling, we can get unlucky E.g. all samples in a corner To prevent it, subdivide domain Ω into non-overlapping regions Ω i Each region is called a stratum Take one random samples per Ω i Unstratified Stratified Slide from Henrik Wann Jensen 6

Sampling uniform sampling (or uniform random) sensitive to choice of samples all samples weighted equally Importance Sampling dense sampling where function has greater magnitude less sensitive to choice of samples weights (width) for dense samples are reduced Uniform vs. Importance Sampling Choose p wisely to reduce variance Want to use a p that resembles f Does not change convergence rate (still sqrt) But decreases the constant bad good Uniform vs. Importance Sampling 5 Samples/Pixel 25 Samples/Pixel Slide from Jason Lawrence Uniform vs. Importance Sampling uniform Slide from Jason Lawrence Questions? 75 Samples/Pixel Naïve sampling strategy Slide from Jason Lawrence Optimal sampling strategy Veach & Guibas "Optimally Combining Sampling Techniques for Monte Carlo Rendering SIGGRAPH 95 7

Reading for : "A Theoretical Framework for Physically Based Rendering", Lafortune and Willems, Computer Graphics Forum, 1994. Ray Casting Ray Tracing Cast a ray from the eye through each pixel Cast a ray from the eye through each pixel Trace secondary rays (light, reflection, refraction) Monte-Carlo Ray Tracing Importance of Sampling the Light Does Ray Tracing Simulate Physics? Monte-Carlo Integration Sampling Monte-Carlo Ray Tracing & Path Tracing Cast a ray from the eye through each pixel Cast random rays to accumulate radiance contribution Without explicit light sampling With explicit light sampling Recurse to solve the Rendering Equation 1 path per pixel Should also systematically sample the primary light 4 path per pixel 8

Monte Carlo Path Tracing Trace only one secondary ray per recursion But send many primary rays per pixel (performs antialiasing as well) Ray Tracing vs Path Tracing 2 bounces 5 glossy samples 5 shadow samples How many rays cast per pixel? 1main ray + 5 shadow rays + 5 glossy rays + 5x5 shadow rays + 5*5 glossy rays + 5x5x5 shadow rays = 186 rays How many 3 bounce paths can we trace per pixel for the same cost? 186 rays / 8 ray casts per path = ~23 paths Which will probably have less error? Questions? 10 paths/pixel Readings for Tuesday (3/22) pick one: 100 paths/pixel Rendering Caustics on Non-Lambertian Surfaces, Henrik Wann Jensen, Graphics Interface 1996. Global Illumination using Photon Maps, Henrik Wann Jensen, Rendering Techniques 1996. Images from Henrik Wann Jensen 9