Rama physically-based lighting
Indirect lighting on diffuse surfaces

1 Introduction

In this section we want to compute the light which goes from the Rama light sources into the camera via exactly two bounces, first on a diffuse surface or in the atmosphere, and then on a diffuse surface. This is equal to the light that bounces off from the last diffuse surface, times the transmittance of the atmosphere between this surface and the camera. This transmittance has been computed in a previous section so we only compute the first term here, i.e. how much light from the light sources is reflected after the second bounce on a diffuse surface.

2 Model

From the BRDF definition, the light reflected after the second bounce, supposed here to happen on a perfectly diffuse surface patch centered at $\bp$, of normal $\bn$ and albedo $\alpha$ is equal to \begin{equation} L_{L(D|V)D}(\bp,\bn)=\int_{\Omega^+}\color{red}{L_i}\color{green}{\mathrm{f_r}}\color{blue}{\cos\theta_i}\diff\omega_i=\color{green}{\frac{\alpha}{\pi}}\int_{\Omega^+}\color{red}{L_{L(D|V)E}(\bp,\bw)}\color{blue}{\bn\cdot\bw}\,\diff \omega \end{equation} where $L_{L(D|V)E}(\bp,\bw)$ is the direct light arriving at $\bp$ from direction $\bw$ after exactly one bounce on a diffuse surface or on the atmosphere. Noting $\br(\bp,\bw)$ the point on Rama's surface which is visible from $\bp$ in direction $\bw$ (i.e. the nearest intersection of the ray of origin $\bp$ and direction $\bw$ with the surface), $L_{L(D|V)E}(\bp,\bw)$ can be rewritten as: \begin{equation} L_{L(D|V)E}(\bp,\bw)=\mathfrak{t}(\bp,\br(\bp,\bw))L_{LD}(\br(\bp,\bw))+L_{LVE}(\bp,\br(\bp,\bw)) \end{equation} where $L_{LD}$ and $L_{LVE}$ are the functions that we computed in the Diffuse surfaces and Atmospheric scattering sections, respectively. Thus, we finally get: \begin{equation} L_{L(D|V)D}(\bp,\bn)=\frac{\alpha}{\pi}\int_{\Omega^+}\left[\mathfrak{t}(\bp,\br(\bp,\bw))L_{LD}(\br(\bp,\bw))+L_{LVE}(\bp,\br(\bp,\bw))\right]\bn\cdot\bw\,\diff \omega \end{equation}

From the definitions of $L_{LD}$ and $L_{LVE}$, it is easy to see that this expression involves double and triple integrals, as well as ray tracing functions to compute $\br(\bp,\bw)$. It would thus be really hard to compute this in real time. Hopefully the light sources in Rama are static so we can precompute $L_{L(D|V)D}$ in a lightmap. Also we already showed how to precompute $L_{LD}$ in a lightmap, and how to compute $L_{LVE}$ with a simple integral using a precomputed volumetric lightmap. Using these precomputed maps, precomputing the lightmap for the indirect lighting on diffuse surfaces, $L_{L(D|V)D}$, "reduces" to the computation of a single and double integral per texel (still with ray-tracing).

3 Implementation

In our implementation we precompute $L_{L(D|V)D}$ in a $2304\times 2304$ lightmap, using, for each texel, $256$ samples for the directions $\bw$ and, for each direction, $30$ samples to compute the inscattered light $L_{LVE}$ from the volumetric lightmap. Once $L_{L(D|V)D}$ is stored in the lightmap, we can simply render the Rama model textured with it, times the transmittance between the camera and the surface patches, to get the indirect lighting on diffuse surfaces (in practice we store the sum of the direct and indirect light maps in a texture, allowing us to render both with a single texture fetch per pixel).

We validate our implementation by measuring the average value of the indirect lighting. Without atmosphere we expect it to be near the average direct lighting times the average albedo (we don't expect a strict equality since, in general, the average of a product is not equal to the product of the averages). Our measurements, without atmosphere, give an average indirect radiance equal to $(0.46,0.63,0.37)\,W.m^{-2}$, while the average albedo is $(0.1026,0.1206,0.0969)$, the average direct radiance is $(4.18,5.02,3.73)\,W.m^{-2}$, and their product is $(0.43,0.60,0.36)\,W.m^{-2}$.

4 Results

Here are the results with a single linear light source, compared with direct lighting (using the same exposure in both cases):


Figure 1: Direct lighting on diffuse surfaces, for a single light source. Indirect lighting on diffuse surfaces, for a single light source.

With the 6 linear light sources (and a smaller exposure) we get the following:



Figure 2: Direct lighting on diffuse surfaces. Indirect lighting on diffuse surfaces.