A comprehensive geometrical optics application for wave rendering

A comprehensive geometrical optics application for wave rendering

Graphical Models 75 (2013) 318–327 Contents lists available at ScienceDirect Graphical Models journal homepage: www.elsevier.com/locate/gmod A comp...

1MB Sizes 0 Downloads 38 Views

Graphical Models 75 (2013) 318–327

Contents lists available at ScienceDirect

Graphical Models journal homepage: www.elsevier.com/locate/gmod

A comprehensive geometrical optics application for wave rendering q Fu-kun Wu a,b, Chang-wen Zheng a,⇑ a b

Science and Technology on Integrated Information System Laboratory, Institute of Software, Beijing, China University of Chinese Academy of Sciences, Beijing, China

a r t i c l e

i n f o

Article history: Received 31 January 2013 Received in revised form 22 July 2013 Accepted 27 July 2013 Available online 12 August 2013 Keywords: Diffraction shaders Bidirectional reflectance distribution function Fresnel factor Microfacet scattering metric Wigner distribution function Acceleration algorithm

a b s t r a c t This paper presents a novel method to model wave effects in a ray tracer which attempts to account for the attenuation, scattering and absorption of light affected by participating media along rays. Inspired by diffraction shaders (DS), we propose an extension of this model to construct a new Bidirectional Reflectance Distribution Function (BRDF) to simultaneously take into consideration the phase and amplitude variation of light. The new method can simulate diffraction effects of a variety of materials, where we introduce the Fresnel factor and a microfacet scattering metric which affect the absorption and geometrical attenuation of photons. Incorporating Wigner Distribution Function (WDF), our method is further extended to model interference effects after multiple bounces by deferring the phase calculation. An acceleration algorithm is also implemented to real-time model diffraction effects of different apertures. We demonstrate the validity of our method by generating wave patterns for diverse scenes. Ó 2013 Elsevier Inc. All rights reserved.

1. Introduction When light passes through obstacles with the size of several wavelengths, it will deviate from its original direction of propagation to bend into the geometrical shadow region of obstacles, and generate the uneven distribution of the radiant energy. This type of phenomenon is called diffraction which can be accurately explained with scalar diffraction theory [1], where the rainbow hologram is a representative example. In computer graphics, it is desirable to construct appropriate reflection models to model the interaction of light and surfaces of objects for the sake of realistically simulating scenes such as butterfly wings and feathers. These reflection models are mainly based on the two theories, namely geometrical optics and wave optics. In geometrical optics, light is abstracted as a collection of rays and some q

This paper has been recommended for acceptance by Peter Lindstrom.

⇑ Corresponding author. Fax: +86 10 62552533.

E-mail address: [email protected] (C.-w. Zheng). URL: http://people.gucas.ac.cn/~cwzheng (C.-w. Zheng). 1524-0703/$ - see front matter Ó 2013 Elsevier Inc. All rights reserved. http://dx.doi.org/10.1016/j.gmod.2013.07.004

common geometrical phenomena, such as diffuse, specular highlight and refraction, can be realistically rendered in ray-based frameworks. In wave optics, light is a kind of electromagnetic field with amplitude and phase. A series of wave reflection models [2–4] have been proposed to simulate diffraction effects from microstructures such as compact discs and diffraction gratings, where the height field model or the correlation function is widely used to encapsulate the phase variations into reflected rays. These methods are able to approximately describe wave phenomena, but few of them consider the amplitude factor which determines the absorption or attenuation of light, and are only applied to the far field (i.e., the Fraunhofer region) or special surfaces. In this paper, we propose a new Bidirectional Reflectance Distribution Function (BRDF) diffraction model for a variety of materials based on the Torrance-Sparrow reflection model [5] and diffraction shaders (DS). This model takes into account the variable Fresnel coefficient dependent on the wavelength and introduces a microfacet scattering metric. The amplitude and phase variations of light are thus encapsulated into our wave model in the

F.-k. Wu, C.-w. Zheng / Graphical Models 75 (2013) 318–327

form of the radiant intensity of reflected rays to explain the absorption, shadowing or interreflection of photons, where the Monte Carlo method [6] is used to solve our wave equation. In addition, we incorporate the Wigner Distribution Function (WDF) into the proposed BRDF wave optics model to simulate interference effects after multiple bounces by deferring the phase calculation to a later stage. We render the realistic wave effects from many objects such as disks or spheres in a ray-based framework using the proposed BRDF wave model, where our wave equation can strictly describe the amplitude and phase variations by referring to the physical optics. We also implement an acceleration algorithm to real-time render the wave effects of apertures using the CUDA [7]. The rest of this paper is organized as follows. Some related techniques are briefly reviewed in Section 2. Section 3 outlines a set of physical models for rendering wave phenomena. Our methods are described in detail in Section 4. The experimental results and analysis are provided in Section 5. We finally conclude this paper with discussions on future work in Section 6. 2. Related work 2.1. Geometrical optics Torrance and Sparrow [5] proposed the Torrance-Sparrow microfacet model to describe the reflection properties of the metal surfaces, which was introduced to graphics by Blinn [8], and Cook [9] constructed a similar reflection model. Phong [10] summed up several shading techniques and hidden surface deletion methods, and also presented a geometrical reflection model. Oren and Nayar [11] constructed the Oren-Nayar BRDF model to model the aggregate reflection effects of the collection of grooves, where microfacets were regarded as symmetrical V-shaped grooves and it assumed that each individual microfacet exhibited the perfect Lambertian distribution. Granier et al. [12] proposed a RGB BRDF model for the specular and diffuse reflection of layered materials. Pharr et al. [6] conducted a complete theoretical illustration and comparison for physical-based reflection models. The advantage of modeling using geometrical optics is to make the interaction of light and surfaces easier to control and not consider the complex phase variation. This approach not only directly improves the computational efficiency, but also makes the renderer based on geometrical optics simulate specular reflection and refraction effects realistically by selecting several control parameters to generate the different spatial distributions of ray intensity. However, it is difficult to model the wave phenomena such as diffraction and interference in ray-based renderers out of the lack of the effective description of the phase variation of the wave.

319

optics in graphics. Moravec [14] proposed the wave optics model based on the phase tracking technology which was applied to graphics in 1981. Kajiya [15] developed a BRDF anisotropic reflection model using a numerical solution to solve the Kirchhoff integral formula. In addition, He et al. [16] also described a sophisticated physical model to simulate the reflection phenomena from a variety of surfaces. Nayar et al. [17] proved that if the surface is very rough, the wave reflection models are similar to the ones based on geometrical optics, where the reflected radiances generated by wave models can be approximated by results using geometrical optics. More recently, the numerical calculation methods such as Monte Carlo and fast Fourier transform (FFT) are widely applied to solve the wave rendering equation. The representative example is the BRDF model of diffraction shaders [2], where the Fourier optics theory and the correlation function related to the height field are used to encapsulate the spatial density of light energy into outgoing rays which contain phase variations. In addition, Wigner distribution function is also commonly used to construct wave models [18–20]. Cuypers et al. [21], for instance, presented the wave Bidirectional Scattering Distribution Function (WBSDF) for rendering wave effects after several bounces by deferring the phase calculation. There also exist multiple diffraction models applied to the rendering of sound in acoustics [22,23]. Although wave models are able to explain the phase and amplitude variations of light, they are not usually worth their computational cost for many applications. We thus implement a simple acceleration algorithm on the current graphics hardware to improve the rendering efficiency, which can be further used for glare generation in 3D scenes [24].

3. Principles of wave rendering The interaction of light and microfacets is often described by geometrical reflection models (see Fig. 1). However, there have been multiple physical optics models proposed to render the wave effects from microfacets such as apertures and diffraction gratings. Since these wave models can explain lots of physical phenomena, they have attracted more and more attentions. According to the Maxwell’s theory, when light interacts with the surfaces of objects, reflection equations should be solved as the boundary value problem of the electromagnetic field. In practice, because of the computational complexity of the generic solution, most of wave models use some approximate numerical algorithms. Stam, for instance, uses the

2.2. Wave optics Beckmann and Spizzichino [13] proposed an early physical model to describe the reflection effects from microfacets, laying the foundation for the application of wave

Fig. 1. A schematic illustration of the interaction of light and microfacets.

320

F.-k. Wu, C.-w. Zheng / Graphical Models 75 (2013) 318–327

correlation function of the height field and the FFT to accelerate the calculation speed of the Kirchhoff integral formula. This paper presents a simple extension of the DS model [2] based on the interaction of light and microfacets, where the anisotropic property of the object surface plays an important role in modeling wave effects. 3.1. Scalar diffraction equation

