pre com puted radiance transfer
play

Pre-com puted Radiance Transfer Jaroslav Kivnek, KSVI, MFF UK - PowerPoint PPT Presentation

Pre-com puted Radiance Transfer Jaroslav Kivnek, KSVI, MFF UK Jaroslav.Krivanek@mff.cuni.cz Goal Real-time rendering with complex lighting, shadows, and possibly GI Infeasible too much computation for too small a time budget


  1. Pre-com puted Radiance Transfer Jaroslav Křivánek, KSVI, MFF UK Jaroslav.Krivanek@mff.cuni.cz

  2. Goal  Real-time rendering with complex lighting, shadows, and possibly GI  Infeasible – too much computation for too small a time budget  Approaches  Lift some requirements, do specific-purpose tricks Environment mapping, irradiance environment maps  SH-based lighting   Split the effort Offline pre-computation + real-time image synthesis  “Pre-computed radiance transfer” 

  3. SH-based Irradiance Env. Maps R N Incident Radiance Irradiance Environment Map (Illumination Environment Map)

  4. SH-based Irradiance Env. Maps Images courtesy Ravi Ramamoorthi & Pat Hanrahan

  5. SH-based Arbitrary BRDF Shading 1  [Kautz et al. 2003]  Arbitrary, dynamic env. map  Arbitrary BRDF  No shadows  SH representation  Environment map (one set of coefficients)  Scene BRDFs (one coefficient vector for each discretized view direction)

  6. SH-based Arbitrary BRDF Shading 3  Rendering: for each vertex / pixel, do ∫ ω = ω ⋅ ω ω ⋅ θ ⋅ ω L ( ) L ( ) BRDF ( , ) cos d o o i i i o i i Ω ∫ ( ) Environment map BRDF = coeff. dot product ω = Λ p • ω L ( ) ( ) F ( p , ) o o intp o

  7. Pre-com puted Radiance Transfer

  8. Pre-com puted Radiance Transfer  Goal  Real-time + complex lighting, shadows, and GI  Infeasible – too much computation for too small a time budget  Approach  Precompute (offline) some information (images) of interest  Must assume something about scene is constant to do so  Thereafter real-time rendering. Often hardware accelerated

  9. Assum ptions  Precomputation  Static geometry  Static viewpoint (some techniques)  Real-Time Rendering (relighting)  Exploit linearity of light transport

  10. Relighting as a Matrix-Vector Multiply   P 1   P   2   P 3          P N     T T T  11 12 1 M    L 1  T T T     21 22 2 M L    = 2  T T T   31 32 3 M              L   M    T T T N 1 N 2 NM

  11. Relighting as a Matrix-Vector Multiply   P Output Image 1   P   (Pixel Vector) 2   P 3          P Input Lighting N (Cubemap Vector)     T T T  11 12 1 M    L 1  T T T     21 22 2 M L    = 2  T T T   31 32 3 M     Precomputed          L   Transport M    T T T N 1 N 2 NM Matrix

  12. Matrix Columns (Images)          T T T T T T T T T 11 11 11 12 12 12 1 1 1 M M M          T T T T T T T T T       21 21 21 22 22 22 2 2 2 M M M          T T T T T T T T T 31 31 31 32 32 32 3 3 3 M M M                                        T T T T T T T T T N N N 1 1 1 N N N 2 2 2 NM NM NM

  13. 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?

  14. Outline  Compression methods  Spherical harmonics-based PRT [Sloan et al. 02]  (Local) factorization and PCA  Non-linear wavelet approximation  Changing view as well as lighting  Clustered PCA  Triple Product Integrals  Handling Local Lighting  Direct-to-Indirect Transfer

  15. SH-based PRT  Better light integration and transport  dynamic, env. lights  self-shadowing  interreflections point light Env. light  For diffuse and glossy surfaces  At real-time rates  Sloan et al. 02 Env. lighting, Env. lighting, no shadows shadows

  16. SH-based PRT: Idea . . . Basis 16 Basis 17 illuminate result Basis 18 . . .

  17. PRT Terminology

  18. Relation to a Matrix-Vector Multiply   P a) SH 1   coefficients of P   2 transferred   P 3 radiance      b) Irradiance   (per vertex)   P N     T T T  11 12 1 M    L 1  T T T     21 22 2 M L SH coefficients    = 2  T T T   of EM (source 31 32 3 M             radiance)  L   M    T T T N 1 N 2 NM

  19. Idea of SH-based PRT  The L vector is projected onto low-frequency components (say 25). Size greatly reduced.  Hence, only 25 matrix columns  But each pixel/vertex still treated separately  One RGB value per pixel/vertex:  Diffuse shading / arbitrary BRDF shading w/ fixed view direction  SH coefficients of transferred radiance (25 RGB values per pixel/vertex for order 4 SH)  Arbitrary BRDF shading w/ variable view direction  Good technique (becoming common in games) but useful only for broad low-frequency lighting

  20. Diffuse Transfer Results No Shadows/Inter Shadows Shadows+Inter

  21. SH-based PRT with Arbitrary BRDFs  Combine with Kautz et al. 03  Transfer matrix turns SH env. map into SH transferred radiance  Kautz et al. 03 is applied to transferred radiance

  22. Arbitrary BRDF Results Anisotropic BRDFs Other BRDFs Spatially Varying

  23. Outline  Compression methods  Spherical harmonics-based PRT [Sloan et al. 02]  (Local) factorization and PCA  Non-linear wavelet approximation  Changing view as well as lighting  Clustered PCA  Triple Product Integrals  Handling Local Lighting  Direct-to-Indirect Transfer

  24. PCA or SVD factorization • SVD: I j E j S j = x x p x n p x p p x n C jT diagonal matrix (singular values) n x n • Applying Rank b : ≈ I j x x p x n E j S j C jT p x b b x b b x n • Absorbing S j values into C iT : I j ≈ x p x n E j L j p x b b x n

  25. Idea of Compression  Represent matrix (rather than light vector) compactly  Can be (and is) combined with SH light 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  BTF (Bidirectional Texture Function) compression  Not too useful for general precomput. relighting  Transport matrix not low-dimensional!!

  26. Local or Clustered PCA  Exploit local coherence (in say 16x16 pixel blocks)  Idea: light transport is locally low-dimensional.  Even though globally complex  See Mahajan et al. 07 for theoretical analysis  Clustered PCA [Sloan et al. 2003]  Combines two widely used compression techniques: Vector Quantization or VQ and Principal Component Analysis

  27. Compression Example Surface is curve, signal is normal Following couple of slides courtesy P.-P. Sloan

  28. Compression Example Signal Space

  29. VQ Cluster normals

  30. VQ Replace samples with cluster mean  ≈ = M M M p p C p

  31. PCA Replace samples with mean + linear combination N + ∑  ≈ = 0 i i M M M w M p p p = i 1

  32. CPCA Compute a linear subspace in each cluster N + ∑  ≈ = 0 i i M M M w M p p C p C p p = i 1

  33. CPCA • Clusters with low dimensional affine models • How should clustering be done? – k -means clustering • Static PCA – VQ, followed by one-time per-cluster PCA – optimizes for piecewise-constant reconstruction • Iterative PCA – PCA in the inner loop, slower to compute – optimizes for piecewise-affine reconstruction

  34. Static vs. Iterative

  35. Equal Rendering Cost VQ PCA CPCA

  36. Outline  Compression methods  Spherical harmonics-based PRT [Sloan et al. 02]  (Local) factorization and PCA  Non-linear wavelet approximation  Changing view as well as lighting  Clustered PCA  Triple Product Integrals  Handling Local Lighting  Direct-to-Indirect Transfer

  37. Sparse Matrix-Vector Multiplication Choose data representations with mostly zeroes Vector: Use non-linear wavelet approximation on lighting Matrix: Wavelet-encode transport rows     T T T  11 12 1 M    L 1  T T T     21 22 2 M L     2  T T T  31 32 3 M              L   M    T T T N 1 N 2 NM

  38. Haar Wavelet Basis

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend