A Constructive Theory of Sampling for Image Synthesis Sing Reproducing
Total Page:16
File Type:pdf, Size:1020Kb
A Constructive Theory of Sampling for Image Synthesis using Reproducing Kernel Bases Christian Lessig∗ Mathieu Desbrun Eugene Fiume DGP | University of Toronto CMS | Caltech DGP | University of Toronto QMC: RK: SNR=13.49 SNR = 15.01 L2=0.2124 L2=0.1805 Figure 1: Lighting in a Villa interior obtained from a photon map. For each shading point in the scene, the incoming light energy density is approximated using 64 hemispherical samples. The left image is computed using classical final gathering using a low-discrepancy sequence. For the right image the same samples were employed but with an integration rule derived using our theory of sampling, providing substantially reduced visual noise and lower numerical error rates. Abstract over a finite number of ray paths, photon mapping interpolates dis- crete “photons”, and Metropolis light transport mutates existing Sampling a scene by tracing rays and reconstructing an image from pointwise paths, to name a few examples. Motivated by this impor- such pointwise samples is fundamental to computer graphics. To im- tance of pointwise techniques, we present an alternative theory of prove the efficacy of these computations, we propose an alternative sampling for image synthesis. In contrast to existing approaches theory of sampling. In contrast to traditional formulations for image that rely on nonconstructive sampling operators based on Dirac synthesis, which appeal to nonconstructive Dirac deltas, our theory deltas, we instead employ constructive reproducing kernels to relate employs constructive reproducing kernels for the correspondence a continuous function to pointwise samples. This enables point- between continuous functions and pointwise samples. Conceptually, wise numerical techniques to be designed for light transport and this allows us to obtain a common mathematical formulation of devised for the finite sample counts and non-equidistant distribu- almost all existing numerical techniques for image synthesis. Practi- tions employed in practice. Our example applications demonstrate cally, it enables novel sampling based numerical techniques designed that this can provide considerably improved visual fidelity and lower for light transport that provide considerably improved performance numerical error rates. Through its functional analytic foundation, per sample. We exemplify the practical benefits of our formulation our formulation also enables us to employ Galerkin projection to with three applications: pointwise transport of color spectra, pro- obtain sampling based algorithms such as path tracing and photon jection of the light energy density into spherical harmonics, and mapping. This overcomes the dichotomy between radiosity-based approximation of the shading equation from a photon map. Experi- and ray tracing techniques that exists in the current literature. mental results verify the utility of our sampling formulation, with lower numerical error rates and enhanced visual quality compared The foundation of our formulation of sampling are reproducing to existing techniques. kernels. These provide a theoretically insightful yet numerically practical conceptualization of the correspondence between pointwise CR Categories: I.3.3 [Computer Graphics]: Three-Dimensional samples and continuous functions. Reproducing kernels kλ(x) have Graphics and Realism—Display Algorithms I.3.7 [Computer Graph- the sifting property δλ[f]=hkλ(x); f(x)i=f(λ) of the Dirac delta ics]: Three-Dimensional Graphics and Realism—Radiosity; δλ but are constructive Hilbert space functions. This enables us to employ kernels kλi (x) “located” at a set of points λi as basis Keywords: sampling, light transport simulation, reproducing ker- functions. The basis expansion of an arbitrary signal f(x) in such a nel Hilbert space reproducing kernel basis takes the form m m X ~ X ~ 1 Introduction f(x) = hf(y); kλi (y)i ki(x) = f(λi) ki(x): Existing computational techniques for image synthesis rely exten- i=1 i=1 sively on pointwise sampling: path tracing computes the transport This equation is at the heart of our work: pointwise samples f(λi) provide the basis function coefficients—without computing inner products—and exact reconstruction from only these values f(λi) is ~ ∗e-mail:[email protected] possible using well defined dual basis functions ki(x). Our theory of sampling encompasses many classical results on the subject. For example, the Shannon sampling theorem arises as an orthonormal reproducing kernel basis for Fourier-bandlimited func- tions; the weights of quadrature rules, such as Gauss-Legendre, are obtained by integrating the dual functions k~i(x); and reconstruction kernels, such as those used on the image plane, are dual kernels k~i(x) for appropriate function spaces. However, with our formu- 38 Light Transport in Computer Graphics Computer in Transport Light For all three applications, we provide experimental results that demonstrate that our formulation significantly increases the effi- cacy attained per sample. These improvements result from tailoring the techniques to the function spaces that naturally arise and from intrinsically constructing them for the finite sample counts to which we are restricted in practice. The remainder of the paper is structured as follows. The mathemati- cal formulation of our constructive theory of sampling is developed in Sec. 2. In Sec. 3, we will discuss how the theory provides a unified formulation for a wide range of existing light transport sim- ulation techniques. Subsequently in Sec. 4, we develop our three example applications and present experimental results. The paper concludes in Sec. 5 with an outlook on other possible applications Figure 2: Importance of point sampling for image synthesis. The light of our formulation of sampling for image synthesis. energy density is a continuous field whose propagation through space is described by a partial differential equation. Numerically, only the propaga- 2 From Samples to Functions tion along individual trajectories can be evaluated. This is equivalently to In this section, we develop the mathematical formulation of our the- a pointwise solution of the partial differential equation using the method of ory of sampling. To facilitate intuition, its concepts are exemplified characteristics. All solutions of the continuous equation have to be recon- for a 1-dimensional function class in Example 1 (boxed, on the next structed from this pointwise information alone. page) and the reader is encouraged to use the supplementary source code to gain some practical understanding. A more pedagogical lation, existing pointwise techniques become instances of a more exposition of our approach to sampling is presented in the supple- versatile construction that provides a recipe to develop numerically mentary tutorial. Readers unfamiliar with finite dimensional Hilbert practical sampling, quadrature, and interpolation formulas for arbi- spaces and their connection to numerical linear algebra should also trary domains and all function spaces admitting a reproducing kernel. consult this material or a standard text such as [Daubechies 1992; This is crucial for light transport simulation where signals are de- Mallat 2009]. fined over arbitrary manifolds and where classical approximation spaces are ill-suited due to frequently occurring discontinuities. The 2.1 Motivation requirement that a function space must admit a reproducing kernel In computer graphics, the Dirac delta δλ[f]=f(λ) is commonly might appear as limitation. Moreover, any finite function space, used to conceptualize the correspondence between a continuous and hence any function space relevant for numerical computations, function f : X R and pointwise samples f(λ) of it. However, → does admit a reproducing kernel. Nonetheless, the question of good the Dirac delta δλ[ ] is a distribution in the sense of Schwartz and approximation spaces and convergence to the infinite dimensional provides no information· about a function f beyond its pointwise limit requires further investigation. value f(λ). This makes it ill-suited for the exact reconstruction of from only a finite set of pointwise samples , which is Our formulation of sampling also provides a novel quality measure f f(λi) what we are interested in and restricted to in practice. Reconstruc- for the distribution of sampling points which we call rk-discrepancy. tion from finitely many “samples” is well defined using basis The measure depends on the domain and function space under con- fi expansions. However, the are then basis function coefficients sideration. Together with its numerical computability, this enables fi defined by continuous inner products ˜ whose numerical the use of computer-based optimization techniques to find nearly op- f,φi = fi evaluation often requires costly approximations. Fortunately, for timal points–with respect to rk-discrepancy–for a given application. regular enough Hilbert spaces there exist functions kλ(x) such that We demonstrate the constructive nature and practicality of our for- the inner product is equivalent to point evaluation, mulation of sampling with three example applications, as follows: f(y),kλ(y) = f(λ)=δλ[f]. (1) i) Almost all techniques for image synthesis represent the color See Example 1.b for some concrete reproducing kernels. When such spectrum of light using pointwise samples. Peercy [1993] kernels kλi (x) are employed as basis functions, the samples f(λi) showed that this can be inefficient and that continuous basis immediately provide basis function coefficients—without the need to