A First Order Analysis of Lighting, Shading, and Shadows


Ravi Ramamoorthi Columbia University
Dhruv Mahajan
Peter Belhumeur

Abstract

The shading in a scene depends on a combination of many factors---how the lighting varies spatially across a surface, how it varies along different directions, the geometric curvature and reflectance properties of objects, and the locations of soft shadows. In this paper, we conduct a complete first order or gradient analysis of lighting, shading and shadows, showing how each factor separately contributes to scene appearance, and when it is important. Gradients are well suited for analyzing the intricate combination of appearance effects, since each gradient term corresponds directly to variation in a specific factor. First, we show how the spatial and directional gradients of the light field change, as light interacts with curved objects. Second, we consider the individual terms responsible for shading gradients, such as lighting variation, convolution with the surface BRDF, and the object's curvature. This analysis indicates the relative importance of various terms, and shows precisely how they combine in shading. As one practical application, our theoretical framework can be used to adaptively sample images in high-gradient regions for efficient rendering. Third, we understand the effects of soft shadows, computing accurate visibility gradients. We generalize previous work to arbitrary curved occluders, and develop a local framework that is easy to integrate with conventional ray-tracing methods. Our visibility gradients can be directly used in practical gradient interpolation methods for efficient rendering.


Background

This paper starts a new direction in reflection analysis. So far, mathematical analysis has focused on frequency domain and spherical harmonic techniques. Wavelet-based approaches have also gained prominence, but more for practical computation rather than analytic formulae. While there has been some previous work on perturbation-based methods, those approaches have not so far considered a complete light field analysis. We believe this paper unifies and extends much of the previous theory in rendering, developing a complete first order or gradient analysis of reflection.


Results

Light reflection from Curved Surfaces

We are able to study the full process of light reflection from curved surfaces, showing how the spatio-angular variation in the light field transforms as a result of the basic shading steps. We are also able to extend the analysis to normal or bump maps.

Analysis of First Order Terms

We combine the analysis of the different gradient terms in a unified formula which controls the relative importance of spatial variation, angular variation and surface curvature. We analyze the effects of these terms in a variety of situations, and also consider an extension to second-order Hessians. A practical application is efficient image sampling based on gradient magnitude.

Analysis of Visibility Gradients

We derive new analytic expressions for soft shadow gradients, that for the first time consider the effects of general curved or polygonal blockers. Our formulation is completely local, based only on the angular visibility discontinuities at a single spatial location. It can be used directly for gradient-based interpolation.

Paper

Paper can be downloaded.

This paper will appear in the January 2007 issue of the ACM Transactions on Graphics

Figure 1. Transformation of the light field, and its spatial and angular gradients as a result of various steps of light reflection, including rotation to the local coordinate frame, mirror reparameterization and shading with a glossy BRDF.
Figure 2. Unified gradient formula for surface reflection considering spatial and directional lighting variation, and geometric curvature. The image below that shows relative importance of different terms (spatial variation vs curvature and directional variation) as the light source moves further away.
Figure 3. Application to gradient-based image sampling, where we accurate obtain the exact image using only one-sixth of the image samples, by placing more emphasis on high-gradient regions like the bumpy sphere.

Figure 4. Applications of our analytic gradient formula to interpolation of penumbra regions from curved blockers. In this example, we recreate the soft shadows using only 1% of the image samples.