Precomputed Radiance Transfer: Theory and Practice

Similar documents
Spherical Harmonic Lighting: The Gritty Details Robin Green

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

CENG 477 Introduction to Computer Graphics. Ray Tracing: Shading

CS 563 Advanced Topics in Computer Graphics Spherical Harmonic Lighting by Mark Vessella. Courtesy of

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.

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

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

x ~ Hemispheric Lighting

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

Topic 9: Lighting & Reflection models. Lighting & reflection The Phong reflection model diffuse component ambient component specular component

Computer Graphics. Illumination and Shading

Computer Graphics (CS 4731) Lecture 16: Lighting, Shading and Materials (Part 1)

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

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

Overview. Radiometry and Photometry. Foundations of Computer Graphics (Spring 2012)

Computer Graphics (CS 543) Lecture 7b: Intro to lighting, Shading and Materials + Phong Lighting Model

Chapter 1 Introduction

Illumination & Shading: Part 1

Lecture 15: Shading-I. CITS3003 Graphics & Animation

CSE 167: Introduction to Computer Graphics Lecture #6: Lights. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

Illumination and Shading

Adding Spherical Harmonic Lighting to the Sushi Engine. Chris Oat 3D Application Research Group. ATI Research, Inc.

The Rendering Equation and Path Tracing

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

Point based global illumination is now a standard tool for film quality renderers. Since it started out as a real time technique it is only natural

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

