• 沒有找到結果。

Rendering of Light Scattering Effects

3.2 Analytic Methods

Analytic methods significantly improve the performance for rendering of scenes with par-ticipating media. Their major drawback lies in the increased number of assumptions and simplifications made for the sake of performance.

3.2.1 Effects for Point Light Sources

Assuming point light sources simplifies computation but can be effective for scenes in which the source is inside the participating medium, creating effects of glows around light sources.

Complex effects such as multiple scattering for glows and scattering effects on surface radi-ance can be realized.

Multiple Scattering

The work of [Narasimhan and Nayar, 2003] modeled multiple scattering from an isotropic point light source using an analytic expression termed the atmospheric point spread function.

Assumptions include homogeneous media, infinite extent, and distant light sources. There-fore, it neglects effects on surface radiance. Using an expansion of the Henyey-Greenstein phase function as a series Legendre polynomials, a series solution to the integral transport

equation (Equation 2.16) is derived, assuming homogeneous media and distant point light sources. The work shows that the shape of the point spread function largely depends on the atmospheric conditions, the source intensity, and the depth of the source. An analysis of glows under different weather conditions is described, including rendered images.

Volumetric Shadows

In [Biri et al., 2006], the authors developed an analytic expression for the single scattering integral for point light sources in a homogeneous medium using a polynomial approxima-tion that can be implemented on graphics hardware. The polynomial approximaapproxima-tion is obtained by first using an angular reformation of the single scattering integral for point light sources [Lecocq et al., 2000], which is described in a later chapter (Equation 4.3).

Then the integral is approximated as a polynomial of a single angle with degree four. The constants of the polynomial are determined by the type of scattering chosen. Unfortunately, inaccurate glows appear when the viewer is near the source. Also, no effects on surface radi-ance are considered. An algorithm for incorporating volumetric shadows is also introduced.

The basic concept is that the scattering contribution of non-shadowed regions may be ren-dered by subtracting the contribution of shadowed regions, whose equivalent is rendering the shadow volume using an analytic scattering contribution. There is an exception–shadow polygons which are themselves in shadow should not be rendered. The algorithm essentially constructs a standard shadow volume, sorts shadow polygons according to their estimated depths, and then renders the shadow polygons using a positive scattering contribution for back-facing shadow polygons and a negative scattering contribution for front-facing shadow polygons. Limitations occur when the estimated depths of large polygons have errors.

Scattering Effects on Surface Shading and Environment Map Lighting

The work of [Sun et al., 2005] developed a real-time analytic single scattering model for point light sources that can render visual effects on surface shading and handle complex environment map lighting using programmable graphics hardware. Significant effects such as glows around light sources, spreading of specular highlight on objects, and brightening of shadows were realized in real-time fog scenes. The effects of anisotropic scattering, though

considered in the model, were not demonstrated. The inclusion of anisotropic scattering in the model induces a loss in both performance and accuracy.

Visual results of glows and scattering effects on surface shading were realized in real-time, a difficult task due to the complexity of volumetric scattering for all surface points. Analytic evaluation of the single scattering integral for point light sources

[Nishita et al., 1987] was made possible by changing the variables of integration and deriving a form that could be largely precomputed into a table. Complex integrals are expressed as 2D functions that can be precomputed into tables and placed in texture memory. The functions then can be accurately evaluated at run-time using texture lookups with linear interpolation. With this technique, an analytic model for scattering contribution to surface radiance is developed, under the assumption that no objects are in the path of scattered light.

Complex brdf and environment map lighting under foggy conditions is also pre-sented, enabling environment maps to include effects of glows around light sources as well as enabling precomputed radiance transfer methods to incorporate scattering effects. By fit-ting empirical data, the work develops an analytic point spread function of a single angular parameter that can be convolved with an environment map to produce a new environ-ment map which exhibits glows around light sources. This technique can be applied on the environment lighting used in precomputed radiance transfer methods as well.

3.2.2 Sky and Terrain Rendering

The rendering of scenes with both sky and terrain requires models for sky and aerial per-spective. Sky models only describe the illumination of skylight, whereas aerial perspec-tive models describe the in-scattering of skylight and out-scattering that occurs before it reaches the viewer. Consequently, aerial perspective models must consider the position of the viewer and usually requires larger amounts of computation. Significantly more effi-cient and practical than their numerically-simulated counterparts, complex analytic models that fit measured atmospheric data have been developed that exhibit angular dependent and multiple scattering effects [Preetham et al., 1999, Riley et al., 2004]. The utilization of graphics hardware is used in some cases; however, these methods are still far from

interac-tive.

The work of [Hoffman and Preetham, 2003] can render skies using programmable graphics hardware in the vertex or fragment shader in real-time. A simple, analytic form for scattering from a directional light source is made possible when a constant density atmosphere is assumed, thus assuming constant scattering as well. Under this assumption, the scattering coefficient can be expressed as Rayleigh and Mie scattering constants with dependence on wavelength. The result for atmospheric scattering is the lighting equation:

L(s, θ) = L0e−(κs,Rs,M)s+κs,RpR(θ) + κs,MpM(θ)

κs,R+ κs,M Esun(1 − e−(κs,Rs,M)), (3.4) where κs,R and κs,M are the Rayleigh and Mie scattering coefficients, respectively. pR(θ) and pM(θ) are the Rayleigh and Mie phase functions, respectively(Equations 2.2 and 4.1).

The scattering coefficient(κs) is split into the sum of its parts (κs= κs,Rs,M). Rendering a sky thus equates to rendering a tessellated sky dome with implementation of Equation 3.4 in the vertex or fragment shader.

Chapter 4

相關文件