In a physical-based framework, BRDFs are often used to describe the interaction of light and microfacets, which exhibit the spatial density distribution of the outgoing radiance related to the angle of reflection. Based on Fourier analysis and synthesis techniques, many wave models derived from Eq. 2 are proposed to encapsulate the phase variance into the outgoing radiance by means of BRDFs. The relationship between the BRDF and the wave in DS, for instance, is written as

R2 hju2 j2 i R!1 A cos h1 ju j2 cos h 2 1

According to the Huygens–Fresnel principle, the wave gradually spreads from a point to another in space and each point of the wavefront can be regarded as a secondary disturbance center, emitting a new spherical wave. This means that the wave at a later stage is the result of the coherent superposition of each point on the previous wavefront. Fig. 2 shows that a spherical wave from a point source propagates through an aperture, where the outgoing wave from the aperture satisfies the Helmholtz equation, given by

BRDFk ¼ lim

r2 w þ K 2 w ¼ 0

As illustrated by the above section, the diffraction formula proposed by Stam can be applied to the photo-realistic rendering. However, this formula only expresses the phase delay information of the reflected light, ignoring the amplitude variation of light affected by microfacets (i.e., without considering the absorption and scattering of photons). We propose a simple extension using the variable Fresnel coefficient Ffresnel and a microfacet scattering metric Gk(xo, xi, xh) in order to overcome the deficiency. Our model can simulate the diffraction effects from a variety of materials instead of outlining the amplitude variation of light in the form of its statistical mean value in DS. In virtue of the Kirchhoff theory of diffraction and DS, this paper presents a new BRDF diffraction equation, given by

ð1Þ

Meanwhile, under the assumption of a vacuum, the corresponding Kirchhoff scalar diffraction formula is expressed as

UðPÞ ¼

1 4p

  Z  iks e @U @ eikr ds U @n r r @n S

ð2Þ

where k ¼ 2kp, denoting the reciprocal of the wavelength. There exist different approximate approaches to the distance r, leading to different diffraction phenomena such as Fresnel and Fraunhofer diffraction. 3.2. Diffraction shaders The purpose of this paper is to model wave effects in ray tracers by encapsulating the phase variation into the reflected light energy from a point P on the microfacet to the viewpoint. Therefore, the Kirchhoff diffraction formula is not applicable. It is necessary to generate a new solution to calculate the spatial distribution of the radiant energy of the outgoing rays from microfacets, where phase variations are taken into account.

ð3Þ

where R is the distance from a point P on the microfacet to the viewpoint, A denotes a micro area centered on the ikR point P, u1 ¼ eik  xi  x and u2 ¼ ike ðF  ðxi  xo Þ 4pR R ^ eikðxi xo Þ  s ds with the incoming direcðxi þ xo ÞÞ  S n tion xi and the outgoing direction xo [2]. 4. BRDF wave framework

BRDFk ¼

F 2fresnel Gk ð

xo ; xi ; xh Þ

k

2

4p 2 x2

! Spk þ jhpidðl; mÞj ð4Þ

where Spk denotes the spectral density of reflected rays from microfacets and x, l, m are related to incoming wave and outgoing wave. Fig. 3 shows the schematic description corresponding to the BRDF wave rendering. We will use the following two subsections to describe our extensions in detail. In addition, we incorporate WDF into our BRDF optics model to further extend DS to model interference effects by calculating the phase variation in a later stage. We also implement a simple acceleration algorithm to render wave effects of different apertures in real time for the sake of efficiency. 4.1. Variable fresnel coefficient

Fig. 2. Kirchhoff modeling of diffraction by a plane aperture.

When light interacts with the material, the photons may be absorbed into heat or reflected. Reflected photons may leave the surface along different directions or hit other points on the surface or bounce under the surface for subsurface scattering.

F.-k. Wu, C.-w. Zheng / Graphical Models 75 (2013) 318–327

321

where g denotes the index of refraction and k denotes the absorption coefficient [6]. In this work, the Fresnel equation is introduced to approximately describe the amount of outgoing light reflected from surfaces. In the experiment, we only focus on the visible spectrum whose wavelength ranges from 350 nm to 730 nm. 4.2. Microfacet scattering metric

Fig. 3. The geometry used in the BRDFk formula of diffraction.

