• 沒有找到結果。

7.3 Importance Sampling of Direct Illumination

7.3.2 Importance Sampling Algorithm

Z 2π

0

G0 cos φ1j p,i) sin φ12,

(7.12)

where φ1and φ2respectively denote the zenith and azimuth angles of the sampling direction ωl

in the spherical coordinate system. The zenith angle thus can be generated from Pr φ1|λj p,i) using the traditional inversion method or Metropolis-Hastings algorithm. Second, the azimuth angle is then determined by uniformly generating a random real number in the interval [−π, π].

Note that the sampled zenith and azimuth angles are not absolute coordinates, but with respect to the SRBF center ξjp,i). The final sampling direction thus is given by increasing (or decreasing) the zenith angle of ξjp,i)by φ1, and then rotating the resulting direction about ξjp,i) by angle φ2.

7.3.2 Importance Sampling Algorithm

Based on the scattered univariate SRBF representation for BRDFs (Equations 7.8 and 7.9), the proposed importance sampling algorithm for stochastic ray tracing thus consists of the following steps:

1. From the viewpoint, shoot a ray that passes a sample point on the image plane, and find the nearest intersection point p of this ray with the scene.

2. At point p, search for the K nearest neighbors of current novel view direction ωv from Ωv.

3. Linearly interpolate the density distribution (Equation 7.9) of each neighboring direction to obtain Pr(ωl|p, ωv).

4. Sample total N illumination directions from Pr(ωl|p, ωv).

5. The final shading color is then given by evaluating Equation 7.7.

7.3.3 Experimental Results

The experiments and simulation timings of importance sampling were conducted and measured on a workstation with an Intel Core 2 Extreme QX9650 CPU, an NVIDIA GeForce 9800 GX2 graphics card, and 8 gigabytes main memory under Microsoft Windows Vista operating sys-tem. We modified the ray tracing program from the book by Pharr and Humphreys [137] to support the proposed importance sampling algorithm on CPUs. Besides BRDF sampling, mul-tiple importance sampling [186, 187] is additionally employed to combine the sampled results

of BRDFs and the lighting environment. In our experiments, the configurations of the scat-tered univariate SRBF representation for BRDFs were the same as those in Table 7.1 (Section 7.2.3). For each intersection point, the number of nearest neighboring view directions for linear interpolation was set to 4.

Figures 7.11–7.13 compare the rendered images with different numbers of samples per pixel based on the proposed importance sampling algorithm, with the configurations of the scattered univariate SRBF representation for each BRDF listed in Table 7.1. In all rendered images, the screen resolution was set to 640×480. The reference images were generated on GPUs from raw BRDF data by uniformly sampling a large number of rays over the unit sphere at each intersection point. As for the results of importance sampling, half of the samples were utilized for BRDF sampling, with the other half for incidence radiance sampling. Typically, a configuration of 800 samples per pixel can provide a visually pleasing result, with a computation time of less than 30 minutes on average. Since the current implementation of stochastic ray tracing neither utilizes the multi-core capability of CPUs nor allows operations to be accelerated on GPUs, there is still much room for improving the overall performance. Indeed, the bottleneck of our system mostly lies in the fundamental ray tracing process, not in the proposed importance sampling algorithm.

Note that one can also generate samples from the product of a BRDF and a lighting envi-ronment [22]. It is rather intuitive to extend the proposed importance sampling algorithm to support this concept. By exploiting the rotational invariance of univariate SRBFs, the product of a BRDF and a lighting environment can be efficiently computed, and then analyzed using the proposed approach to determine sampling directions. This approach typically requires much fewer samples per pixel to achieve similar image quality. Its overall computation time is also expected to be faster than previous importance sampling methods. A detailed description of the product sampling based on the scattered univariate SRBF representation is beyond the scope of this dissertation. Interested readers may refer to [71, 178].

(a) Reference image (∼400000 samples per pixel) (b) 200 samples per pixel

(c) 400 samples per pixel (d) 600 samples per pixel

