+ All Categories
Home > Documents > Real-time Shading with Filtered Importance Sampling (sap 0073)

Real-time Shading with Filtered Importance Sampling (sap 0073)

Date post: 29-Oct-2021
Category:
Upload: others
View: 1 times
Download: 0 times
Share this document with a friend
1
Real-time Shading with Filtered Importance Sampling (sap 0073) Mark Colbert * University of Central Florida Jaroslav Kˇ riv´ anek Czech Technical University in Prague (a) (b) (c) (d) o f li image plane 1/p(x1) 1/p(x2) 1/p(x6) 1/p(x3) 1/p(x4) 1/p(x5) (e) Figure 1: (a) Rendering using deterministic importance sampling without filtering produces aliasing in the estimate of the illumination integral, which translates into image artifacts. (b) Randomizing the directions for each image pixel trades alias for visible noise. (c) Our filtered importance sampling suppresses the alias at the cost of slightly blurred highlights. (d) Reference solution. Images (a), (b), and (c) are rendered with 40 importance samples per pixel. (e) Illustration of the size of the filter used on the environment map i . 1 Introduction Correct perception of materials requires complex, natural illumina- tion [Fleming et al. 2003]. Thus for material or lighting design ap- plications, realistic, interactive rendering of objects with arbitrary materials under natural illumination is essential. We present a sim- ple and efficient technique for real-time, image-based lighting of objects with spatially-varying, glossy materials. The key to our algorithm is combining BRDF-proportional importance sampling with environment map filtering to attain computationally efficient rendering amenable to the GPU. Environment map pre-filtering [Kautz et al. 2000] and some fre- quency space solutions provide real-time visualizations, but their use may be too cumbersome since it requires a hefty amount of pre- computation and/or a sizable code base. Our filtered importance sampling requires minimal pre-computation and operates within a GPU shader, thereby fitting into almost any production pipeline needing real-time dynamically changing materials or lighting. 2 Filtered Importance Sampling The color of one pixel is given by the illumination integral, i.e. the integral of the lighting and BRDF product. Our approach to evalu- ating this integral on the GPU is motivated by BRDF-proportional Monte Carlo importance sampling. For each pixel, we take uni- formly distributed numbers, transform them in the GPU shader into important sample directions, and evaluate the sample. Here, the uniformly distributed numbers are a precomputed deterministic set used for all pixels. This results in aliasing in our estimate of the illu- mination integral causing image artifacts (Figure 1a). Monte Carlo would use random numbers to trade aliasing for more visually ac- ceptable noise (Figure 1b). Since generating random numbers on the GPU is expensive, we reduce the artifacts via a filtering opera- tion (Figure 1c). Our main contribution is determining the appropriate filter size for each importance sample. Intuitively, the filter size should be small for densely sampled directions around the BRDF lobe and larger elsewhere (Figure 1e). This suggests that filter size is inversely pro- portional to the probability density function (PDF) associated with the sample direction. Performing a formal analysis of numerical * [email protected] [email protected] integration in the frequency domain supports this intuition. We use hardware accelerated MIP-maps for fast environment map filtering with the PDF-proportionally sized filter. A formal analysis of filtered importance sampling exposes the approximations used in the described implementation. Notably, isotropic filter with its size inversely proportional to the PDF is a crude approximation of the ideal, spatially variant, anisotropic fil- ter. However, anisotropic filtering with MIP-mapping is not possi- ble due to current hardware limitations. By performing the MIP- map look ups via the aforementioned technique, we achieve a good performance at the cost of slight blurring. 3 Conclusion Our novel shading technique, filtered importance sampling, pro- vides real-time rendering for dynamically changing illumination and spatially-varying BRDFs. The algorithm runs at about 90 frames per second on an nVidia 7800GTX SLI, when render- ing a sphere at a resolution of 512x512 with 40 samples per pixel. However, the true strength of the algorithm is its simplic- ity and flexibility–it fits in a single GPU shader, it handles any BRDF model that can be importance sampled, and has modest pre- computation and memory requirements (a MIP-map of the environ- ment). To support diffuse surfaces, we use low-order spherical harmon- ics [Ramamoorthi and Hanrahan 2001]. Our work currently ignores self-occlusion, and we leave this for future work. However, we pro- vide the necessary adaptability for interactive material and lighting design within any production pipeline. References FLEMING, R. W., DROR, R. O., AND ADELSON, E. H. 2003. Real-world illumination and the perception of surface reflectance properties. Journal of Vision 3 (July), 347–368. KAUTZ, J., V ´ AZQUEZ, P.-P., HEIDRICH, W., AND SEIDEL, H.-P. 2000. A unified approach to prefiltered environment maps. In 11th Eurographics Workshop on Rendering, Eurographics Association, 185–196. RAMAMOORTHI , R., AND HANRAHAN, P. 2001. An efficient represen- tation for irradiance environment maps. In Proc. of SIGGRAPH 2001, ACM Press.
Transcript
Page 1: Real-time Shading with Filtered Importance Sampling (sap 0073)

