• 沒有找到結果。

Analytic Lighting Model

Accurate and Dynamic Anisotropic Scattering

4.2 Analytic Lighting Model

In this section, we develop analytic models to compute airlight La, which is responsible for glows around light sources, in Section 4.2.1 and surface radiance Lp, which is affected by airlight from source to surfaces, in Section 4.2.2. Lastly, a summary of the analytic lighting model is provided in Section 4.2.3

4.2.1 Angle-Formulated Airlight Model

The contribution of airlight depicted as path b in Figure 4.1 is given by the classic integral along the viewing direction for single-scattered airlight from an isotropic point light source [Nishita et al., 1987], which is expressed in terms of the distance along the ray. To reduce the number of physical parameters in the integral, we introduce the angle reformulation of the single scattering integral for airlight from a point light source [Lecocq et al., 2000]:

La(γ, dsv, dvp, κt) = κtI0e−κtt

Table 4.1: Notation and formulae for angle-formulated airlight integral.

θ angle between source emissive direction and perpendicular bisector to the viewing direction γ angle between view ray and source

dsv distance between source and viewpoint

dvp distance between viewpoint and surface point dsp distance between source and surface point

t t = dsvcos γ h h = dsvsin γ θ0 θ0= γ − π2

θd θd = arctan |(dvp− t)/h|

I0 point light source intensity

dsv

v γ

θd

p t

s

θ h θ0

Figure 4.2: Diagram for angular reformulation of the airlight integral.

The integral is expressed in terms of the angle θ between the light source emissive direction and the perpendicular bisector to the viewing direction with respect to s, as depicted in Figure 4.2. θd and θ0 are the bounds of integration. See [Biri et al., 2006] for a derivation of the angle reformulation. Refer to Table 4.1 for the rest of the notation. We refer to Equation 4.3 in the remainder of the paper as the angle-formulated airlight integral.

Analytic solution to Airlight La

To solve Equation 4.3, it is factorized into an analytic expression dependent on the physical parameters of the scene and a tabulated function independent of the physical parameters.

Let

The angle-formulated airlight integral now is factorized into an analytic expression C0 and an integral that may be expressed as a function of two variables. The result for an analytic solution to Equation 4.3 is

As a function independent of the physical parameters of the scene, H(u, v) can be nu-merically integrated during the precomputation stage into a table and stored into texture memory. The plot of H(u, v) in the isotropic scattering case p(θ) = 1 is shown in Fig-ure 4.3, demonstrating that the function is smooth. Thus, the tabulated function H(u, v) in texture memory can be accessed during run-time using linear interpolation for evaluation of the integral. It is worth mentioning that any phase function p(θ) may be used in our lighting model without significantly affecting run-time performance or accuracy, thus mak-ing it general for any type of anisotropic scattermak-ing. Airlight from a point source may be computed with just evaluation of analytic functions and two texture lookups in the vertex or fragment shader using programmable graphics hardware. The choice of p(θ) does not affect run-time performance since H(u, v) is constructed in a precomputation stage. The special case of no objects along the view ray (dvp = ∞, θd = π2) is important for the next

−1 −1.5 1/(4π). The graph demonstrates that the function is smooth, thus making it appropriate for tabulation during precomputation and look-up during run-time.

subsection. In such a case, the airlight is

La(γ, dsp, ∞, κt) = C0[H(C1

2) − H(C1, θ0)]. (4.8) 4.2.2 Surface Radiance Model using Angle Formulation

Reflected radiance Lp is the sum of contribution from direct transmission Lp,d (path a in Figure 4.1) and contribution from airlight Lp,a (path c in Figure 4.1), which is given by the surface radiance single scattering integral [Sun et al., 2005]. This is written as

Lp = Lp,d+ Lp,a, (4.9)

γ0

Figure 4.4: Diagram for light paths of direct transmission and airlight to surface point that contribute to surface radiance Lp.