Lighting and Shading Computer Graphics I Lecture 7. Light Sources Phong Illumination Model Normal Vectors [Angel, Ch

Motivation. My General Philosophy. Assumptions. Advanced Computer Graphics (Spring 2013) Precomputation-Based Relighting

Assignment 3: Path tracing

A Frequency Analysis of Light Transport

Illumination in Computer Graphics

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

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

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

Shading I Computer Graphics I, Fall 2008

Global Illumination. COMP 575/770 Spring 2013

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

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

Reflection models and radiometry Advanced Graphics

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

CPSC 314 LIGHTING AND SHADING

The Rendering Equation. Computer Graphics CMU /15-662

Virtual Reality for Human Computer Interaction

w Foley, Section16.1 Reading

Lighting and Shading. Slides: Tamar Shinar, Victor Zordon

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

Sung-Eui Yoon ( 윤성의 )

Visualisatie BMT. Rendering. Arjan Kok

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

Photometric Stereo. Lighting and Photometric Stereo. Computer Vision I. Last lecture in a nutshell BRDF. CSE252A Lecture 7

rendering equation computer graphics rendering equation 2009 fabio pellacini 1

Lighting and Materials

Shading and Illumination

Spherical Harmonic Gradients for Mid-Range Illumination

Spherical Harmonics, Precomputed Radiance Transfer and Realtime Radiosity in Computer Games

Raytracing CS148 AS3. Due :59pm PDT

Radiance. Radiance properties. Radiance properties. Computer Graphics (Fall 2008)

Simple Lighting/Illumination Models

Comp 410/510 Computer Graphics. Spring Shading

Global Illumination and the Rendering Equation

BRDF Computer Graphics (Spring 2008)

Introduction to Computer Graphics 7. Shading

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

Illumination. The slides combine material from Andy van Dam, Spike Hughes, Travis Webb and Lyn Fong

CEng 477 Introduction to Computer Graphics Fall

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

Efficient Irradiance Normal Mapping

Precomputed Radiance Transfer with Spatially-Varying Lighting Effects

Raytracing. COSC 4328/5327 Scott A. King

OpenGl Pipeline. triangles, lines, points, images. Per-vertex ops. Primitive assembly. Texturing. Rasterization. Per-fragment ops.

CS5620 Intro to Computer Graphics

Illumination & Shading

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

Illumination Under Trees. Nelson Max University of Tokyo, and University of California, Davis

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

Introduction. Lighting model Light reflection model Local illumination model Reflectance model BRDF

Image Based Lighting with Near Light Sources

Image Based Lighting with Near Light Sources

Ligh%ng and Reflectance

Lecture 18: Primer on Ray Tracing Techniques

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

Other Rendering Techniques CSE 872 Fall Intro You have seen Scanline converter (+z-buffer) Painter s algorithm Radiosity CSE 872 Fall

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

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

CPSC GLOBAL ILLUMINATION

Local vs. Global Illumination & Radiosity

Reflection and Shading

Lecture 7 - Path Tracing

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

Illumination. Michael Kazhdan ( /657) HB Ch. 14.1, 14.2 FvDFH 16.1, 16.2

Reading. Shading. An abundance of photons. Introduction. Required: Angel , 6.5, Optional: Angel 6.4 OpenGL red book, chapter 5.

Recent Advances in Monte Carlo Offline Rendering

Shading. Brian Curless CSE 557 Autumn 2017

Precomputation-Based Real-Time Rendering

And if that 120MP Camera was cool

ECS 175 COMPUTER GRAPHICS. Ken Joy.! Winter 2014

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

Shading. Why we need shading. Scattering. Shading. Objectives

COMPUTER GRAPHICS COURSE. LuxRender. Light Transport Foundations

Transcription:

1

Precomputed Radiance Transfer: Peter-Pike Sloan Microsoft Jaakko Lehtinen Helsinki Univ. of Techn. & Remedy Entertainment Jan Kautz MIT 2

Introduction Jan Kautz MIT 3

Introduction We see here an example of a real-world scene which has a lot of visual complexity and richness. Generating synthetic images that come close to this is an extremely challenging problem. Having them animate and respond to a users control is even more daunting. We will discuss some of the issues that need to be addressed to meet this challenge. 4

How do we get there? Geometric Complexity Material Complexity Lighting Complexity Transport Complexity Synergy There are many types of scene complexity which operate individually and in synergy with each other to generate the visual complexity of the resulting image. 5

Geometric Complexity Real-world scenes have a lot of large-scale detail 6

Material Complexity Models how light interacts with a surface Structure below visible scale At visible scale but not geometry 7

Lighting Complexity What kind of lighting environment is an object in? Directional/point lights Directional + ambient Smooth low frequency lighting Completely general 8

Lighting Complexity What kind of lighting environment is an object in? Directional/point lights Directional + ambient Smooth low frequency lighting Completely general 9

Lighting Complexity What kind of lighting environment is an object in? Directional/point lights Directional + ambient Smooth low frequency lighting Completely general 10

Lighting Complexity What kind of lighting environment is an object in? Directional/point lights Directional + ambient Smooth low frequency lighting Completely general 11

Transport Complexity How light interacts with objects/scene at a visible scale Shadows Inter-reflections Caustics Translucency subsurface scattering 12

Transport Complexity How light interacts with objects/scene at a visible scale Shadows Inter-reflections Caustics Translucency subsurface scattering 13

Transport Complexity How light interacts with objects/scene at a visible scale Shadows Inter-reflections Caustics Translucency subsurface scattering 14

Transport Complexity How light interacts with objects/scene at a visible scale Shadows Inter-reflections Caustics Translucency subsurface scattering 15

Some of all of this Real scenes have all of these forms of complexity High realism on one is not necessarily interesting without the others Complex materials lit by single point light Complex lighting environments on diffuse surfaces with no shadows 16

Goals Interactively render realistic objects Challenges Complex materials Brushed metal, Weaved objects General lighting environments Area instead of point lights Allow to dynamically change the incident lighting Transport effects Shadows, inter-reflections, subsurface scattering The primary goal of this course is to accurately render objects in general lighting environments at interactive rates. There are several challenges that must be overcome to achieve this goal. Real objects have complex and spatially varying material properties so we need to support general reflection models and handle spatial variation. General lighting environments are much more compelling compared to simple point lighting models. Run time integration over general area lighting models is expensive with traditional techniques. We would like to support complex transport effects soft shadows from area lights, inter-reflection, caustics and subsurface scattering, while maintaining interactive rendering rates. 17

PRT What is Precomputed Radiance Transfer? A way to shade objects under different illumination Includes direct & indirect lighting, caustics, subsurface scat. Any kind of transport is possible Real-time, allowing lighting to change Illumination can come from all directions env-map Usually assumed to be far away Depending on implementation, possible restrictions on lighting e.g. low-frequency 18

PRT What does it not do? It does not do full global illumination for arbitrary dynamic scenes Objects have to be static! First ideas on how to deal with animations are appearing Object-to-object interaction is limited Some new algorithms coming out though 19

Examples Bust illuminated with a forest environment. Note the soft shadows. 20

Examples Statue illuminated by two area sources, one green and one red. Number and sizes of light sources don't occur any performance penalty when PRT is used. 21

Examples Some more examples. Note the nice soft shadows. 22

Examples PRT can also be used in volumes. 23

Demos 24

Course Overview 8:30 9:00 Introduction Jan Kautz 9:00 9:15 Diffuse Precomputed Radiance Transfer Jan Kautz 9:15 10:15 General Precomputed Radiance Transfer Jaakko Lehtinen Break 10:30 11:00 SH Light Representations Jan Kautz 11:00 11:30 Practical PRT I Peter-Pike Sloan 11:30 12:00 Practical PRT II Peter-Pike Sloan 12:00 12:15 Conclusions/Summary Peter-Pike Sloan 25

Overview Introduction Rendering Equation Neumann Series Shading Algorithms Basis Functions In this introduction, we will learn about the Rendering Equation, its Neumann expansion, different shading algorithms, and basis functions. 26

Background Rendering Input: Geometry Material Lighting Shading: How much light is reflected from each point to the viewer Loosely put, rendering takes input geometry, materials, lights and produces an image. Shading computes how much light is reflect from each visible point to the viewer There are many different ways to compute an image given the input. Precomputed Radiance Transfer is a technique to accelerate that process. PRT deals with the shading computation how much light is reflected from every visible point. The most general formulation for that is the so-called Rendering Equation. We will have a look at it in the following slides. 27

Background Shading Integrate incident light * visibility * BRDF Emitter 1 Bidirectional reflectance distribution function Defines: material properties shininess, color, Says: how much light is attenuated Emitter 2 Object Shading needs to do the following: Integrate over all incoming light directions, multiply with the binary visibility function and multiply with the material properties e.g. here: light is coming from mostly the blue cone of directions. This computation has to be repeated for every point on the surface, which makes it a fairly costly operation. 28

Background Shading Actually: more complicated, light can bounce Emitter 1 Emitter 2 Object In reality this is even more complicated, as light can bounce around on the object, before it is finally reflected towards the viewer. 29

Rendering Equation r r r L p d L p d f p s d L p s H s ds r r r = e + r, N p Ω Given an object illuminated in a lighting environment, the rendering equation models the equilibrium of the flow of light in the scene. It can be used to determine how light a visible point reflects towards the viewer. We will walk through a hemispherical formulation of this equation. 30

Rendering Equation r r r L p d L p d f p s d L p s H s ds r r r = e + r, N p Ω Radiance leaving point p in direction d The desired quantity is the radiance leaving a point on the object P in a given direction d. Radiance is the intensity of light from a point to a certain direction. 31

Rendering Equation r r r L p d L p d f p s d L p s H s ds r r r = e + r, N p Ω Radiance emitted from point p in direction d The first term is the radiance emitted directly from the point in the given direction. In our work we will assume that no objects emit light, they are just lit by a distant lighting environment the source radiance function. 32

Rendering Equation r r r L p d L p d f p s d L p s H s ds r r r = e + r, N p Ω Integral over directions s on the hemisphere around p This is followed by an integral over the hemisphere around the point, where s is used to denote a direction on this hemisphere 33

Rendering Equation r r r L p d L p d f p s d L p s H s ds r r r = e + r, N p Ω Radiance arriving at point p from direction s also LHS The second term is the radiance arriving at point P from the direction S, note that this is also the variable we are solving for so this is an integral equation. 34

Rendering Equation r r r L p d L p d f p s d L p s H s ds r r r = e + r, N p Ω BRDF at point p evaluated for incident direction s in outgoing direction d r r BRDF: defines look of material. 4D function: s d f p r The 1 st factor inside the integral is the BRDF of the surface at point P, the BRDF is a 4D function that models what percent of light for some input direction s leaves in some outgoing direction d. 35

Rendering Equation r r r L p d L p d f p s d L p s H s ds r r r = e + r, N p Ω Lamberts law cosine between normal and -s = dotn p, -s The final term is the cosine term that comes from lamberts law due to projected area. 36

Neumann Expansion r r r L p d = L p d + L p d + L 0 1 Outgoing radiance expressed as infinite series One convenient way to reason about the solution to this integral equation is by using a Neumann expansion of this expression, where outgoing radiance is expressed as an infinite series. 37

Neumann Expansion r r r L p d = L p d + L p d + L 0 1 Direct lighting arriving at point p from distant environment The first term in this series is the direct lighting arriving at point P from a distant lighting environment the source radiance environment we referred to earlier. 38

39 0 1 L p d L p d L p d = + + r r r L Neumann Expansion Neumann Expansion Direct lighting arriving at point p from distant environment ds s H s p V s L d s p f d p L p N env r r r r r r r r, 0 = Ω ds s H s p V s L d s p f d p L p N env r r r r r r r r, 0 = Ω This term is an integral over the hemisphere at the point p.

Neumann Expansion r r r L p d = L0 p d + L1 p d + L r r r r r L p d = f p, s d L s V p s H 0 r env N p Ω r r s ds Source Radiance distant lighting environment One of the new factors in this expression is Lenv the source radiance function we are assuming that this is the only source of light in the scene. It is assumed to be far away, so there is no dependence on the position p same incident radiance at every p --- usually an environment map is used to represent this distant lighting. This is just a conventional integral, the source radiance function only exists inside the integral. 40

Neumann Expansion r r r L p d = L0 p d + L1 p d + L r r r r r L p d = f p, s d L s V p s H 0 r env N p Ω r r s ds Visibility function - binary The next new factor is the visibility function this is a binary function that is 1 in a given direction if the point can see the distant lighting environment, and zero otherwise. L0 models how light that directly reaches the surface contributes to outgoing radiance. 41

Neumann Expansion r r r L p d = L p d + L p d + L 0 1 All paths from source that take 1 bounce The next term in the expansion models all paths from the source radiance function that reach the given point after a single bounce and contribute to outgoing radiance in the given direction. 42

Neumann Expansion r r r L p d = L p d + L p d + L r r r r r r L p d = f p s d L p s V p s H s ds, 1 0 1 1 r 0 N p Ω L 0 All paths from source that take 1 bounce This is also just a conventional integral where the previous term L_0 is inside of the integral. 43

Neumann Expansion r r r r r r L p d = f p s d L p s V p s H s ds, 1 1 r r r L p d = L p d + L p d + L 0 1 i r i N p Ω L i-1 All paths from source that take i bounces In general the i-th bounce models how all of the energy from the previous bounce contributes to outgoing radiance in the given direction. 44

Overview Introduction Rendering Equation Neumann Series Shading Algorithms Basis Functions 45

Shading Algorithms Real-time Rendering: Approximations to Rendering Equation Direct lighting indirect lighting: ambient term Point lights no area lights Hard shadows no soft shadows Distant environment maps no nearby emitters In real-time rendering, we usually make approximation to the full rendering equation, as it is too expensive to compute on the fly. Common approximations are: - only direct lighting no indirect illumination at all, a simple ambient term can make up for it somewhat - point lights area lights cast soft shadows, which are harder to compute, since the light source needs to be sampled - distant environment maps this means that the same incident light arrives at all points of an object, and so there is no need to recompute it 46

Shading Algorithms Lighting Complexity env. map light single area light Environment Mapping [Graphics [Hardware] Precomputed Radiance Transfer Soft Shadows Precomputed Radiance Transfer point lights [Graphics [Hardware] simple Hard Shadows shadows [Daubert03] indirect Transport Complexity There are various previous algorithms that deal with real-time shading. The graph here shows with what type of lighting complexity versus transport complexity they can deal with. Precomputed Radiance Transfer fills the gap for natural illumination, which can arrive from all directions distant environment map. 47

Overview Introduction Rendering Equation Neumann Series Shading Algorithms Basis Functions 48

Basis Functions Functions can be represented/approximated using basis functions Similar to points in space in different coordinate frames 49

Basis Functions Given some function ft: Figures are courtesy of Robin Green Given basis functions B i t: B 1 t B 2 t B 3 t 50

Basis Functions Project into the function space: = c 1 = c 2 = c 3 Coefficients c i represent function Projection is done by integrating the product of the function ft and the basis functions B_it 51

Basis Functions Reconstruct original function Weight each basis function with coefficient c = 1 c 2 = c 3 = Reconstruction is done by scaling the basis functions with the coefficients c_i. 52

Basis Functions Reconstruct original function Sum them all up N i= 1 c i B i x = In this case: approximation Benefit: fewer numbers needed These scaled basis functions are then summed up. 53

Basis Functions Function: f t real-valued Projection: c = f t B i t dt : f t, B i t Ω i = Reconstruction: N R f t = c ib i t i Optimal for N basis functions least-squares 54

Basis Functions Orthogonal basis functions 0 B i t, B j t = 0 Orthonormal basis functions B t, B t = 1 i 1 i i i = Previously shown projection only holds for orthonormal basis functions! j j 55

Basis Functions Non-orthogonal basis functions B t, B t =? i? j Projection cannot be done directly ~ Define dual basis Bk t : ~ B t, B t i k 1 i = k = 0 else 56

Basis Functions Dual Basis ~ Bk t Bk B i t Is linear combination of basis functions Compute using following equations A A ij i j ~ = k t A 1 kj B j j = B t B t dt B t Matrix is the Gram matrix of the basis 57

Basis Functions Projection into non-ortho. basis with dual ~ c i = f t, B i t Reconstruction with non-orthogonal basis N R f t = c ib i t i 58

Basis Functions Example: Spherical Harmonics Orthonormal basis functions over the sphere Similar to Fourier series θ,ϕ m Y l i = 1 i = 2 i = 3 i = 4 i = 8 i = 12 i = 15 i = 19 59

Basis Functions Spherical Harmonics Recurrence formula for SH band l, mode m Y m l θ, ϕ m P l cosθ Here polynomials 2K = 2K 0 Kl Pl m cos mϕ Pl cosθ, m sin mϕ Pl cosθ cosθ, m l m l 0 m > 0 m < 0 m = 0 are the associated Legendre, The exact definitions can be looked up on the web. If only the first few bands are used, it is more efficient to use explicit formulas, which can be derived by using Maple for example. Here are the exact definitions for the first 25 basis functions. Input is a direction in Cartesian coordinates. The evaluated basis function is written to ylm_array[]. float x = dir[0]; float y = dir[1]; float z = dir[2]; float x2, y2, z2; ylm_array[0] = 0.282095f; //l,m = 0,0 // 1/sqrt4pi ylm_array[1] = 0.488603f * y; //1,-1 //sqrt3/4pi ylm_array[2] = 0.488603f * z; //1,0 ylm_array[3] = 0.488603f * x; //1,1 x2 = x*x; y2 = y*y; z2 = z*z; ylm_array[4] = 1.092548f * x * y; //2,-2 // sqrt15/4pi ylm_array[5] = 1.092548f * y * z; //2,-1 ylm_array[6] = 0.315392f * 3.f*z2-1.f ; //2,0 // sqrt5/16pi ylm_array[7] = 1.092548f * x * z; //2, 1 ylm_array[8] = 0.546274f * x2 - y2; //2,2 // sqrt 15/16pi const float fy30const = 0.373176332590115391414395913199f; //0.25f*sqrt7.f/M_PI; const float fy31const = 0.457045799464465736158020696916f; //1.f/8.0f*sqrt42.f/M_PI; const float fy32const = 1.445305721320277027694690077199f; //0.25f*sqrt105.f/M_PI; const float fy33const = 0.590043589926643510345610277541f; //1.f/8.f*sqrt70.f/M_PI; ylm_array[ 9] = fy33const*y*3.f*x2 - y2; //3,-3 ylm_array[10] = fy32const*2.f*x*y*z; // 3,-2 ylm_array[11] = fy31const*y*5.f*z2-1.f; // 3,-1 ylm_array[12] = fy30const*z*5.f*z2-3.f; // 3,0 ylm_array[13] = fy31const*x*5.f*z2-1.f; // 3,1 ylm_array[14] = fy32const*z*x2-y2; // 3,2 ylm_array[15] = fy33const*x*x2-3.f*y2; // 3,3 60

61 Basis Functions Spherical Harmonics Basis Functions Spherical Harmonics Example definitions in Cartesian coords and so on... 15 2 1 3 2 1 15 2 1 2 5 4 1 3 2 1 1 2 1 1 2 2 2 2 2 2 2 0 2 0 1 zx Y x Y y x Y y x z Y z Y π π π π π = = = = =

Basis Functions Example: Spherical Harmonics Reconstruction: N=4 N=9 N=25 N=26 2 original Here an example environment map is projected in spherical harmonics and then back using 4, 9, 25, and 26^2 basis functions. 62

Basis Functions Example: Haar Wavelets Courtesy Ren Ng Reference 4096 coeffs. 100 coeffs. Alternatively, the Haar wavelet basis functions can be used instead of SH. We will talk briefly about this later on. It should be noted, that wavelets are good at representing all-frequency detail e.g. with 100 coeffs the bright windows are represented well, the not so important darker areas floor is represented with less accuracy. The blocky appearance of the projection with 100 coefficients isn't as bad as it might look, if the BRDF is relatively dull, i.e., the environment will be blurred really heavily. In that case, the blocky appearance does not matter. In case of a very shiny BRDF, the blockiness will appear as blocky reflections. 63

Introduction Questions? 64

65