There typically exist two phenomena, namely specular reflection and scattering that represent different properties of materials. Because of the difficulty of exactly modeling the scattering, researchers usually treat the amount of scattering as a constant. The most prominent feature of the reflection is that the reflected energy changes with the alteration of the outgoing angle, which can be approximated using the BRDF. In addition, the material also shows different responsive properties dependent on the specific wavelength. Fig. 4, for example, exhibits the refractive index and absorption rate of copper. The reflected ratio of incoming light is commonly uniform over the entire surface in a simple ray tracing algorithm. However, this ratio is directionally dependent and cannot be replaced by a constant in a physical-based framework. This paper uses the Fresnel equation to describe the influence of the material on light which describes the spatial distribution characteristics of the remaining light from surfaces. Because of our diffraction model being affected by the properties of the material, it can be used to model the wave effects of a variety of materials. We assume that light is non-polarized out of the simplicity. The Fresnel coefficient is written as

F fresnel ¼ 0:5  ðn2k þ n2? Þ

ð5Þ

where for the metallic conductors, the commonly used approximations are given by 2

n2k ¼

ðk þ g2 Þ cos x2i  2g cos xi þ 1 2

ðk þ g2 Þ cos x2i þ 2g cos xi þ 1 2

n2?

¼

ðk þ g2 Þ  2g cos xi þ cos x2i 2

ðk þ g2 Þ þ 2g cos xi þ cos x2i

ð6Þ

In a ray tracer, the BRDF is defined as the ratio of the outgoing radiance and the incident irradiance. More recently, there are multiple methods, such as the direct spectral measurements [25], the unbiased empirical models [26,27], the correlation function model based on the height field [2] and the microfacet model [8,9], applied to construct BRDF formulas. This paper makes use of the microfacet model to provide a further extension to BRDF diffraction shaders to explain the shadowing, shading and interreflection among microfacets corresponding to Fig. 5. In Fig. 1, the points Q1, Q2 and Q3 represent the different combination conditions among the light source, the viewer and the microfacet. Referring to Fig. 5, we can find that either the line of sight is occluded, the light arrives at the viewer after several bounces, or the light emitted by light source is directly affected by the masking. All above phenomena should not be ignored even those with lesser impact. The height field model makes use of the correlation function to handle the blocking of light or sight, which ignores some details, whereas the microfacet model between the height field model and the empirical model can more precisely handle the above problems. Hence, in virtue of the advantages of the microfacet model in handling the complex scenes, our model uses it to do the numerical calculation with the help of statistics. The probability density is used to describe the microfacet normal distribution out of the irregularities of the surface height. It is similar to the previously proposed methods [5,9,8,28], where the surface is composed of the V-shaped microfacets whose normal distribution can be statistically described with the Gaussian or Poisson function. Note that the occlusion of the line of sight cannot be strictly handled using statistical analysis methods, thus the proposed equation is more suitable for the situation that the contributions of these factors are very little. Denote these factors by G, and the diffraction coefficient can be given by

Fig. 4. Refractive index and absorption coefficient of copper. It shows the wavelength-dependent values of the absorption coefficient (blue) and the refractive index (red), where the horizontal axis denotes wavelength in nm. (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)

322

F.-k. Wu, C.-w. Zheng / Graphical Models 75 (2013) 318–327

Fig. 5. Geometrical relationship of light, microfacet and viewer. (a) The line of sight is occluded. (b) The ray is blocked. (c) Ray reaches viewer after multiple bounces.

Fig. 6. The simulation of a coherent wave propagating through a double-slit diffraction plane (left) and generating the spatial distribution of WDF where red denotes positive value and green denotes negative value (right). (For interpretation of the references to color in this figure legend, the reader is referred to the web version of this article.)

Gk ðxi ; xo Þ ¼ Gk ðxi Þ  Gk ðxo jxi Þ

ð7Þ

where Gk(xi) denotes the propagating probability of the incoming wave and Gk(xo—xi) denotes the conditional probability of the propagation of the outgoing wave in case of xi normally propagating. The Eq. 7 depends on the assumption that the incoming wave is not correlated to the outgoing wave. However, when their directions are close to each other, the above equation tends to be a constant one which implies their correlation in the extreme case. So there is another expression to handle this correlation well, written as [28]

Gk ðxi ; xo Þ ¼ ð1  wðxÞÞGk ðxi Þ  Gk ðxo jxi Þ þ wðxÞ  minðGk ðxi Þ; Gk ðxo jxi ÞÞ

ð8Þ

