nonlinear prefiltering for surface shading
play

Nonlinear Prefiltering for Surface Shading Presenter: Chun-Po - PowerPoint PPT Presentation

Nonlinear Prefiltering for Surface Shading Presenter: Chun-Po Wang, Pramook Khungurn MOTIVATION Motivation Real world objects have surface details . Representing Surface Details Detailed meshes Henrik van Jensen. Digital Face


  1. Nonlinear Prefiltering for Surface Shading Presenter: Chun-Po Wang, Pramook Khungurn

  2. MOTIVATION

  3. Motivation • Real world objects have surface details .

  4. Representing Surface Details • Detailed meshes Henrik van Jensen. “Digital Face Cloning.” SIGGRAPH 2003 Sketch

  5. Representing Surface Details • Volume data Samuli Laine, Tero Karras . “Efficient Sparse Voxel Octree .” I3D, 2010

  6. Representing Surface Details • The traditional approach – Coarse meshes – Texture maps • Why not the last two approaches? – Huge memory requirement – Not available 10 years ago

  7. Coarse Meshes + Texture Maps http://radoff.com/blog/2008/08/22/anatomy-of-an-mmorpg/

  8. Types of Texture Maps • Color maps • Normal maps • Horizon maps • Shadow maps

  9. Color Maps http://www.siggraph.org/education/materials/HyperGraph/mapping/r_wolfe/

  10. Normal Maps = +

  11. Horizon Maps • Used to deal with self occlusion. • Each texel stores a function Θ(𝜚) . • Θ(𝜚) = elevation angle beyond which the vision is not occluded by the object itself

  12. Horizon Maps Nelson L. Max. “Horizon mapping: shadows for bump - mapped surfaces.” The Visual Computer, 1988

  13. Shadow Maps • Texels store the distance to the visible surface from light source. Foley et al. “Computer Graphics Principles and Practice”

  14. ALIASING

  15. Problem: Aliasing • Occur when a pixel covers many fine details. • So much info in a pixel, but display just a little.

  16. Problem: Aliasing http://forums.create.msdn.com/forums/p/63434/388892.aspx

  17. Problem: Aliasing Ma et al. “Level -of-Detail Representation of Bidirection Texture Functions for Real- Time Rendering.” I3D, 2005

  18. Removing Aliasing • Two solutions – Supersampling – Prefiltering • Supersampling – Throw in more samples in a pixel. – More samples = more info covered. – Always works. – But SLOW…

  19. Prefiltering • Come up with low-detail versions of the map. – “Filter” the map. • Use the right low-detail version according to how many texels are covered.

  20. Prefiltering Example: Color Map • MIP-mapping – Decimate the original color map by factor of 2. – Do so until getting a 1x1 image. – Use smaller image when pixel cover more texels. http://www.gamedev.net/page/resources/_/technical/directx-and-xna/mip-mapping-in-direct3d-r1233

  21. Prefiltering Example: MIP-map

  22. PREFILTERING FRAMEWORK

  23. Prefiltering Framework • Setting ∆𝜕

  24. Prefiltering Framework • Measurement Equation 𝐽 = 𝑥 𝜕 𝑀 𝑝, 𝜕 𝑒𝜏(𝜕) ∆𝜕 – 𝐽 = pixel color – Weight function 𝑥(𝜕) • Assign weight to each direction in the pixel. • Integrates to 1 over the pixel. 𝑥 𝜕 𝑒𝜏 𝜕 = 1 ∆𝜕

  25. Prefiltering Framework • Transform to integral over surface

  26. Prefiltering Framework • Transform to integral over surface – Weight function 𝑥 (𝑦) over points. – Expression for color: 𝐽 = 𝑥 𝑦 𝑀 𝑦, 𝑤 𝑒𝐵(𝑦) 𝐵 – Weight function integrates to 1 over the pixel: 𝑥 𝑦 𝑒𝐵(𝑦) = 1 𝐵

  27. Bidirectional Texture Function • 𝜐 𝐵 (𝑚, 𝑤) function – 𝑚 = direction where light come from – 𝑤 = view direction – 𝐵 = pixel footprint “fraction of light from 𝑚 that gets reflected to 𝑤 from pixel footprint 𝐵 ”

  28. Bidirectional Texture Function • Usage: 𝐽 = 𝜐 𝐵 𝑤, 𝑚 𝐹 𝑚 𝑒𝜏(𝑚) Ω 𝐹 𝑚 = environment light from direction 𝑚

  29. PREFILTERING APPROACHES

  30. Brute Force • Precompute 𝜐 𝐵 (𝑚, 𝑤) – Different footprint sizes 𝐵 – Different light direction 𝑚 , and view direction 𝑤 . – Around every point on the surface. • Huge space requirement. • Lots of literature on this topic. – Most on compression

  31. Independent Prefiltering • BTF approach assumes everything is coupled. • We can prefilter each map independently . – Color map – Normal map (BRDF map) • That is, we assume 𝜐 𝐵 𝑚, 𝑤 ≈ 𝑙 𝐵 × 𝜍 𝐵 (𝑚, 𝑤) – 𝑙 𝐵 is the prefiltered color over 𝐵 – 𝜍 𝐵 (𝑚, 𝑤) is the prefiltered BRDF over 𝐵

  32. Independent Prefiltering 𝑙 𝐵 = 𝑥 𝑦 𝑙 𝑦 𝑒𝐵(𝑦) 𝐵 𝜍 𝐵 𝑚, 𝑤 = 𝑥 𝑦 𝜍 𝑦 (𝑤, 𝑚) 𝑜 𝑦 𝑚 𝑒𝐵(𝑦) 𝐵 where 𝑜 𝑦 𝑚 = max (0, 𝑜 𝑦 ∙ 𝑚)

  33. Linear Prefiltering • Filtering color map is “linear.” • Color in low-detail maps = weighted average of color in high-detail map 1/4 1/4 1/4 1/4

  34. NORMAL MAP PREFILTERING

  35. BRDF • The BRDF is determined by the normal. – Lambertian: 𝜍 𝑦 𝑚, 𝑤 = max 0, 𝑜 𝑦 ∙ 𝑚 = 𝑜 𝑦 𝑚 𝑜 𝑦 ℎ 𝛽 𝑚+𝑤 – Blinn-Phong: 𝜍 𝑦 𝑚, 𝑤 = 𝑜 𝑦 𝑚 where h = 𝑚+𝑤 • In general, BRDF is a nonlinear function of 𝑜 𝑦

  36. BRDF Filtering: Filter the Normal Map Want: Can we filter the normal instead? BRDF is a nonlinear function of normal

  37. BRDF Map Filtering is NOT Linear Correct Image Linear Filtering

  38. Averaged normal The normals at two points on the surface Combined “normal distribution”

  39. Normal Distribution Funtion Normal Distribution Function (NDF) Let’s make assumptions on BRDF: h: half vector of l and v Does not depend on the surface property Canceled in the equation

  40. Normal Map Filtering Want: Where Want to find a parameterization of f x so it’s linear

  41. Normal distribution Color map parameters map B 1 B 3 G 1 G 3 ϒ 1 ϒ 3 B 2 B 4 R 1 R 3 β 1 β 3 G 2 G 4 ϒ 2 ϒ 4 α 1 α 3 R 2 R 4 β 2 β 4 α 2 α 4 MIP-map filtering ϒ A … R A G A B A α A β A

  42. Direct Method: 3D Gaussian • [Olano and North, 1997] μ μ h f A ( h ) A A

  43. Direct Method: 3D Gaussian First moment M 1 9 linear parameters Second moment M 2 M 1 = w a M 1a +w b M 1b M 1a , M 2a M 1b , M 2b M 2 = w a M 2a +w b M 2b + = w a w b

  44. Convolution Method Surface normal Underlying BRDF distribution (NDF)

  45. Convolution Method: Spherical Harmonics • [Han et al., 2007] (Sec. 6) Spherical Coefficients Harmonics Surface NDF Underlying BRDF • Multiplication instead of convolution • p lm can be linearly filtered (e.g., MIP-map) Images: http://www.maths.nottingham.ac.uk/personal/pcm/sphere/sphere.html

  46. [Han et al., 2007]

  47. Limitations • Is the problem solved? – Answer: No – Maps are assumed to be uncorrelated – Parallax effect Correlated normal and color Ground truth Color filtered separately

  48. Conclusion • Correctly filtered surface maps are visually important – Normal, horizon, and shadow maps are non-linear • Still far from solving the problem

  49. Thank you

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