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

Similar documents
Precomputation-Based Real-Time Rendering

CS : Assignment 2 Real-Time / Image-Based Rendering

All-Frequency Relighting of Glossy Objects

4D Compression and Relighting with High-Resolution Light Transport Matrices

Chapter 7. Conclusions and Future Work

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

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

CS 283: Assignment 3 Real-Time / Image-Based Rendering

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

Shadow and Environment Maps

Precomputed Radiance Transfer: Theory and Practice

All-Frequency Relighting of Non-Diffuse Objects using Separable BRDF Approximation

Chapter 1 Introduction

A Frequency Analysis of Light Transport

BioTechnology. An Indian Journal FULL PAPER. Trade Science Inc. A wavelet based real-time rendering technology for indoor mixed reality ABSTRACT

Exploiting Temporal Coherence for Incremental All-Frequency Relighting

CSE 163: Assignment 3 Final Project

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

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

Compact Representation of Reflectance Fields using Clustered Sparse Residual Factorization

Importance Sampling Spherical Harmonics

Interactive Lighting and Material Design System for Cyber Worlds

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

A Practical and Fast Rendering Algorithm for Dynamic Scenes Using Adaptive Shadow Fields

Interactive Relighting with Dynamic BRDFs

Goals. Advanced Computer Graphics. Course Outline. Course Outline. Course Outline. Course Outline

Parallel Progressive Precomputed Radiance Transfer

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

Subtractive Shadows: A Flexible Framework for Shadow Level of Detail

All-Frequency Shadows Using Non-linear Wavelet Lighting Approximation

Fast, Realistic Lighting and Material Design using Nonlinear Cut Approximation

Precomputation-Based Rendering. Contents

Spherical Harmonic Lighting: The Gritty Details Robin Green

A Theory of Locally Low Dimensional Light Transport

Recent Advances in Monte Carlo Offline Rendering

A Practical and Fast Rendering Algorithm for Dynamic Scenes Using Adaptive Shadow Fields

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

Global Illumination. COMP 575/770 Spring 2013

Shading / Light. Thanks to Srinivas Narasimhan, Langer-Zucker, Henrik Wann Jensen, Ravi Ramamoorthi, Hanrahan, Preetham

Real-Time Ambient Occlusion for Dynamic Character Skins

Practical Product Importance Sampling for Direct Illumination

Sparsely Precomputing The Light Transport Matrix for Real-Time Rendering

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

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

Precomputed Radiance Transfer with Spatially-Varying Lighting Effects

Practical Spherical Harmonics Based PRT Methods

Precomputed Shadow Fields for Dynamic Scenes

x ~ Hemispheric Lighting

A Theory of Locally Low Dimensional Light Transport

Global Illumination and the Rendering Equation

Efficient Wavelet Rotation for Environment Map Rendering

Hardware Shading: State-of-the-Art and Future Challenges

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

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

Analysis of Planar Light Fields from Homogeneous Convex Curved Surfaces Under Distant Illumination

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

Image Based Lighting with Near Light Sources

Image Based Lighting with Near Light Sources

Real-time editing and relighting of homogeneous translucent materials

Image Base Rendering: An Introduction

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

Clustered Principal Components for Precomputed Radiance Transfer

Light transport matrices

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

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

Introduction. Chapter Computer Graphics

Face Relighting with Radiance Environment Maps

Computing Visibility. Backface Culling for General Visibility. One More Trick with Planes. BSP Trees Ray Casting Depth Buffering Quiz

Light Transport CS434. Daniel G. Aliaga Department of Computer Science Purdue University

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

The Rendering Equation and Path Tracing

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

Re-rendering from a Dense/Sparse Set of Images

Enhancing Traditional Rasterization Graphics with Ray Tracing. October 2015

Rendering Light Reflection Models

Virtual Spherical Lights for Many-Light Rendering of Glossy Scenes

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

Chapter 10 Real-Time Rendering from Precomputed Data

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

Texture-Mapping Tricks. How Bad Does it Look? We've Seen this Sort of Thing Before. Sampling Texture Maps