where w(x) denotes the correlation factor, x denotes the variable angle between the incoming wave and outgoing wave. Please refer to Ginneken’s work [29] for the further discussion of the correlation factor w(x). It is significantly important to calculate the propagating probability of the incoming wave and outgoing wave in spite of the large complexity. One goal of this paper is to generate a simple and generic method for explaining the complex microfacet phenomena mentioned above. Torrance et al. [5] used Gaussian distribution to approximate and Pharr et al. [6] also gave a comprehensive description, thus we can obtain the following equation, namely,

Gk ðxi ; xo ; xh Þ   2ðn  xh Þðn  xo Þ 2ðn  xh Þðn  xi Þ ; ¼ min 1; xo  xh xo  xh ð9Þ

where xh denotes the bisector of xi and xo, and n is the microfacet normal.

4.3. Combining Wigner distribution function Our initially extended diffraction equation can instantaneously render diffraction effects on microfacets, but it lacks the ability of modeling the interference effects by deferring the phase calculation. In contrast, the WDF [20,30–32] can act as a local frequency spectrum of wave to generate interference effects in a later stage, which indirectly encodes the phase of wave into the outgoing rays using positive or negative values. Fig. 6 shows the generated WDF pattern corresponding to the double-slit diffraction. The transmission function   na of this diffraction plane is defined as rect nþa x þ rect x , and the expression of its WDF is described in detail by Oh et al. [20]. In this work, our goal is to apply the wave model to model diffraction and interference effects, so the WDF is incorporated to further extend our BRDF wave model in PBRT [6]. According to the principle of the WDF, the WDF of the microstructure u(x) is defined by

Wðx; lÞ ¼

Z



1 2





1 2



0

u x þ x0 u x  x0 eilx dx0

ð10Þ

where the asterisk denotes the complex conjugation. Due to the variable l being related to the angle, the relationship between our BRDF model and the WDF can be further represented as

F.-k. Wu, C.-w. Zheng / Graphical Models 75 (2013) 318–327

   sin xo  sin xi BRDFk ¼ Wðx; lÞ ¼ W x; k

323

ð11Þ

where this expression is feasible under the paraxial approximation [21]. Algorithm 1. GPU-based rendering for wave effects 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16

/⁄allocate imaging memory space in NVIDIA Graphics Card⁄/ ID,IS cudaMalloc () /⁄copy from CPU to GPU⁄/ cudaMemcpy (ID, IS) /⁄initialize memory data in parallel⁄/ BitWise[BlockNum, ThreadNum](IS, ID) for k = 350 to 730 do /⁄creates 2D FFT plan⁄/ cufftPlan2d () /⁄executes FFT processes⁄/ cufftExecC2C () FFTShift[BlockNum, ThreadNum](ID) /⁄Calculate the magintitude of Spectrum⁄/ KernelFFTSqMg[BlockNum, ThreadNum](ID) CombineImg (IFinal, ID) end

Suppose that a monochromatic plane wave propagates through a sinusoidal phase grating. The transmission function of this grating is given by m

n

tðn; gÞ ¼ e½i 2 sinð2ppÞ circ

r

x

¼

1 X

Jq

q¼1

m r n ei2pqp circ 2 x

Wðn; lÞ ¼

4.5. Rendering

  m m n q þ q2 J q2 ei2pqpðq1 q2 Þ d l  1 J q1 2 2 2p ¼1

1 X

q1 ¼1q2

Kirchhoff integral formula to real-time render wave effects of apertures on the GPU as showed in Fig. 8.

ð12Þ

where m is the maximum height of the grating, r is the radial distance from the center of the grating, p is the period and Jq is the Bessel function [33]. The WDF of the transmission function t(n, g) in the case of one dimension is written as 1 X

Fig. 7. Rendered result using our wave model where WDF is incorporated to model the interference effect after a single bounce. In contrast, the instantaneous diffraction from a different viewpoint is shown in the down right corner.

ð13Þ Substitution of W(n, l) from Eq. 13 into Eq. 11 yields the WBSDF constructed by Cuypers et al. [21]. Based on the WBSDF model, our method incorporates WDF to render interference effects realistically after a single bounce by calculating the phase variation in a later stage as shown in Fig. 7.

In the rendering experiment, in virtue of our BRDF wave model encapsulating the phase information in the form of the intensity variations of reflected rays as illustrated in Fig. 3, the wave rendering equation of the wavelength k is defined as