Real-time Shading with Filtered Importance Sampling (sap 0073)

Mark Colbert∗

University of Central FloridaJaroslav Krivanek†

Czech Technical University in Prague

(a) (b) (c) (d)

o

f

liimage plane

1/p(x1)

1/p(x2)

1/p(x6)

1/p(x3)1/p(x4)

1/p(x5)

(e)

Figure 1: (a) Rendering using deterministic importance sampling without filtering produces aliasing in the estimate of the illuminationintegral, which translates into image artifacts. (b) Randomizing the directions for each image pixel trades alias for visible noise. (c) Ourfiltered importance sampling suppresses the alias at the cost of slightly blurred highlights. (d) Reference solution. Images (a), (b), and (c)are rendered with 40 importance samples per pixel. (e) Illustration of the size of the filter used on the environment map `i.

1 IntroductionCorrect perception of materials requires complex, natural illumina-tion [Fleming et al. 2003]. Thus for material or lighting design ap-plications, realistic, interactive rendering of objects with arbitrarymaterials under natural illumination is essential. We present a sim-ple and efficient technique for real-time, image-based lighting ofobjects with spatially-varying, glossy materials. The key to ouralgorithm is combining BRDF-proportional importance samplingwith environment map filtering to attain computationally efficientrendering amenable to the GPU.

Environment map pre-filtering [Kautz et al. 2000] and some fre-quency space solutions provide real-time visualizations, but theiruse may be too cumbersome since it requires a hefty amount of pre-computation and/or a sizable code base. Our filtered importancesampling requires minimal pre-computation and operates within aGPU shader, thereby fitting into almost any production pipelineneeding real-time dynamically changing materials or lighting.

2 Filtered Importance SamplingThe color of one pixel is given by the illumination integral, i.e. theintegral of the lighting and BRDF product. Our approach to evalu-ating this integral on the GPU is motivated by BRDF-proportionalMonte Carlo importance sampling. For each pixel, we take uni-formly distributed numbers, transform them in the GPU shader intoimportant sample directions, and evaluate the sample. Here, theuniformly distributed numbers are a precomputed deterministic setused for all pixels. This results in aliasing in our estimate of the illu-mination integral causing image artifacts (Figure 1a). Monte Carlowould use random numbers to trade aliasing for more visually ac-ceptable noise (Figure 1b). Since generating random numbers onthe GPU is expensive, we reduce the artifacts via a filtering opera-tion (Figure 1c).

Our main contribution is determining the appropriate filter size foreach importance sample. Intuitively, the filter size should be smallfor densely sampled directions around the BRDF lobe and largerelsewhere (Figure 1e). This suggests that filter size is inversely pro-portional to the probability density function (PDF) associated withthe sample direction. Performing a formal analysis of numerical

[email protected][email protected]

integration in the frequency domain supports this intuition. We usehardware accelerated MIP-maps for fast environment map filteringwith the PDF-proportionally sized filter.

A formal analysis of filtered importance sampling exposes theapproximations used in the described implementation. Notably,isotropic filter with its size inversely proportional to the PDF is acrude approximation of the ideal, spatially variant, anisotropic fil-ter. However, anisotropic filtering with MIP-mapping is not possi-ble due to current hardware limitations. By performing the MIP-map look ups via the aforementioned technique, we achieve a goodperformance at the cost of slight blurring.

3 ConclusionOur novel shading technique, filtered importance sampling, pro-vides real-time rendering for dynamically changing illuminationand spatially-varying BRDFs. The algorithm runs at about 90frames per second on an nVidia 7800GTX SLI, when render-ing a sphere at a resolution of 512x512 with 40 samples perpixel. However, the true strength of the algorithm is its simplic-ity and flexibility–it fits in a single GPU shader, it handles anyBRDF model that can be importance sampled, and has modest pre-computation and memory requirements (a MIP-map of the environ-ment).

To support diffuse surfaces, we use low-order spherical harmon-ics [Ramamoorthi and Hanrahan 2001]. Our work currently ignoresself-occlusion, and we leave this for future work. However, we pro-vide the necessary adaptability for interactive material and lightingdesign within any production pipeline.

ReferencesFLEMING, R. W., DROR, R. O., AND ADELSON, E. H. 2003. Real-world

illumination and the perception of surface reflectance properties. Journalof Vision 3 (July), 347–368.

KAUTZ, J., VAZQUEZ, P.-P., HEIDRICH, W., AND SEIDEL, H.-P. 2000. Aunified approach to prefiltered environment maps. In 11th EurographicsWorkshop on Rendering, Eurographics Association, 185–196.

RAMAMOORTHI, R., AND HANRAHAN, P. 2001. An efficient represen-tation for irradiance environment maps. In Proc. of SIGGRAPH 2001,ACM Press.

Recommended