Graphics Hardware and Display Devices

Light Reflection Models

Computer Graphics. Lecture 9 Environment mapping, Mirroring

Face Relighting with Radiance Environment Maps

CMSC427 Shading Intro. Credit: slides from Dr. Zwicker

NVIDIA Case Studies:

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

Photorealism vs. Non-Photorealism in Computer Graphics

Generalized Wavelet Product Integral for Rendering Dynamic Glossy Objects

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

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

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Today. Rendering algorithms. Rendering algorithms. Images. Images. Rendering Algorithms. Course overview Organization Introduction to ray tracing

CS230 : Computer Graphics Lecture 4. Tamar Shinar Computer Science & Engineering UC Riverside

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

And if that 120MP Camera was cool

Computer Graphics. - Ray Tracing I - Marcus Magnor Philipp Slusallek. Computer Graphics WS05/06 Ray Tracing I

Dimension Reduction CS534

Motivation. Parametric Curves (later Surfaces) Outline. Tangents, Normals, Binormals. Arclength. Advanced Computer Graphics (Fall 2010)

Interactive Rendering of Globally Illuminated Glossy Scenes

Transcription:

Advanced Computer Graphics (Spring 2013) CS 283, Lecture 17: Precomputation-Based Real-Time Rendering Ravi Ramamoorthi http://inst.eecs.berkeley.edu/~cs283/sp13 Motivation Previously: seen IBR. Use measured data (real photographs) and interpolate for realistic real-time Why not apply to real-time rendering? Precompute (offline) some information (images) of interest Must assume something about scene is constant to do so Thereafter real-time rendering. Often accelerate hardware Easier and harder than conventional IBR Easier because synthetic scenes give info re geometry, reflectance (but CG rendering often longer than nature) Harder because of more complex effects (lighting from all directions for instance, not just changing view) Representations and Signal-Processing crucial My General Philosophy This general line of work is a large data management and signal-processing problem Precompute high-dimensional complex data Store efficiently (find right mathematical represent.) Render in real-time Worry about systems issues like caching Good signal-processing: use only small amount of data but guarantee high fidelity Many insights into structure of lighting, BRDFs, Not just blind interpolation and IBR, signal processing Precomputation-Based Relighting Analyze precomputed images of scene Jensen 2000 Precomputation-Based Relighting Analyze precomputed images of scene Static geometry Assumptions Precomputation Jensen 2000 Real-Time Rendering (relight all-frequency effects) Exploit linearity of light transport for this Later, change viewpoint as well 1

Why is This Hard? Plain graphics hardware supports only simple (point) lights, BRDFs (Phong) without any shadows Shadow maps can handle point lights (hard shadows) Environment maps complex lighting, BRDFs but no shadows IBR can often do changing view, fixed lighting How to do complex shadows in complex lighting? With dynamically changing illumination and view? Relighting as a Matrix-Vector Multiply P 1 P 2 P 3 P N T 11 T 1M L T 21 T 2 M 1 L = T 31 T 2 3M L T N1 T NM M Relighting as a Matrix-Vector Multiply P 1 Output Image P 2 (Pixel Vector) P 3 P Input Lighting N (Cubemap Vector) T 11 T 1M L T 21 T 2 M 1 L = T 31 T 2 3M Precomputed Transport L T N1 T NM M Matrix Matrix Columns (Images) T 11 T 1M T 21 T 2 M T 31 T 3M T N1 T NM Precompute: Ray-Trace Image Cols Precompute 2: Rasterize Matrix Rows T 11 T 1M T 21 T 2 M T 31 T 3M T N1 T NM T 11 T 1M T 21 T 2 M T 31 T 3M T N1 T NM 2