Lo ðp; xo ; kÞ ¼

Z

BRDFk ðp; xi ; xo Þ  Li ðp; xi ; kÞ

 j cos hjdxi þ Le ðp; xo ; kÞ

ð14Þ

where Lo(p, xo, k) denotes the reflected radiance from the point P in the direction xo, Le(p, xo, k) denotes the selfemissive energy of the microfacet at the point P, BRDFk(p, xi, xo) is our proposed diffraction coefficient along a pair of incoming and outgoing directions, and Li(p, xi, k) is the incident energy reaching the point P, written as

k/i cos h

4.4. Combining the acceleration hardware

Li ðp; xi ; kÞ ¼

The ray tracer in which we have implemented our BRDF wave model, needs to consume a large amount of memory and computation time to model wave phenomena. Hence, it is desirable to accelerate the speed of rendering wave effects, where Hullin et al. [24] proposed several acceleration strategies for lens flare. Because of our wave model being derived from Eq. 2, we implement a simple acceleration algorithm based on the CUDA which is summarized in Algorithm 1. This algorithm can be directly used to solve

where R denotes the distance from the light source to the point P, k/i represents the energy emitted by light source, and h is the angle between the incoming direction xi and the microfacet normal [6]. Here Monte Carlo method is used to solve the above integral formula, which is demonstrated to be the only practical numerical integration algorithm, and the required number of samples is completely independent of the dimensionality of the integral [6].

R2

ð15Þ

324

F.-k. Wu, C.-w. Zheng / Graphical Models 75 (2013) 318–327

5. Experimental results and analysis We implemented our method for rendering wave effects by creating a new material plugin for PBRT [6]. All of the images in this work were produced on a Dell T7600 workstation with a dual quad-core Intel Xeon CPU E5-2609 running at 2.40 GHz and a NVIDIA Quadro 6000. The wavelength in the experiment ranges from 350 nm to 730 nm corresponding to the visible spectrum. For the sake of accuracy and efficiency, we defined 12 Monte-Carlo samples per pixel with a uniform sampling distribution, the angle of the viewing field in the camera as 60° and the max recursive depth as 5. In Fig. 9, our method can be used to render the diffraction and interference patterns of compact discs under different illumination. Here, we use the Ashikhmin anisotropic shader instead of a simple Ward shader [34] in the WBSDF. Fig. 10a and c show the renderings using the Torrance-Sparrow microfacet model which adopts Blinn isotropic function [8] and Ashikhmin anisotropic function [28] respectively. For comparisons, we also set our wave model with the same parameters for simulating isotropic and anisotropic reflection phenomena respectively. The results in Fig. 10b and d demonstrate that our proposed model can effectively render wave effects compared with the Torrance-Sparrow microfacet model which cannot explain phase variations of light.

Fig. 11 shows the diffraction patterns of other scenes generated by our approach in the ray-based framework, where the parameters can be easily adjusted as needed. Fig. 11a–c show a case, where the full spectrum is sampled to simulate the wave effects, whereas Fig. 11d–f show the rendered results of sampling a part of spectrum under different lighting conditions and anisotropic parameters. The car model in Fig. 11g is rendered with a glare effect which is pre-computed as a static texture. In addition, Table 1 summarizes the statistics of rendering diffraction effects from a variety of apertures using our GPU acceleration algorithm.

5.1. Comparison with Torrance–Sparrow As one of the first microfacet models for metallic surfaces, the Torrance–Sparrow reflection model is often used to model geometrical optics phenomena corresponding to Fig. 10a and c, where Blinn isotropic function and Ashikhmin anisotropic function are adopted respectively. It takes into account the geometrical attenuation, absorption and scattering of light, but is not applicable for wave rendering due to ignoring the phase information. In contrast, our wave model can encapsulate the phase variations of rays to model diffraction phenomena in a ray tracer as illustrated in Fig. 10b and d.

Fig. 8. Diffraction patterns of apertures with different shapes rendered using the GPU acceleration algorithm where the upper right or down right corner of each image denotes the pre-computed aperture texture.

Fig. 9. Renderings using our wave model that represent (left) the interference after a single bounce and (right) the direct diffraction from the compact disc.

F.-k. Wu, C.-w. Zheng / Graphical Models 75 (2013) 318–327

325