(e) 800 samples per pixel (f) 1000 samples per pixel

Figure 7.11: Comparisons of rendered images with different numbers of samples per pixel based on the proposed importance sampling algorithm for the model Bunny with the BRDF Blue Metallic Paint.

(a) Reference image (∼400000 samples per pixel)

(b) 200 samples per pixel (c) 400 samples per pixel

(d) 600 samples per pixel (e) 800 samples per pixel (f) 1000 samples per pixel

Figure 7.12: Comparisons of rendered images with different numbers of samples per pixel based on the proposed importance sampling algorithm for the model Buddha with the BRDF Krylon Blue.

(a) Reference image (∼400000 samples per pixel)

(b) 200 samples per pixel (c) 400 samples per pixel

(d) 600 samples per pixel (e) 800 samples per pixel (f) 1000 samples per pixel

Figure 7.13: Comparisons of rendered images with different numbers of samples per pixel based on the proposed importance sampling algorithm for the model Venus with the BRDF Nickel.

Chapter 8

Application II: Spatially-Varying Appearance Models

Modeling spatially-varying surface appearance for real-time graphics and vision applications is a more challenging problem than approximating illumination and reflectance functions. For photo-realistic image synthesis, the large amount of appearance data not only consumes con-siderable storage space but also frequently becomes the performance bottleneck of run-time rendering process. In the first section of this chapter, we present two categories of powerful compression methods for bidirectional texture functions (BTFs) [28], including tensor approx-imation algorithms (Section 8.1.1) and multivariate spherical radial basis functions (SRBFs) (Section 8.1.2). Experimental results further reveal that real-time rendering performance can be easily achieved with the proposed methods.

Moreover, previous spatially-varying appearance materials, such as BTFs, only permit real-istic illumination response of object surfaces at the meso-scale, but the complex surface micro-geometry is not explicitly modeled. In the second section of this chapter, we thus introduce a novel spatially-varying appearance model, namely view-dependent occlusion texture function (VOTF), which records meso-scale visibility information from different view directions. In this way, the proposed VOTFs can be easily combined with existing appearance models to visualize silhouettes at the meso-scale.

8.1 Bidirectional Texture Functions

Bidirectional texture functions [28] generalize bidirectional reflectance distribution functions (BRDFs) to contain textural patterns of real-world object surfaces. They capture spatially-varying surface appearance and reflectance that change with respect to the illumination and view directions. A BTF is frequently a six-dimensional function of three variables: ωl, ωv, and t =x, yT, where ωl and ωv are respectively the illumination and view directions on the unit sphere S2, and t denotes the two-dimensional spatial coordinates, x and y, of a texel. Figure 8.1

Illumination Variations

V ie w V ar ia tio ns

Figure 8.1: An example of a BTF from the volumetric surface texture database [84]. Some images of the material Sponge are shown in this figure. While images along the blue arrow were captured from the same view direction but under different illumination conditions, those along the gray arrow were acquired under the same illumination condition but from different view directions.

shows an example of measured BTFs from the volumetric surface texture database [84].

Although the illumination effects of real-world object surfaces can be faithfully captured with BTFs, we usually have to tabulate several gigabytes of raw data for a single BTF. This is certainly impractical for photo-realistic image synthesis in real-time rendering applications. In the following sub-sections, we therefore present two categories of powerful compression meth-ods to reduce the amount of BTF data and accelerate run-time rendering performance. The first category (Section 8.1.1) relies on organizing a BTF as a multi-dimensional array so that tensor approximation algorithms, including clustered tensor approximation (Chapter 5) and K-clustered tensor approximation (Chapter 6), can be directly applied to compress it. The second category (Section 8.1.2) is instead based on the parameterized multivariate SRBF representation introduced in Chapter 4. This parametric representation is especially suitable to high-speed ren-dering on GPUs for performance-intensive applications. Finally, detailed comparisons of these two categories of compression methods and the choice between them in a particular application are discussed in Section 8.1.3.