Problem Definition Matrix is Enormous 512 x 512 pixel images 6 x 64 x 64 cubemap environments Full matrix-vector multiplication is intractable On the order of 10 10 operations per frame How to relight quickly? Motivation and Background Compression methods Low frequency linear spherical harmonic Factorization and PCA Local factorization and clustered PCA Non-linear wavelet Changing view as well as lighting Clustered PCA Factored BRDFs Triple Product Integrals Precomputed Radiance Transfer Precomputation: Spherical Harmonics Better light integration and transport dynamic, area lights self-shadowing interreflections. Basis 16 For diffuse and glossy surfaces point light area light Basis 17 illuminate result At real-time rates Sloan et al. 02 area lighting, no shadows area lighting, shadows Basis 18. Diffuse Transfer Results Arbitrary BRDF Results No Shadows/Inter Shadows Shadows+Inter Anisotropic BRDFs Other BRDFs Spatially Varying 3

Relighting as a Matrix-Vector Multiply P 1 P 2 P 3 T 11 T 1M P N T 21 T 2 M = T 31 T 3M T N1 T NM L 1 L 2 L M Idea of Compression The vector is projected onto low-frequency components (say 25). Size greatly reduced. Hence, only 25 matrix columns But each pixel still treated separately (still have 300000 matrix rows for 512 x 512 image) Actually, for each pixel, dot product of matrix row (25 elems) and lighting vector (25 elems) in hardware Good technique (becoming common in games) but useful only for broad low-frequency lighting PCA or SVD factorization Motivation and Background Compression methods Low frequency linear spherical harmonic Factorization and PCA Local factorization and clustered PCA Non-linear wavelet Changing view as well as lighting Clustered PCA Factored BRDFs Triple Product Integrals SVD: I j Applying Rank b: p x n I j = p x n E j p x p Absorbing S j values into C it : I j x S j diagonal matrix (singular values) E j p x b p x n x S j b x b E j p x b x x p x n x C jt b x n L j b x n C jt n x n Idea of Compression Represent matrix (rather than light vector) compactly Can be (and is) combined with low frequency vector Useful in broad contexts. BRDF factorization for real-time rendering (reduce 4D BRDF to 2D texture maps) McCool et al. 01 etc Surface Light field factorization for real-time rendering (4D to 2D maps) Chen et al. 02, Nishino et al. 01 Factorization of Orientation Light field for complex lighting and BRDFs (4D to 2D) Latta et al. 02 Not too useful for general precomput. relighting Transport matrix not low-dimensional!! Local or Clustered PCA Exploit local coherence (in say 16x16 pixel blocks) Idea: light transport is locally low-dimensional. Why? Even though globally complex See Mahajan et al. 07 for theoretical analysis Original idea: Each triangle separately Example: Surface Light Fields 3D subspace works well Vague analysis of size of triangles Instead of triangle, 16x16 image blocks [Nayar et al. 04] Clustered PCA [Sloan et al. 2003] Combines two widely used compression techniques: Vector Quantization or VQ and Principal Component Analysis For complex geometry, no need for parameterization / topology 4

Demo (block PCA relighting) Motivation and Background Compression methods Low frequency linear spherical harmonic Factorization and PCA Local factorization and clustered PCA Non-linear wavelet Changing view as well as lighting Clustered PCA Factored BRDFs Triple Product Integrals Sparse Matrix-Vector Multiplication Choose data representations with mostly zeroes Vector: Use non-linear wavelet on lighting Matrix: Wavelet-encode transport rows T 11 T 1M L T 21 T 2 M 1 L T 31 T 2 3M L T N1 T NM M Haar Wavelet Basis Non-linear Wavelet Approximation Non-linear Wavelet Light Approximation Wavelets provide dual space / frequency locality Large wavelets capture low frequency area lighting Small wavelets capture high frequency compact features Non-linear Approximation Use a dynamic set of approximating functions (depends on each frame s lighting) By contrast, linear approx. uses fixed set of basis functions (like 25 lowest frequency spherical harmonics) We choose 10 s - 100 s from a basis of 24,576 wavelets Wavelet Transform 5