Fig. 10. (a and b) Comparison of renderings of Blinn isotropic model (left) and our wave model (right) under the same illumination. (c and d) Comparison of renderings of Ashikhmin anisotropic model (left) and our wave model (right) under the same illumination.

5.2. Comparison with diffraction shaders As one of the first wave models, DS can render diffraction effects in the far field efficiently. We propose a simple extension based on DS, where the Fresnel factor dependent on the wavelength and a scattering metric are introduced. This new approach can instantaneously model diffraction effects of a variety of materials by directly encapsulating the amplitude and phase variations into reflected rays. In addition, the WDF is incorporated to further extend the application scope of DS to model interference phenomena after multiple bounces (see Fig. 7). Our proposed GPUbased acceleration algorithm can also obtain real-time renderings as showed in Fig. 8. At the same time, this paper mainly involves the wave rendering from the anisotropic microfacets, which is the same as DS. 6. Conclusion and future work This paper has presented a novel approach to model wave effects by taking into consideration the amplitude and phase variations of light in a physical-based framework. The Fresnel coefficient and a microfacet scattering metric are introduced to improve the realism and flexibility of our model for rendering diffraction effects from a

variety of materials. As another extension, the WDF is incorporated into our model to simulate interference effects after multiple bounces by indirectly encapsulating phase variations into reflected rays. In addition, we also implement an acceleration algorithm using the CUDA to render wave effects of apertures in real time for sake of efficiency. However, there still exist some promising topics for future, such as handling the polarized effects of light and improving the computational efficiency of ray tracing, where a GPU-based rendering engine may play a key role. The Kirchhoff approximations and Wigner distribution function are considered to be effective at small angles of diffraction. It is desirable to develop some approximate methods that are applicable for wide angles of diffraction, which provides a new direction for the photo-realistic rendering [1,18]. Another noteworthy topic is to incorporate wave effects from the underlying surface into the total rendered results for layered objects. Acknowledgments We sincerely acknowledge Jiaze Wu and Xiaodan Liu for discussions and the anonymous reviewers for their valuable comments. We also thank Yuan Liu for providing the

326

F.-k. Wu, C.-w. Zheng / Graphical Models 75 (2013) 318–327 Table 1 Rendering statistics for our diffraction apertures with the resolutions denoted by the Size column. The rendering efficiency is distinctly improved using the GPU than using the CPU, and becomes higher with the increase of the computational complexity. Apertures

Size

CPU (ms)

GPU (ms)

Pentagon Hexagon Star Circle

512  512 512  512 1024  1024 1024  1024

495 513 2033 2074

27.6 31.9 54.1 58

References

Fig. 11. Renderings of a variety of scenes using our diffraction model. Note all the experiments can be adjusted with flexible parameters.

guidance related to the GPU programming. A part of disk scenes are provided by Cuypers et al. [21]. This work was funded by National High Technology Research and Development Program of China (2009AA01Z303).

