Scalable many-light methods Jaroslav Křivánek Charles University in Prague.

Slides:



Advertisements
Similar presentations
Miloš Hašan Jaroslav Křivánek Philipp Slusallek Kavita Bala Combining Global and Local Virtual Lights for Detailed Glossy Illumination Tomáš Davidovič.
Advertisements

Exploration of advanced lighting and shading techniques
Multidimensional Lightcuts Bruce Walter Adam Arbree Kavita Bala Donald P. Greenberg Program of Computer Graphics, Cornell University.
Scalability with Many Lights 1 Lightcuts & Multidimensonal Lightcuts Course: Realistic Rendering with Many-Light Methods Note: please see website for the.
Computer graphics & visualization Global Illumination Effects.
Ray Tracing CMSC 635. Basic idea How many intersections?  Pixels  ~10 3 to ~10 7  Rays per Pixel  1 to ~10  Primitives  ~10 to ~10 7  Every ray.
Chunhui Yao 1 Bin Wang 1 Bin Chan 2 Junhai Yong 1 Jean-Claude Paul 3,1 1 Tsinghua University, China 2 The University of Hong Kong, China 3 INRIA, France.
LIGHT TRANSPORT 25/11/2011 Shinji Ogaki. 4 Papers Progressive Photon Beams Lightslice: Matrix Slice Sampling for Many- Lights Problem Modular Radiance.
Many-light methods – Clamping & compensation
Photorealistic Rendering. Ray tracing v. photorealistic rendering What illumination effects are not captured by ray tracing? What illumination effects.
Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.
Scalability with many lights II (row-column sampling, visibity clustering) Miloš Hašan.
Paper Presentation - An Efficient GPU-based Approach for Interactive Global Illumination- Rui Wang, Rui Wang, Kun Zhou, Minghao Pan, Hujun Bao Presenter.
Real-Time Rendering Paper Presentation Imperfect Shadow Maps for Efficient Computation of Indirect Illumination T. Ritschel T. Grosch M. H. Kim H.-P. Seidel.
Advanced Computer Graphics (Spring 2005) COMS 4162, Lectures 18, 19: Monte Carlo Integration Ravi Ramamoorthi Acknowledgements.
CSCE 641: Photon Mapping Jinxiang Chai. Outline Rendering equation Photon mapping.
Photon Tracing with Arbitrary Materials Patrick Yau.
Lightcuts: A Scalable Approach to Illumination Bruce Walter, Sebastian Fernandez, Adam Arbree, Mike Donikian, Kavita Bala, Donald Greenberg Program of.
Advanced Computer Graphics (Fall 2010) CS 283, Lecture 10: Global Illumination Ravi Ramamoorthi Some images courtesy.
Visibility Subspaces: Uncalibrated Photometric Stereo with Shadows Kalyan Sunkavalli, Harvard University Joint work with Todd Zickler and Hanspeter Pfister.
Matrix Row-Column Sampling for the Many-Light Problem Miloš Hašan (Cornell University) Fabio Pellacini (Dartmouth College) Kavita Bala (Cornell University)
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
The Radiosity Method Donald Fong February 10, 2004.
Paper by Alexander Keller
Fast Agglomerative Clustering for Rendering Bruce Walter, Kavita Bala, Cornell University Milind Kulkarni, Keshav Pingali University of Texas, Austin.
CSCE 641 Computer Graphics: Radiosity Jinxiang Chai.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
Selected Topics in Global Illumination Computation Jaroslav Křivánek Charles University, Prague
Surface Simplification Using Quadric Error Metrics Michael Garland Paul S. Heckbert.
-Global Illumination Techniques
Ray Tracing Sang Il Park SEjong University With lots of slides stolen from Jehee Lee, Doug James, Steve Seitz, Shree Nayar, Alexei Efros, Fredo Durand.
CS 376 Introduction to Computer Graphics 04 / 16 / 2007 Instructor: Michael Eckmann.
02/18/05© 2005 University of Wisconsin Last Time Radiosity –Converting the LTE into the radiosity equation –Solving with Gauss-Seidel relaxation –Form.
02/10/03© 2003 University of Wisconsin Last Time Participating Media Assignment 2 –A solution program now exists, so you can preview what your solution.
Improved VPL Distribution Jaroslav Křivánek Charles University in Prague (Optimizing) Realistic Rendering with Many-Light Methods (part of the “Handling.
Real-Time Relighting Digital Image Synthesis Yung-Yu Chuang 1/10/2008 with slides by Ravi Ramamoorthi, Robin Green and Milos Hasan.
1 Photon-driven Irradiance Cache J. BrouillatP. GautronK. Bouatouch INRIA RennesUniversity of Rennes1.
Global Illumination Models THE WHITTED IMAGE - BASIC RECURSIVE RAY TRACING Copyright © 1997 A. Watt and L. Cooper.
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Stochastic Radiosity K. H. Ko School of Mechatronics Gwangju Institute.
Quick survey about PRT Valentin JANIAUT KAIST (Korea Advanced Institute of Science and Technology)
111/17/ :21 Graphics II Global Rendering and Radiosity Session 9.
Image-Based Rendering of Diffuse, Specular and Glossy Surfaces from a Single Image Samuel Boivin and André Gagalowicz MIRAGES Project.
- Laboratoire d'InfoRmatique en Image et Systèmes d'information
University of Montreal & iMAGIS A Light Hierarchy for Fast Rendering of Scenes with Many Lights E. Paquette, P. Poulin, and G. Drettakis.
Real-Time High Quality Rendering
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Surface Rendering Methods 고려대학교 컴퓨터 그래픽스 연구실.
Monte-Carlo Ray Tracing and
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Hybrid Algorithms K. H. Ko School of Mechatronics Gwangju Institute.
Pure Path Tracing: the Good and the Bad Path tracing concentrates on important paths only –Those that hit the eye –Those from bright emitters/reflectors.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
Handling Difficult Light Paths (virtual spherical lights) Miloš Hašan UC Berkeley Realistic Rendering with Many-Light Methods.
02/12/03© 2003 University of Wisconsin Last Time Intro to Monte-Carlo methods Probability.
Bidirectional Path Sampling Techniques
Photo-realistic Rendering and Global Illumination in Computer Graphics Spring 2012 Stochastic Path Tracing Algorithms K. H. Ko School of Mechatronics Gwangju.
Thank you for the introduction
Slide 1Lastra, 2/14/2016 Monte-Carlo Methods. Slide 2Lastra, 2/14/2016 Topics Kajiya’s paper –Showed that existing rendering methods are approximations.
Fast Global Illumination Including Specular Effects Xavier Granier 1 George Drettakis 1 Bruce J. Walter 2 1 iMAGIS -GRAVIR/IMAG-INRIA iMAGIS is a joint.
Global Illumination (3) Photon Mapping (1). Overview Light Transport Notation Path Tracing Photon Mapping –Photon Tracing –The Photon Map.
01/26/05© 2005 University of Wisconsin Last Time Raytracing and PBRT Structure Radiometric quantities.
Global Illumination (3) Path Tracing. Overview Light Transport Notation Path Tracing Photon Mapping.
Graphics Lecture 14: Slide 1 Interactive Computer Graphics Lecture 14: Radiosity - Computational Issues.
Computer graphics III – Multiple Importance Sampling Jaroslav Křivánek, MFF UK
Computer Graphics Ken-Yi Lee National Taiwan University (the slides are adapted from Bing-Yi Chen and Yung-Yu Chuang)
Toward Real-Time Global Illumination. Global Illumination == Offline? Ray Tracing and Radiosity are inherently slow. Speedup possible by: –Brute-force:
Toward Real-Time Global Illumination. Project Ideas Distributed ray tracing Extension of the radiosity assignment Translucency (subsurface scattering)
© University of Wisconsin, CS559 Fall 2004
Simple and Robust Iterative Importance Sampling of Virtual Point Lights Iliyan Georgiev Philipp Slusallek.
CSc4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Radiosity.
Virtual Spherical Lights for Many-Light Rendering of Glossy Scenes
CSc4820/6820 Computer Graphics Algorithms Ying Zhu Georgia State University Lecture 25 Radiosity.
Presentation transcript:

Scalable many-light methods Jaroslav Křivánek Charles University in Prague

1.Generate VPLs 2 Instant radiosity 2.Render with VPLs

Large number of VPLs required True even for diffuse scenes Scalability issues 3 Ground truth 1,000 VPLs100,000 VPLs Instant radiosity with glossy surfaces

1.Generate many, many VPLs 2.Pick only the most relevant VPLs for rendering 4 Scalable many-light methods

Choosing the right VPLs –Per-pixel basis Lightcuts [Walter et al 05/06] –Per-image basis Matrix Row Column Sampling [Hašan et al. 07] –Somewhere in-between LightSlice [Ou & Pellacini 2011] Importance caching [Georgiev et al. 2012] 5 Scalable many-light methods

Scalable many-light rendering Lightcuts Multidimensional Lightcuts Walter et al., SIGGRAPH 2005/2006 Slides courtesy Bruce Walter:

7 Lightcuts

Complex Lighting Simulate complex illumination using VPLs –Area lights –HDR environment maps –Sun & sky light –Indirect illumination Unifies illumination Area lights + Sun/sky + Indirect

Scalable Scalable solution for many point lights –Thousands to millions –Sub-linear cost Tableau Scene

Lightcuts Problem Visible surface

Lightcuts Problem

Camera

Key Concepts Light Cluster –Approximate many lights by a single brighter light (the representative light)

Key Concepts Light Cluster Light Tree –Binary tree of lights and clusters Clusters Individual Lights

Key Concepts Light Cluster Light Tree A Cut –A set of nodes that partitions the lights into clusters

Simple Example #1 #2#3 # Light Tree Clusters Individual Lights Representative Light 4

Three Example Cuts Three Cuts #1 #2 #4 #1 #3 #4 #1 #4

Three Example Cuts Three Cuts #1 #2 #4 #1 #3 #4 #1 #4 GoodBad

Three Example Cuts Three Cuts #1 #2 #4 #1 #3 #4 #1 #4 BadGoodBad

Three Example Cuts Three Cuts #1 #2 #4 #1 #3 #4 #1 #4 Good

Algorithm Overview Pre-process –Convert illumination to point lights –Build light tree For each eye ray –Choose a cut to approximate the illumination

Convert Illumination HDR environment map –Importance sampling Indirect Illumination –Convert indirect to direct illumination using Instant Radiosity [Keller 97] Caveats: no caustics, clamping, etc. –More lights = more indirect detail

Build light tree Cluster spatially close lights with similar orientation Light Tree Clusters Individual Lights Representative Light 4

Choose a cut Approximate illumination with a bounded error Different cut for each pixel

Illumination Equation Material term result =  M i G i V i I i  lights Geometric term Visibility term Light intensity

Cluster Approximation Cluster result ≈ M j G j V j  I i  lights j is the representative light Sum pre-computed during light tree construction

error  M ub G ub V ub  I i Cluster Error Bound Cluster  lights  Bound each term –Visibility <= 1 (trivial) –Intensity is known –Bound material and geometric terms using cluster bounding volume ub = upper bound

Perceptual Metric Weber’s Law –Contrast visibility threshold is fixed percentage of signal –Used 2% in our results Ensure each cluster’s error < visibility threshold –Transitions will not be visible –Used to select cut

Perceptual Metric Problem: –We don’t know the illumination so we don’t know the threshold either (because threshold = 2% illumination) Solution: –As we traverse the tree, gradually improve the illumination estimate. –Stop the traversal if the error bound for all cut nodes is below threshold.

Cut Selection Algorithm Cut Start with coarse cut (eg, root node)

Cut Selection Algorithm Cut Select cluster with largest error bound

Cut Selection Algorithm Cut Refine if error bound > 2% of total

Cut Selection Algorithm Cut

Cut Selection Algorithm Cut

Cut Selection Algorithm Cut

Cut Selection Algorithm Cut Repeat until cut obeys 2% threshold

Lightcuts (128s)Reference (1096s) ErrorError x16 Kitchen, 388K polygons, 4608 lights (72 area sources)

Combined Illumination Lightcuts 128s Lights (Area lights only) Avg. 259 shadow rays / pixel Lightcuts 290s Lights (Area + Sun/sky + Indirect) Avg. 478 shadow rays / pixel (only 54 to area lights)

Lightcuts Reference Error x 16 Cut size

Scalable Scalable solution for many point lights –Thousands to millions –Sub-linear cost Tableau SceneKitchen Scene

Data-driven stratification & importance sampling Stratification –Clustering of similar lights in the light tree Importance sampling –Subdividing clusters with high contribution 41 Why does it work so well?

Problem: Large cuts in dark areas 42 Main issue

Lightcuts Recap Key ingredients –Upper bound on error –Refinement of the highest-error nodes first

Multidimensional Lightcuts

Problem Simulate complex, expensive phenomena –Complex illumination –Anti-aliasing –Motion blur –Participating media –Depth of field

Problem Simulate complex, expensive phenomena –Complex illumination –Anti-aliasing –Motion blur –Participating media –Depth of field

Problem Simulate complex, expensive phenomena –Complex illumination –Anti-aliasing –Motion blur –Participating media –Depth of field

Complex integrals over multiple dimensions –Requires many samples camera Problem

Multidimensional Lightcuts Solves all integrals simultaneously Accurate Scalable

Direct only (relative cost 1x)Direct+Indirect (1.3x) Direct+Indirect+Volume (1.8x)Direct+Indirect+Volume+Motion (2.2x)

Camera Discretize full integral into 2 point sets –Light points ( L ) –Gather points ( G ) Point Sets Light points

Camera Discretize full integral into 2 point sets –Light points ( L ) –Gather points ( G ) Point Sets Light points

Camera Discretize full integral into 2 point sets –Light points ( L ) –Gather points ( G ) Point Sets Light points Pixel Gather points

Discretize full integral into 2 point sets –Light points ( L ) –Gather points ( G ) Point Sets Light points Gather points

Sum over all pairs of gather and light points –Can be billions of pairs per pixel Material term Pixel =  S j M ji G ji V ji I i  ( j,i)   G x L Geometric term Visibility term Light intensity Gather strength Discrete Equation

Product Graph Explicit hierarchy would be too expensive –Up to billions of pairs per pixel Use implicit hierarchy –Cartesian product of two trees (gather & light)

Light tree Gather tree Product Graph L0 L1 L2 L3 L4 L5 L6 G1 G0 G2 L0 L1L2 L3 G0 G1

Product Graph Light tree Gather tree X = L0 L1 L2 L3 L4 L5 L6 G1 G0 G2 G1 G0 G2 L0L4L1L6L2L5L3 Product Graph

Light tree Gather tree X = L0 L1 L2 L3 L4 L5 L6 G1 G0 G2 G1 G0 G2 L0L4L1L6L2L5L3 Product Graph

G1 G0 G2 L0L4L1L6L2L5L3 Product Graph

G1 G0 G2 L0L4L1L6L2L5L3 Product Graph

Light tree Gather tree X = L0 L1 L2 L3 L4 L5 L6 G1 G0 G2 G1 G0 G2 L0L4L1L6L2L5L3 Product Graph

Cluster Representatives

Collapse cluster-cluster interactions to point-cluster –Minkowski sums –Reuse bounds from Lightcuts Compute maximum over multiple BRDFs –Rasterize into cube-maps More details in the paper Error Bounds

Algorithm Summary Once per image –Create lights and light tree For each pixel –Create gather points and gather tree for pixel –Adaptively refine clusters in product graph until all cluster errors < perceptual metric

L6 G2 L1L2L3L4L5L0 G1 G0 Start with a coarse cut –Eg, source node of product graph Scalability

L6 G2 L1L2L3L4L5L0 G1 G0 Choose node with largest error bound & refine –In gather or light tree Scalability

L6 G2 L1L2L3L4L5L0 G1 G0 Choose node with largest error bound & refine –In gather or light tree Scalability

L6 G2 L1L2L3L4L5L0 G1 G0 Repeat process Scalability

L6 G2 L1L2L3L4L5L0 G1 G0 Until all clusters errors < perceptual metric –2% of pixel value (Weber’s law) Algorithm summary

Results Limitations –Some types of paths not included Eg, caustics –Prototype only supports diffuse, Phong, and Ward materials and isotropic media

Roulette 7,047,430 Pairs per pixel Time 590 secs Avg cut size 174 (0.002%)

Scalability

Metropolis Comparison Our result Time 9.8min Metropolis Time 148min (15x) Visible noise 5% brighter (caustics etc.) Zoomed insets

Kitchen 5,518,900 Pairs per pixel Time 705 secs Avg cut size 936 (0.017%)

180 Gather points X 13,000 Lights = 234,000 Pairs per pixel Avg cut size 447 (0.19%)

Scalable many-light rendering Matrix Row-Column sampling Hašan et al., SIGGRAPH 2007 Slides courtesy Miloš Hašan:

Designed specifically for GPU rendering (shadow mapping) 79 Matrix Row-Column sampling

Improving Scalability and Performance 10 min13 min20 min 3.8 sec13.5 sec16.9 sec Brute force (100k VPLs) MRCS (our result) 80

81 A Matrix Interpretation Pixels (2,000,000) Lights (100,000)

Compute sum of columns 82 Problem Statement = Σ () Pixels Lights

83 Low-Rank Assumption = Σ () Pixels Lights Column space is (close to) low-dimensional

84 Ray-tracing vs Shadow Mapping Lights Pixels Point-to-point visibility: Ray-tracingPoint-to-many-points visibility: Shadow-mapping

85 Computing Column Visibility Shadow map at light position Surface samples Regular Shadow Mapping Lights Pixels 1 shadow map

86 Row-Column Duality Shadow map at sample position Rows: Also Shadow Mapping! Lights Pixels 1 shadow map

Image as a Weighted Column Sum Compute small subset of columns (i.e. pick some lights) compute weighted sum The following is possible: Use rows to choose a good set of columns (=lights) 87 Lights Pixels

88 The Row-Column Sampling Idea compute rows (i.e. pick pixels, compute contrib from ALL lights for each) compute columns (i.e. for the selected lights, compute contribution to all pixels) weighted sum ? choose columns (=lights) and weights how to choose columns and weights? Pixels Lights

89 Clustering Approach Clustering Choose representative columns Columns

90 Reduced Matrix Reduced columns

Algorithm: 1.Cluster reduced columns 2.Choose a representative in each cluster, with probability proportional to weight 3.Approximate other columns in cluster by (scaled) representative This is an unbiased Monte Carlo estimator (of the sum of matrix columns) Which clustering minimizes its variance? 91 Monte Carlo Estimator

Weights and Information Vectors Weights w i –Norms of reduced columns –Represent the “energy” of the light Information vectors x i –Normalized reduced columns –Represent the “kind” of light’s contribution

93 Visualizing the Reduced Columns Reduced columns: vectors in high- dimensional space visualize as … radius = weight position = information vector

Minimize: where: 94 The Clustering Objective total cost of all clusters cost of a cluster sum over all pairs in it weights squared distance between information vectors

Clustering Illustration Strong but similar columns Weak columns can be clustered more easily Columns with various intensities can be clustered

How to minimize? Problem is NP-hard Not much previous research Should handle large input: –100,000 points –1000 clusters We introduce 2 heuristics: –Random sampling –Divide & conquer

Clustering by Random Sampling Very fast (use optimized BLAS) Some clusters might be too small / large

Clustering by Divide & Conquer Splitting small clusters is fast Splitting large clusters is slow

Combined Clustering Algorithm

101 Full Algorithm Compute rows (GPU) Weighted sum Assemble rows into reduced matrix Cluster reduced columns Choose representatives Compute columns (GPU) Lights Pixels

2.1m polygons Mostly indirect & sky illumination Indirect shadows 102 Example: Temple Our result: 16.9 sec (300 rows columns) Reference: 20 min (using all 100k lights) 5x diff

388k polygons Mostly indirect illumination Glossy surfaces Indirect shadows 103 Example: Kitchen Our result: 13.5 sec (432 rows columns) Reference: 13 min (using all 100k lights) 5x diff

869k polygons Incoherent geometry High-frequency lighting Kajiya-Kay hair shader 104 Example: Bunny Our result: 3.8 sec (100 rows columns) Reference: 10 min (using all 100k lights) 5x diff

105 Effect of exploration # rows = sec # rows = sec Too few VPLs #VPLs = 250k, # cols = 10k

106 Comparison Lightcuts (2M VPLs) 30 sec MRCS (250k VPLs) 35 sec

Data-driven stratification & importance sampling –Same reason as for Lightcuts Stratification –Split clusters with dissimilar lights Importance sampling –Split clusters with high-contribution lights 107 Why does it work so well?

Advantage –Takes visibility into account in light selection (reduced matrix contains the full light contributions) Drawback –Impossible to capture localized effects Low likelihood of getting the right row sample Global light selection 108 Comparison to Lightcuts

109 LightSlice

Get the better from Lightcuts and MRCS –Lightcuts: Localized selection of relevant lights –MRCS: Take visibility into account in light selection 110 LightSlice: Idea

Cannot use shadow maps for row/column sampling Clustering borrowed from the original MRCS paper 111 LightSlice: The Algorithm

112 LightSlice: Matrix Slices Image Matrix slice visualization

Not really a fair comparison to MRCS (uses ray traced visibility) 113 LightSlice: Results

114 Importance Caching Localized light (VPL) selection taking visibility into account

1.Importance caching –Pick image pixels ( ) –For each such pixel, compute and cache contributions from all lights (i.e. matrix row) 2.Image rendering –For each image pixel Collect nearby importance records Pick a VPL proportional to the cached contributions 115 Importance Caching: Algorithm

116 Cached light importance Importance record 1 Importance record 2 Importance record 3 Contributions to the record location of individual lights

117 Possible problems OKOcclusionGeometry factorIrrelevant

118 Solution: Multiple importances Full light contributionUnoccluded contribution Unoccluded contribution w/ bounded G-term Uniform distribution

Multiple importance sampling (MIS) –See CG III slides New combination heuristic proposed in the paper 119 Distribution combination

120 Results

121 Results: A 2-second rendering

Fewer initial VPLs than any of the previous algorithms (up to 10k) –Because of memory limitations –Must run in iterations if more VPLs needed No data-driven stratification 122 Importance Caching: Limitations

Data-driven importance sampling may be dangerous –Non-zero contribution may be sampled with very low, or even zero probability –Being conservative is safer, but can reduce the advantage of data-driven IS –For more information see [Owen & Zhou 2000] Take-home message

MRCS –In theory suffers from the same problem, but –light importance averaged over full columns, so it works ok –BTW: Why do you think there’s global clustering in LightSlice Lightcuts –Has upper bounds so it knows which lights can be safely skipped 124 How ‘bout Lightcuts and MRCS?

Lightcuts [Walter et al 05/06] Matrix Row Column Sampling [Hašan et al. 07] LightSlice [Ou & Pellacini 2011] Importance caching [Georgiev et al. 2012] 125 Scalable many-light methods

[Segovia et al. 07]: Metropolis instant radiosity – Use Metropolis sampling to guide the VPL where they can contribute to the imagehttp://www710.univ-lyon1.fr/~jciehl/bsegovia/bat710/public_html/papers/mir.html [Georgiev & Slussalek 2010] – –Use rejection sampling to reject VPLs that do not contribute significantly 126 Improved VPL distribution