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

Similar documents
Distributed Ray Tracing

Lecture 7 - Path Tracing

Global Illumination The Game of Light Transport. Jian Huang

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

INFOGR Computer Graphics. Jacco Bikker - April-July Lecture 14: Grand Recap. Welcome!

INFOMAGR Advanced Graphics. Jacco Bikker - February April Welcome!

EECS 487: Interactive Computer Graphics

Lecture 10: Ray tracing

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

Reading. Distribution Ray Tracing. BRDF, revisited. Pixel anti-aliasing. ω in. Required: Shirley, section Further reading:

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

Specular reflection. Lighting II. Snell s Law. Refraction at boundary of media

Distribution Ray Tracing

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

Physically Realistic Ray Tracing

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

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

Photorealism: Ray Tracing

Lighting and Shading

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

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

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

Anti-aliasing and Monte Carlo Path Tracing

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

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

Sung-Eui Yoon ( 윤성의 )

Distributed Ray Tracing

CS 428: Fall Introduction to. Raytracing. Andrew Nealen, Rutgers, /18/2009 1

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

CS-184: Computer Graphics. Administrative

INFOGR Computer Graphics

Shadows. COMP 575/770 Spring 2013

Lecture 18: Primer on Ray Tracing Techniques

Ray tracing. EECS 487 March 19,

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

Shading, lighting, & BRDF Theory. Cliff Lindsay, PHD

The Rendering Equation and Path Tracing

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

INFOGR Computer Graphics

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

Ray Tracing. Kjetil Babington

COMP 4801 Final Year Project. Ray Tracing for Computer Graphics. Final Project Report FYP Runjing Liu. Advised by. Dr. L.Y.

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

Local vs. Global Illumination & Radiosity

Intro to Ray-Tracing & Ray-Surface Acceleration

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

Ray Tracing. Johns Hopkins Department of Computer Science Course : Rendering Techniques, Professor: Jonathan Cohen

Recent Advances in Monte Carlo Offline Rendering

COMP371 COMPUTER GRAPHICS

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

Problem Set 4 Part 1 CMSC 427 Distributed: Thursday, November 1, 2007 Due: Tuesday, November 20, 2007

Enhancing Traditional Rasterization Graphics with Ray Tracing. March 2015

Global Illumination. COMP 575/770 Spring 2013

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

CS354 Computer Graphics Ray Tracing. Qixing Huang Januray 24th 2017

Ray Tracing. CS334 Fall Daniel G. Aliaga Department of Computer Science Purdue University

Practical 2: Ray Tracing

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

Interactive Methods in Scientific Visualization

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

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

Schedule. MIT Monte-Carlo Ray Tracing. Radiosity. Review of last week? Limitations of radiosity. 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

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Illumination Algorithms

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

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

The Rendering Equation & Monte Carlo Ray Tracing

Practical Techniques for Ray Tracing in Games. Gareth Morgan (Imagination Technologies) Aras Pranckevičius (Unity Technologies) March, 2014

CPSC GLOBAL ILLUMINATION

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

The Rendering Equation. Computer Graphics CMU /15-662

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

Ray Tracing. Brian Curless CSEP 557 Fall 2016

Computer Graphics. Si Lu. Fall uter_graphics.htm 11/22/2017

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

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

CS354R: Computer Game Technology

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

Computer Graphics. Lecture 14 Bump-mapping, Global Illumination (1)

COMP 175 COMPUTER GRAPHICS. Lecture 11: Recursive Ray Tracer. COMP 175: Computer Graphics April 9, Erik Anderson 11 Recursive Ray Tracer

Advanced Graphics. Global Illumination. Alex Benton, University of Cambridge Supported in part by Google UK, Ltd

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

COMP environment mapping Mar. 12, r = 2n(n v) v

Computer Graphics. Lecture 9 Environment mapping, Mirroring

