Reconstruction

Simon Premoze



 

Making nice images

Let's pretend that all we want is to make some nice images that are computed quickly and include global illumination effects. We want to find a good way of combining radiosity solution with deterministic raytracer (we don't want to be physically correct here, so we don't want to use Monte Carlo path tracer).

We need to find a good way to combine effects of radiosity and raytracing methods. Two methods capture different sets of optical and illumination phenomena. Raytracing (in this context, raytracing and/or raytracer refers to Cook style distribution raytracer) supports depth-of-field, motion blur, reflections, refraction, but it is very poor at computing interreflection. On the other hand, radiosity computes diffuse interreflection, color bleeding and soft shadows in view independent manners.

Naive and simplified global illumination (which is completely wrong) can be written in the following way:

    Output color = Ka * ambientLight()  + Kd * diffuseLight() + Ks * specularLight()

where black box functions ambientLight(), diffuseLight() and specularLight() compute appropriate components at point P.

After we computed radiosity solution for a particular scene, the stored radiosity contains ambient and fiffuse components of the above equation. The most straightforward way would be to simply do a lookup in radiosity solution in addition to compute specular component in order to account for refractions and reflections. This approach, although simple, is not very good way of doing things. It suffers from meshing artefacts such as shadow leaking, light leaking, etc. We need to compensate for these problems.
We need to recalculate the direct lighting from the light sources at every sample location. In this way, we can capture high frequency illumination details and allow correct bump mapping. This technique does not eliminate all artefacts due to the meshing, but it makes these artefacts more tolerable.

When a patch emits lights, the total emitted energy is the sum of the direct and indirect components. After the first pass is done (radiosity pass), we throw out the direct illumination, and savve only indirect component. On the second pass, we recompute the direct illumination using standard raycasting method.
The same equation is used as before with one major modification. ambientLight() now returns the indirect component that was computed in first pass (we throw away the direct component computed in this pass) while diffuseLight() recomputes the direct illumination. If we used the direct component from the first pass, we would need to interpolate it across the mesh elements which are much bigger than pixel size.

Raytraced Cornell Box with 16 samples per pixel and 4 shadow rays
Note that only direct lighting is computed
Two pass rendering of Cornell Box
80% of energy was distributed in radiosity pass
Renderd with 16 samples per pixel and 4 shadow rays
Radiosity pass took 18 seconds
 

This method works well. It is fast, because nothing is recomputed on the second pass, but direct illumination and specular effects (reflections, refractions, etc.). It provides a good way of incorporating global illumination into standard deterministic raytracer with only slight increase in computation time. However, memory requirements are high for realistic scenes, because finite elements from the radiosity pass need to be stored in memory during rendering.

This method is obviously a hack to make nice images, so there is nothing really deep about it.
 
 

Yet Another Reconstruction

If the first reconstruction method was merely a hack, I tried another two-pass method.Radiosity solution is computed on the first pass. During the rendering pass the rendering equation is evaluated using Monte Carlo path tracer. Paths are limited to one bounce only. Rays are traced from the eye through each pixel into the scene. From the intersection point, one ray is traced to a random point on a light source. In addition, another ray is traced in a random direction chosen with a probability density function proportional to: a) cosine of the angle between the normal and direction, b) Bidirectional reflectance distribution function (BRDF). The radiance at intersection of this secondary ray is obtained from the radiosity solution from the first pass. If secondary ray hits a light source, it does not contribute to the image, because it has already been accounted for in the primary ray. This is the method first described by Rushmeier. This method has a disadvantage of missing important source of illumination. Also, since we are using Monte Carlo path tracer, images are rather noisy.
 
 
Cornell Box with glossy surfaces
 
 
Bathroom
9 samples per pixel, 9 shadow rays
 
 
Bathroom, 9 samples per pixel
 
Office
 
Mark Reichert described another method where, the radiosity at each pixel is computed by recomputing all form factors to every element in the radiosity mesh. This is rather wasteful, because contribution from every element is computed regardless of the variance it contributes to each pixel. On the other hand, this method never misses an important source of illumination. Reichart notes that certain errors can be observed in final images. For example, constant elements can cause shading artefacts for receivers that are close. Also, form factor evaluation can introduce new errors into the image. Monte Carlo method of computing the form factors might be preferable, because it will introduce only noise which is less objectionable than some other errors (coherent errors - visible patterns, etc.). Although, this method produces images of high quality, it is way to slow to use in practice.
Cornell Box with glossy walls
 

References

1. Reichert, M. A two-pass radiosity method driven by lights and viewer position. MS Thesis. Cornell University, 1992
2. Rushmeier, H. Realistic Image Synthesis for Scenes with Radiatively Participating Media. PhD Thesis. Cornell University, 1988
3. Shirley, P. Physicall Based Lighting Calculations for Computer Graphics. PhD Thesis. University of Illinois at Urbana-Champaign, 1990

Simon Premoze

premoze@cs.utah.edu