The surface radiance single scattering integral sums airlight contribution to surface radiance over the surface point’s hemisphere of incident directions. The angle γ0 is the angle between the source direction (θs, φs) and incident direction (θi, φi), such that h0 = dspsin γ0 and t0 = dspcos γ0. Refer to Figure 4.4 for a depiction of the these variables. To simplify the integral for evaluation, the airlight term La in Equation 4.11 assumes no object obstructs each incident direction(dvp= ∞,θd= π2).

Analytic solution to Surface Radiance Lp

We solve Lp for both the Lambertian BRDF and Phong BRDF separately. For the Lam-bertian case, BRDFLam= kd, where kdis the diffuse constant of the object. For the Phong case, all angles of Equation 4.9 are reparameterized against the reflection of the view ray about the surface normal [Ramamoorthi and Hanrahan, 2002] to reduce the complexity of the integral. We denote the reparameterizated source direction θs0. After reparameteriza-tion, BRDFP hong = kscosnθ0i, where ksis the specular constant of the object. The resultant solution for Lp,d is straightforward:

Lp,d = I0e−κtdsp

dsp2 (kdcos θs+ kscosnθs0). (4.12) To solve Lp,a, we make the substitution Tsp= κtdsp and use our analytic model for airlight La, Equation 4.8. Other substitutions and simplifications are made, allowing us to

re-express the integral portion as a function of two parameters. The details of this derivation for the solution to Lp,a are shown below:

Lambertian BRDF case:

3. Take constants out of integral.

= I0kdκt

Phong BRDF case:

Lp,a= Z

La0, dsp, ∞, κt)BRDF (θi, φi, θv, φv) cos θii

1. Let R be the reflection of the view ray about the surface normal.

2. Reparameterize the integral about R.

3. Denote reparameterized source direction θs0[s.t. γ0s0, ωi) and θ00s0, ωi)].

6. Take constants out of integral.

= I0ksκt

The resultant solution for Lp,ais Lp,a= I0κt

dsp [kdJ1(Tsp, θs) + ksJn(Tsp, θ0s)], (4.15) Both J1(Tsp, θs) and Jn(Tsp, θ0s) can be numerically integrated, tabulated, and stored into texture memory during a precomputation stage, where n denotes the Phong exponent.

Consequently, each of these functions can be evaluated with a texture lookup using linear interpolation during run-time. Plots of J1 and Jn (n = 20) are shown in Figure 4.5, demonstrating that they are smooth.

0.5 0 θs ∈ [0, π/2]. The graphs demonstrate that the functions are smooth, thus making them appropriate for tabulation and look-up during run-time.

4.2.3 Summary of Analytic Lighting Model

In this section, a full analytic solution to lighting equation 4.2 is developed. The model can capture visual effects for glows around light sources and on surface radiance. Additionally, it may consider any anisotropic scattering distribution described by a phase function of one parameter under the assumption of single scattering. The complexity of the phase function has no effect on run-time performance whatsoever, since its computation is isolated to a precomputation stage. An illustrative summary of the analytic lighting model presented thus far is shown in Figure 4.6.

The choice of phase function p(θ) greatly affects the visual appearance of partici-pating media, since it indicates different scattering conditions. The lighting model discussed up to this point requires the phase function p(θ) to be predetermined, as is common in many scattering models. Without instant visual feedback, it is often cumbersome to manipulate p(θ) to achieve desirable visual results. Furthermore, only a pre-determined, limited num-ber of scattering environments are possible for interactive applications with this restriction.

In the next section, we develop an extension to our lighting model, allowing the user to change the level of forward scattering in real-time.

viewpoint

source

Lp

surface point

*glows

*blurring of surface radiance

*brightening of dark regions

La Lighting Model

*visual effects L = e−κtdvpLp+ La

Lp= Lp,d+I0dkspdκt[J1(Tsp, θs) + J20(Tsp, θs0)]

La= C0[H(C1, θd) − H(C1, θ0)]

Figure 4.6: Illustrative summary of analytic lighting model in Section 4.2. L is implemented in the vertex or fragment shader using programmable graphics hardware. Each evaluation of function H, J1, or J20 costs a single texture lookup.

相關文件