Ray Tracing: Special Topics CSCI 4239/5239 Advanced Computer Graphics Spring 2018

CS559 Computer Graphics Fall 2015

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

Ø Sampling Theory" Ø Fourier Analysis Ø Anti-aliasing Ø Supersampling Strategies" Ø The Hall illumination model. Ø Original ray tracing paper

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

Review for Ray-tracing Algorithm and Hardware

Raytracing CS148 AS3. Due :59pm PDT

INFOGR Computer Graphics

Ray-Tracing. Misha Kazhdan

Today. Global illumination. Shading. Interactive applications. Rendering pipeline. Computergrafik. Shading Introduction Local shading models

So far, we have considered only local models of illumination; they only account for incident light coming directly from the light sources.

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

Rendering Algorithms: Real-time indirect illumination. Spring 2010 Matthias Zwicker

03 RENDERING PART TWO

Complex Shading Algorithms

Transcription:

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

Today s Agenda: Limitations of Whitted-style Ray Tracing Monte Carlo Path Tracing

INFOGR Lecture 10 Ground Truth 3 Whitted Recap Whitted-style Ray Tracing In 1980, State of the Art consisted of: Rasterization Shading: either diffuse (N L) or specular ((N H) n ), both not taking into account fall-off (Phong) Reflection, using environment maps (Blinn & Newell *) Stencil shadows (Williams **) Goal: Solve reflection and refraction Improved model: Based on classical ray optics * : Blinn, J. and Newell, M. 1976. Texture and Reflection in Computer Generated Images. Communications of the ACM 19:10 (1976), 542 547. ** : Williams, L. 1978. Casting curved shadows on curved surfaces. In Computer Graphics (Proceedings of SIGGRAPH 78), vol. 12, 270 274.

INFOGR Lecture 10 Ground Truth 4 Whitted Recap Whitted-style Ray Tracing

INFOGR Lecture 10 Ground Truth 5 Whitted Recap Whitted-style Ray Tracing Color at pixel: sphere material color * refracted ray + sphere material color * reflected ray This is a recursive process.

INFOGR Lecture 10 Ground Truth 6 Whitted Recap Whitted-style Ray Tracing Fresnel equations Snell s law Color at pixel: sphere material color * refracted ray + sphere material color * reflected ray This is a recursive process. color Trace( O, D ) I, N, mat = NearestIntersection( O, D ) if (mat == DIFFUSE) return mat.color * DirectIllumination( I, N ) if (mat == MIRROR) return mat.color * Trace( I, reflect( D, N ) ) if (mat == GLASS) return mat.color * (Trace( (X * Trace( I, reflect( I, reflect( D, N D, ) ) N + ) ) + (1 X) Trace( * Trace( I, refract( I, refract( D, N ) D, ) ) N ) ) ) angle of incidence = angle of reflection

INFOGR Lecture 10 Ground Truth 7 Whitted Recap Whitted-style Ray Tracing Improved model: Based on classical ray optics Dust off your physics books. Physical basis of Whitted-style ray tracing: Light paths are generated (backwards) from the camera to the light sources, using rays to simulate optics. Whitted-style ray tracing is deterministic: it cannot simulate area lights, glossy reflections, and diffuse reflections.

INFOGR Lecture 10 Ground Truth 8

Ray Tracing for Games

Today s Agenda: Limitations of Whitted-style Ray Tracing Monte Carlo Path Tracing

INFOGR Lecture 10 Ground Truth 11 Monte-Carlo Distributed Ray Tracing * Problem: Ray tracing is currently limited to sharp shadows, sharp reflections, and sharp refraction. Goal: Augment Whitted-style ray tracing with glossy reflections and refractions, as well as soft shadows. *: Distributed Ray Tracing, Cook et al., 1984.

Ray Tracing for Games

Ray Tracing for Games

INFOGR Lecture 10 Ground Truth 14 Monte Carlo?