Non-linear Wavelet Light Approximation Error in Lighting: St Peter s Basilica L0 1 L 2 L 03 L0 4 L0 5 L 6 M L 0N Non-linear Approximation Retain 0.1% 1% terms Relative L 2 Error (%) Approximation Terms Sph. Harmonics Non-linear Wavelets Ng, Ramamoorthi, Hanrahan 03 Output Image Comparison Top: Linear Spherical Harmonic Approximation Bottom: Non-linear Wavelet Approximation Video 2 5 200 2,000 20,000 Changing Only The View Motivation and Background Compression methods Low frequency linear spherical harmonic Factorization and PCA Local factorization and clustered PCA Non-linear wavelet Changing view as well as lighting Clustered PCA Factored BRDFs Triple Product Integrals 6

Problem Characterization 6D Precomputation Space Distant Lighting (2D) View (2D) Rigid Geometry (2D) With ~ 100 samples per dimension ~ 10 12 samples total!! : Intractable computation, rendering Clustered PCA Use low-frequency light and view variation (Order 4 spherical harmonic = 25 for both; total = 25*25=625) 625 element vector for each vertex Apply CPCA directly (Sloan et al. 2003) Does not easily scale to high frequencies Really cubic complexity (number of vertices, illumination directions or harmonics, and view directions or harmonics) Practical real-time method on GPU Factored BRDFs Sloan et al. 04, Wang et al. 04: All-frequency effects Combines lots of things: BRDF factorization, CPCA, nonlinear approx. with wavelets Idea: Factor BRDF to depend on incident, outgoing Incident part handled with view-independent relighting Then linearly combine based on outgoing factor Effectively, break problem into a few subproblems that can be solved view-independently and added up Can apply nonlinear wavelet approx. to each subproblem And CPCA to the matrices for further compression Factored BRDFs: Critique Simple, reasonably practical method Problem: Non-optimal factorization, few terms Can only handle less glossy materials Accuracy not properly investigated [Mahajan et al 08] Very nice synthesis of many existing ideas Comparison to triple product integrals Not as deep or cool, but simpler and real-time Limits BRDF fidelity, glossiness much more In a sense, they are different types of factorizations Motivation and Background Compression methods Low frequency linear spherical harmonic Factorization and PCA Local factorization and clustered PCA Non-linear wavelet Changing view as well as lighting Clustered PCA Factored BRDFs Triple Product Integrals Factorization Approach 6D Transport = ~ 10 12 samples * 4D Visibility 4D BRDF ~ 10 8 samples ~ 10 8 samples 7

Triple Product Integral Relighting Relit Images (3-5 sec/frame) Triple Product Integrals Basis Requirements 1. Need few non-zero tripling coefficients 2. Need sparse basis coefficients 1. Number of Non-Zero Tripling Coefficients 2. Sparsity in Light Approx. Basis Choice Number Non-Zero General (e.g. PCA) O (N 3 ) Pixels O (N) Fourier Series O (N 2 ) Sph. Harmonics O (N 5 / 2 ) Haar Wavelets O (N log N) C ijk Relative L 2 Error (%) Wavelets Pixels Approximation Terms 8

Summary of Wavelet Results Derive direct O(N log N) triple product algorithm Dynamic programming can eliminate log N term Broader Computational Relevance Clebsch-Gordan triple product series for spherical harmonics in quantum mechanics (but not focused on computation) Essentially no previous work graphics, applied math Same machinery applies to basic operation: multiplication Signal multiplication for audio, image compositing,. Compressed signals/videos (e.g. wavelets JPEG 2000) Final complexity linear in number of retained basis coefficients = * Summary Really a big data compression and signalprocessing problem Apply many standard methods PCA, wavelet, spherical harmonic, factor compression And invent new ones VQPCA, wavelet triple products Guided by and gives insights into properties of illumination, reflectance, visibility How many terms enough? How much sparsity? Subsequent Work My survey linked from website (lecture only covers 2002-2004) Varied lighting/view. What about dynamic scenes, BRDFs Much recent work [Zhou et al. 05, Ben-Artzi et al. 06]. But still limited for dynamic scenes Must work on GPU to be practical Sampling on object geometry remains a challenge Near-Field Lighting has had some work, remains a challenge Applications to lighting design, direct to indirect transfer New basis functions and theory Newer methods do not require precompute, various GPU tricks So far, low-frequency spherical harmonics used in games, allfrequency techniques have had limited applicability 9