1 / 34

Real-time Shading with Filtered Importance Sampling

Real-time Shading with Filtered Importance Sampling. Mark Colbert University of Central Florida Jaroslav Křivánek Czech Technical University in Prague. Motivation. Dynamic BRDF and lighting Applications Material design Gaming Production pipeline friendly Single GPU shader

douglasi
Download Presentation

Real-time Shading with Filtered Importance Sampling

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Real-time Shading with Filtered Importance Sampling Mark Colbert University of Central Florida JaroslavKřivánek Czech Technical University in Prague

  2. Motivation • Dynamic BRDF and lighting • Applications • Material design • Gaming • Production pipeline friendly • Single GPU shader • No precomputation • Minimal code base

  3. Demo

  4. Our Approach BRDF proportional sampling Environment map filtering

  5. Related Work A Unified Approach to Prefiltered Environment Maps[ Kautz et al. 2000 ] Efficient Rendering of Spatial Bi-directional Reflectance Distribution Functions[ McAllister et al. 2002 ] Efficient Reflectance and Visibility Approximations for Environment Map Rendering [ Green et al. 2007 ] Interactive Illumination with Coherent Shadow Maps[ Ritschel et al. 2007 ]

  6. Illumination Integral Ignores visibility[ Kozlowski and Kautz 2007 ] Computationally expensive

  7. Importance Sampling Choose a few random samples Select according to the BRDF

  8. Importance Sampling Result 40 samples per pixel

  9. Random Numbers on the GPU • Relatively expensive • Random numbers per pixel (computation) • Random number textures (memory/indirection) • Quasi-random sequence • Good sample distribution (no clumping) • Use same sequence for each pixel

  10. Same Sequence Result 40 samples per pixel

  11. Filtered Importance Sampling • Filter environment mapbetween samples over hemisphere • Samples distributed by the BRDF • Support approximately equivalent to:

  12. Filtering Use MIP-maps Level proportional to log of filter size

  13. Implementation • Auto-generated MIP-map • Dual paraboloids • Single GPU Shader • Sum together filtered samples

  14. ResultsSphere – Grace Probe Stochastic No Filtering Our Result Reference

  15. ResultsBunny – Ennis Probe Stochastic No Filtering Our Result Reference

  16. Approximations Constant BRDF across filter Isotropic filter shape Tri-linear filtering

  17. RMS Error Phong Reflection - Ennis Light Probe n=10 n=100 n=1000

  18. Performance 512x512 Sphere

  19. Conclusions • Real-time glossy surface reflections • Signal Processing Theory • Practical • Affords new interfaces • For more information:GPU Gems 3 • Download the code now! • graphics.cs.ucf.edu/gpusampling/

  20. Questions

  21. Additional Slides

  22. Performance

  23. Which distribution? • Product of lighting and BRDF • Requires bookkeeping • Too expensive • Lighting • BRDF

  24. Which distribution? • Product of lighting and BRDF • Lighting • Too many samples for glossy surfaces • BRDF

  25. Which distribution? • Product of lighting and BRDF • Lighting • BRDF • Computationally efficient

  26. Environment Mapping Error Support Region • Dual Paraboloid

  27. Environment Mapping • Cube Maps • Low distortion • Accelerated by GPU • Decimation/reconstruction filters non-spherical • Introduces Seams

  28. Environment Mapping • Latitude/Longitude • Too much distortion at poles

  29. Measured BRDF Data Fast primitive distribution for illustration[ Secord et al. 2002 ] Efficient BRDF importance sampling using a factored representation[ Lawrence et al. 2004 ] Probability Trees[ McCool and Harwood 1997 ]

  30. Importance Sampling Random Samples on Unit Square PDF-Proportional Samples on Hemisphere 1 PDF Mapping 0 0 1

  31. Pseudocode float4FilteredIS(float3 viewing : TEXCOORD1 uniform sampler2Denv) : COLOR { float4 c = 0; // sample loop for (int k=0; k < N; k++) { float2 xi = quasi_random_seq(k); float3 u = sample_material(xi); floatpdf = p(u, viewing); floatlod = compute_lod(u, pdf); float3 L = tex2Dlod(env,float4(u, lod)); c += L*f(u,viewing)/pdf; } returnc/N; }

  32. Filter Support • Ideal • Isotropic approximation • Assume sample points are perfectly stratified • Implies area of 1 sample = 1 / N • Use Jacobian approximation for warping function (Inverted PDF) • Support region of sample  1 / p(i, o) N

  33. Ideal Sample Filter Design h – Filter function More expensive than illumination integral

  34. Approximate Sample Filter • Estimate for sample • BRDF  PDF • PDF is normalized BRDF • Near constant over single sample • Low frequency cosine approximation • Use multiple samples to estimate effect

More Related