INFOGR Lecture 10 Ground Truth 15 Monte Carlo

INFOGR Lecture 10 Ground Truth 16 Monte Carlo Analytic Soft Shadows Anatomy of a shadow regions Fully occluded area: umbra Partially occluded area: penumbra A soft shadow requires an area light source. In nature, all light sources are area lights (although some approximate point lights).

INFOGR Lecture 10 Ground Truth 17 Monte Carlo Analytic Soft Shadows Surface points in the penumbra are lit by a part of the light source. Rendering soft shadows requires that we determine the visible portion of the light source. In most cases, this is a very hard problem.

INFOGR Lecture 10 Ground Truth 18 Monte Carlo Approximate Soft Shadows When using shadow mapping, we can simulate soft shadows by blurring the shadow map. In this example, filter kernel radius is adjusted based on the distance from the occluder.

INFOGR Lecture 10 Ground Truth 19 Monte Carlo Calculating Accurate Soft Shadows Rendering soft shadows requires that we determine the visible portion of the light source. In other words: The amount of light cast on a surface point P by area light L is determined by the integral of the visibility between P and L over the surface of the light source: Monte-Carlo Integration To solve this integral for the generic case, we will use Monte-Carlo integration. Using Monte-Carlo, we replace the integral by the expected value of a stochastic experiment. I L P = V(P, L) A L

INFOGR Lecture 10 Ground Truth 20 Monte Carlo Stochastic shadows For soft shadows, we want to know the visible area of a light source, which can be 0..100%. The light source could be (partially) obscured by any number of objects. We can approximate the visibility of the light source using a number of random rays. Using 6 rays: 6 V 1 6 i=1 V i

INFOGR Lecture 10 Ground Truth 21 Monte Carlo Stochastic shadows For soft shadows, we want to know the visible area of a light source, which can be 0..100%. The light source could be (partially) obscured by any number of objects. We can approximate the visibility of the light source using a number of random rays. Using N rays: N V 1 N i=1 V i

INFOGR Lecture 10 Ground Truth 22 Monte Carlo Stochastic shadows N V 1 N i=1 V i As N approaches infinity, the result becomes equal to the expected value, which is the integral we were looking for. Before that, the result will exhibit variance. In the case of soft shadows, this shows up as noise.

INFOGR Lecture 10 Ground Truth 23 Monte Carlo Approximate Diffuse Reflections When rendering diffuse reflections, we face a similar problem: A glossy surface reflects light arriving from a range of directions. In rasterization, we can achieve this by blurring the environment map.

INFOGR Lecture 10 Ground Truth 24 Monte Carlo Note that a correct glossy reflection requires a filter kernel size based on distance to the reflected object.

INFOGR Lecture 10 Ground Truth 25 Monte Carlo Stochastic reflections

INFOGR Lecture 10 Ground Truth 26 Monte Carlo Variance As long as we don t take an infinite amount of samples, the result of the stochastic process exhibits variance. 1 spp 4 spp

INFOGR Lecture 10 Ground Truth 27 Monte Carlo Variance As long as we don t take an infinite amount of samples, the result of the stochastic process exhibits variance. 1 spp 100 spp

INFOGR Lecture 10 Ground Truth 28 Monte Carlo Variance reduction: stratification The variance in random sampling can be reduced using stratification. N=16

INFOGR Lecture 10 Ground Truth 29 Monte Carlo Variance reduction: stratification The variance in random sampling can be reduced using stratification. N=16

INFOGR Lecture 10 Ground Truth 30 Monte Carlo Variance reduction: stratification The variance in random sampling can be reduced using stratification. Uniform vs stratified, 36 samples, 6x6 strata

INFOGR Lecture 10 Ground Truth 31 Monte-Carlo Distributed Ray Tracing Integrating over area of light sources: soft shadows Integrating over reflection cone: glossy reflections Integrating over pixel: anti-aliasing Integrating over time: motion blur Integrating over lens: depth of field Integrating over wavelength: dispersion

