420 likes | 434 Views
Real-time Shading with Filtered Importance Sampling. Jaroslav Křivánek Czech Technical University in Prague Mark Colbert University of Central Florida. Motivation. material design interfaces rendering algorithm to back up the interface immediate feedback. Goal.
E N D
Real-time Shading with Filtered Importance Sampling Jaroslav Křivánek Czech Technical University in Prague Mark Colbert University of Central Florida
Motivation • material design interfaces • rendering algorithm to back up the interface • immediate feedback Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Goal • image-based lighting (environment maps) • improves material perception [Fleming et al. 2003] images [Fleming et al. 2003] natural light point light Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Goal • arbitrary materials • low to high gloss, different BRDF models images by Pat Hanrahan Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Goal • dynamic materials, geometry, lighting • no pre-computation • production pipeline friendly • minimal code base / single GPU shader • real-time shadows (env. map) • not necessarily Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Desired Results Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Related Work • pre-filtered environment maps [ Kautz et al. 2000 ] • frequency-space rendering [ Ramamoorthi et al. 2002 ], [ Ng et al. 2004 ] • Efficient Reflectance and Visibility Approximations for Environment Map Rendering [ Green et al. 2007 ] • Efficient Rendering of Spatial Bi-directional Reflectance Distribution Functions[ McAllister et al. 2002 ] Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Overview • Motivation • Goal • Related Work • Shading Algorithm • Theory • Real-time Shadows • Results • Conclusion Křivánek, ColbertReal-time shading with Filtered Importance Sampling
BRDF Importance Sampling • standard in MC ray tracing • not used on the GPU Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Deterministic Sampling • aliasing 40 samples per pixel Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Our Approach filtered importance sampling less filtering where samples are denser more filtering where they are sparser 1 » filter size w w N p ( , ) i o Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Filtering • MIP-maps • level proportional to log of filter size • independent of the BRDF Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Filtered Importance Sampling 40 samples per pixel Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Overview • Motivation • Goal • Related Work • Shading Algorithm • Theory • Real-time Shadows • Results • Conclusion Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Underlying Theory • why theory? • identify approximations • suggest improvements • … sampling & filtering • signal processing Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Sampling and Reconstruction alias = integration error Ä ´ DC-term = integral sample reconstruct aliased original Křivánek, ColbertReal-time shading with Filtered Importance Sampling 16
Application to Importance Sampling • problem: non-uniform samples Křivánek, ColbertReal-time shading with Filtered Importance Sampling
warp (inverse BRDF IS) pre-filter (=convolve) warp back (BRDF IS) Conceptual Procedure Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Practice • isotropic filter approximation Křivánek, ColbertReal-time shading with Filtered Importance Sampling 19
Approximations • isotropic filter shape • constant BRDF / PDF ratio across filter support • tri-linear filtering (MIP-map) Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Anisotropic Filtering Experiments • anisotropic filter approximation Křivánek, ColbertReal-time shading with Filtered Importance Sampling 21
Anisotropic Filtering Experiments 16x anisotropic filter tex2Dgrad for anisotropic texture look-up worse image quality – still don’t know why Křivánek, ColbertReal-time shading with Filtered Importance Sampling 22
Overview • Motivation • Goal • Related Work • Shading Algorithm • Theory • Real-time Shadows • Results • Conclusion Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Real-time Shadows environment importance sampling (bright light sources = strongest shadows) Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Real-time Shadows shadow map for each sample Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Real-time Shadows visibility function convert to spherical harmonics at each texel Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Real-time Shadows • spatial filtering no filtering after filtering Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Real-time Shadows • use for rendering • diffuse • SH coefficient dot product • glossy • attenuate each sample by the visibility Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Overview Motivation Goal Related Work Shading Algorithm Theory Real-time Shadows Results Conclusion Křivánek, ColbertReal-time shading with Filtered Importance Sampling 29
FIS Results – RMS Environment Sampling Reference Filtered Sampling n = 3 5 Samples n = 17 100 Samples Křivánek, ColbertReal-time shading with Filtered Importance Sampling
FIS Results – Complex Geometry 5 Samples 50 Samples 50 Samples 200 Samples Reference Křivánek, ColbertReal-time shading with Filtered Importance Sampling
FIS Results – BRDF Anisotropy limited anisotropy ax = 0.01 ax = 0.01 ax = 0.01 ax = 0.08 ax = 0.01 ax = 0.29 Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Shadows Results Reference (30,000 Samples) Our Method (16 Samples) Visual Error SH v. Ref 8 samples 16 samples 64 samples Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Shadows Performance • NVIDIA GeForce 8800 GTX, Intel Core2 Duo, 512x512 Křivánek, ColbertReal-time shading with Filtered Importance Sampling
NVIDIA GeForce 8800 GTX, Intel Core2 Duo, 512x512 Shadows Performance polygon count Křivánek, ColbertReal-time shading with Filtered Importance Sampling 35
Video Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Conclusion • glossy surface shading • practical, relatively accurate, no pre-computation • signal processing theory • shadows • fast but very approximate • no pre-computation • implementation details: GPU Gems 3 • Code: graphics.cs.ucf.edu/gpusampling/ Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Acknowledgements • Dan Sýkora • Petr Olšák • Czech Ministry of Education • “Center for Computer Graphics” • Aktion grant • US NationalScience Foundation Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Numerical Integration as Signal Reconstruction • integral = DC term • integration by sampling • sample the function • reconstruct the DC term • insufficient sampling -> aliasing • alias may affect the DC term -> error • anti-aliasing – pre-filtering Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Ä ´ ´ Anti-aliasing by Pre-filtering band-limit sample reconstruct Křivánek, ColbertReal-time shading with Filtered Importance Sampling
Stochastic Sampling noise slower on the GPU 40 samples per pixel Křivánek, ColbertReal-time shading with Filtered Importance Sampling 42