[1] O. Ersoy, Diffraction Fourier Optics and Imaging, Wiley, New York, 2007. [2] J. Stam, Diffraction shaders, in: Proc. of SIGGRAPH ’99, 1999, pp. 101–110. [3] Y. Sun, F. Fracchia, M. Drew, T. Calvert, Rendering iridescent colors of optical disks, in: EGWR, 2000, pp. 341–352. [4] C. Lindsay, E. Agu, Physically-based real-time diffraction using spherical harmonics, in: Advances in Visual Computing, 2006, pp. 505–517. [5] K. Torrance, E.M. Sparrow, Theory of off-specular reflection from roughened surfaces, Journal of the Optical Society of America 57 (9) (1967) 1105–1112. [6] M. Pharr, G. Humphreys, Physically Based Rendering: From Theory to Implementation, 2nd ed., Morgan Kaufmann, San Francisco, 2010. [7] NVIDIA, NVIDIA CUDA C Programming Guide, fourth ed., NVIDIA Corporation, 2011. [8] J. Blinn, Models of light reflection for computer synthesized pictures, in: Proc. of SIGGRAPH ’77, 1977, pp. 192–198. [9] R. Cook, K. Torrance, A reflectance model for computer graphics, ACM Transaction on Graphics 1 (1) (1982) 7–24. [10] B. Phong, Illumination for computer generated pictures, Communications of the ACM 18 (6) (1975) 311–317. [11] M. Oren, S. Nayar, Generalization of lambert’s reflectance model, in: Proc. of SIGGRAPH ’94, vol. 28, 1994, pp. 239–246. [12] X. Granier, W. Heidrich, A simple layered RGB BRDF model, Graphical Models 65 (4) (2003) 171–184. [13] P. Beckmann, A. Spizzichino, The Scattering of Electromagnetic Waves from Rough Surfaces, Macmillan, New York, 1963. [14] H. Moravec, 3D graphics and the wave theory, in: Proc. of SIGGRAPH ’81, 1981, pp. 289–296. [15] J. Kajiya, The rendering equations, in: Proc. of SIGGRAPH ’86, vol. 20, 1986, pp. 143–150. [16] X. He, K. Torrance, F. Sillion, D. Greenberg, A comprehensive physical model for light reflection, in: Proc. of SIGGRAPH ’91, 1991, pp. 175– 186. [17] S. Nayar, K. Ikeuchi, T. Kanade, Surface reflection:physical and geometrical perspectives, IEEE Transactions on Pattern Analysis and Machine Intelligence 13 (7) (1991) 611–634. [18] M. Alonso, Wigner functions for nonparaxial arbitrarily polarized electromagnetic wave fields in free space, Journal of Optical Society of America A 21 (11) (2004) 2233–2243. [19] M. Alonso, Diffraction of paraxial partially coherent fields by planar obstacles in the Wigner representation, Journal of Optical Society of America A 26 (7) (2009) 1588–1597. [20] S. Oh, S. Kashyap, R. Garg, S. Chandran, R. Raskar, Rendering wave effects with augmented light fields, Computer Graphics Forum 29 (2) (2010) 507–516. [21] T. Cuypers, T. Haber, P. Bekaert, S. Oh, R. Raskar, Reflectance model for diffraction, ACM Transactions on Graphics 31 (5) (2012). [22] N. Tsingos, T. Funkhouser, A. Ngan, I. Carlbom, Modeling acoustics in virtual environments using the uniform theory of diffraction, in: Proc. of SIGGRAPH ’01, 2001, pp. 545–552. [23] R. Torres, U. Svensson, M. Kleiner, Computation of edge diffraction for more accurate room acoustics auralization, Acoustical Society of America Journal 109 (2) (2001) 600–610. [24] M. Hullin, E. Eisemann, H. Seidel, S. Lee, Physically-based real-time lens flare rendering, ACM Transactions on Graphics 30 (4) (2011). [25] D. Greenberg, K. Torrance, P. Shirley, J. Arvo, E. Lafortune, J. A. Ferwerda, B. Walter, B. Trumbore, S. Pattanaik, S.-C. Foo, A framework for realistic image synthesis, in: Proc. of SIGGRAPH ’97, 1997, pp. 477–494.

F.-k. Wu, C.-w. Zheng / Graphical Models 75 (2013) 318–327 [26] H. Gouraud, Continuous shading of curved surfaces, IEEE Transaction on Computer C-20 (16) (1971) 623–629. [27] E. Lafortune, Y. Willems, Using the Modified PHONG BRDF for Physically Based Rendering, Technical report CW197, Dept. Comp. Sci., KU Leuven, 1994. [28] M. Ashikhmin, P. Shirley, An anisotropic PHONG BRDF model, Journal of Graphics Tools 5 (2) (2000) 25–32. [29] B. Ginneken, M. Stavridi, J. Koenderink, Diffuse and specular reflectance from rough surfaces, Applied Optics 37 (1) (1998) 130– 139. [30] T. Cuypers, R. Horstmeyer, S. Oh, P. Bekaert, R. Raskar, Validity of Wigner distribution function for ray-based imaging, in: Proc. of IEEE

[31]

[32]

[33] [34]

327

International Conference on Computational Photography, 2011, pp. 1–9. M. Bastiaans, Wigner distribution in optics, in: M. Testorf, B. Hennelly, ~ eda, (Eds.), Phase-Space Optics: Fundamenals and J. Ojeda-Castan Applications, McGraw-Hill, New York, 2009, pp. 1-44. Z. Zhang, M. Levoy, Wigner distributions and how they relate to the light field, in: Proc. of IEEE International Conference on Computational Photography, 2009, pp. 1–10. J. Goodman, Introduction to Fourier Optics, 3rd ed., Roberts & Co., Englewood, Colo, 2005. G. Ward, Measuring and modeling anisotropic reflection, in: Proc. of SIGGRAPH ’92, 1992, pp. 265–272.