INFOGR Lecture 10 Ground Truth 32 Monte Carlo Distributed Ray Tracing Improved model: Still based on classical ray optics Combined with probability theory to solve integrals Physical basis of distributed ray tracing: Light paths are generated (backwards) from the camera to the light sources, using rays to simulate optics. Distributed ray tracing requires many rays to bring down variance to acceptable levels.

Ray Tracing for Games

INFOGR Lecture 10 Ground Truth 34

INFOGR Lecture 10 Ground Truth 35

INFOGR Lecture 10 Ground Truth 36 Monte Carlo Monte Carlo in Rasterization Stochastic Depth of Field using Hardware Accelerated Rasterization, Robert Toth & Erik Lindler, 2008

INFOGR Lecture 10 Ground Truth 37 Monte Carlo Monte Carlo in Rasterization Screen Space Ambient Occlusion, CryEngine 2, 2007.

INFOGR Lecture 10 Ground Truth 38 Monte Carlo Monte Carlo in Rasterization Light from an environment map, from: Wavelet Importance Sampling: Efficiently Evaluating Products of Complex Functions, Clarberg et al., 2005.

INFOGR Lecture 10 Ground Truth 39 Monte Carlo Cost of Distributed Ray Tracing Distributed Ray Tracing is an expensive process: Per primary hit point, we need ~64 shadow rays per light Per primary hit point on a glossy surface, we need ~64 reflection rays, and, for each reflection ray hit point, we need ~64 shadow rays per light. If we use 4x4 anti-aliasing per pixel, multiply the above by 16. Now imagine a glossy surface reflects another glossy surface...

INFOGR Lecture 10 Ground Truth 40 Monte Carlo

Today s Agenda: Limitations of Whitted-style Ray Tracing Monte Carlo Path Tracing

INFOGR Lecture 10 Ground Truth 42 Physically Based Ray Tree Using distributed ray tracing: The energy via N shadow rays is averaged The energy via N reflection rays is averaged For each of them, the energy of N shadow rays is averaged. The energy via each shadow ray is very low.

INFOGR Lecture 10 Ground Truth 43 Physically Based Diffuse reflections Apart from specular and glossy materials, diffuse materials also reflect light.

INFOGR Lecture 10 Ground Truth 44 Physically Based Diffuse reflections Apart from specular and glossy materials, diffuse materials also reflect light. This is why a shadow is seldom black.

INFOGR Lecture 10 Ground Truth 45 Physically Based Physically based rendering Calculating all light transport from the light sources to the camera, directly or via scene surfaces. Nature solves this using a random walk : a large number of photons travelling through space from lights to sensors.

INFOGR Lecture 10 Ground Truth 46 Physically Based

INFOGR Lecture 10 Ground Truth 47 Physically Based P R P T P T + P R = 1 N L

INFOGR Lecture 10 Ground Truth 48 Physically Based Path Tracing Color Trace( vec3 O, vec3 D ) { I,N,mat = Intersect( O, D ); if (mat.islight()) return mat.emissive; vec3 R = RandomReflection( N ); BRDF = mat.color; return BRDF * dot( N, R ) * Trace( I, R ); }

INFOGR Lecture 10 Ground Truth 49 Physically Based Ray Tree A path may bounce to the light Or to another object Or in some other direction

INFOGR Lecture 10 Ground Truth 50 Physically Based Path Tracing Tracing photons backwards, from the camera to the light source, by performing a random walk. Instead of splitting the path, we randomly evaluate one branch. By using many paths, we explore all possible branches. We have the same number of primary rays as we have shadow rays.

Today s Agenda: Limitations of Whitted-style Ray Tracing Monte Carlo Path Tracing

INFOGR Computer Graphics J. Bikker - April-July 2015 - Lecture 10: Ground Truth END of Ground Truth next lecture: Accelerate