Rendering with Natural Light Source Files

This directory contains the original scene files for Paul Debevec's animation "Rendering with Natural Light" shown at the SIGGRAPH 1998 Electronic Theater in Orlando, Florida.       Angular map equation for mapping light probe to the environment
anim.vf          Animation camera path viewfile
credits.tif      RNL credits card TIF image       Sphere support stand generator script      Central sphere support stand generator script
marble.hdr       Texture map for the pedestal
optrad           RADIANCE options for rendering the animation
pflare.c         C program for pflare, the HDR image blurring program
pflare           Intel Linux binary for pflare, the HDR image blurring program
rnl_probe.hdr    UC Berkeley Eucalyptus Grove light probe image
rnl_scene.rad    Main scene file for the spheres on the pedestal      Texture map equation for mapping marble.hdr onto pedestal

rnl_source.tgz gzip'ped tar archive of all these files (2,721,019 bytes)
"Rendering with Natural Light" was rendered entirely with Image-Based Lighting captured through High-Dynamic Range Photography in the UC Berkeley Eucalyptus Grove.

To render the animation yourself, follow the following procedure:

  1. Copy the files in this directory to a UNIX machine (Linux, IRIX...)

  2. Install Greg Ward's "RADIANCE" lighting simulation package from:

  3. View the Light Probe Image to test that Radiance is installed: type
    % ximage rnl_probe.hdr
    (Note: the "%" signifies the csh shell prompt; don't type it.)

    An image display window showing the RNL environment should come up if RADIANCE is working. Hit q in the window when you're done.

  4. Create an octree scene file by typing:

    % oconv rnl_scene.rad > rnl_scene.oct
  5. Render the scene in the interactive renderer:
    % rview -vf anim.vf rnl_scene.oct

    After a moment, you should obtain a window with a somewhat dark rendering of the RNL scene (a collection of spheres on stands on a pedestal amongst trees.) When you're done, type q and then return in the window to quit. The file "anim.vf" contains all the camera views for the RNL animation. The interative renderer simply uses the last view in the file.

  6. Render the scene in the interactive renderer with global illumination:
    % rview -vf anim.vf -ab 1 -aa 0 -ad 256 rnl_scene.oct

    This sets one ambient bounce with -ab 1, disables irradiance cacheing with -aa 0, and specified 256 ambient divisions (rays that fire out looking for light) per pixel. This rendering will take a while to complete. You can stop it at any time with q .

  7. Render the scene in the offline renderer with global illumination:
    % rpict -vf anim.vf @optrad rnl_scene.oct > render.hdr
    This will take a while; perhaps 20 minutes on an 800MHz Pentium III. You will receive output status lines every 30 seconds:
    rpict: 14284948 rays, 56.88% after 0.167u 0.000s 0.167r hours on hostname
    Upon completion, you will have a HDR image "render.hdr". View it with:
    % ximage render.hdr

  8. If you'd like to experiment with blur, glare, and flare, you will need to add the source file "pflare.c" to your RADIANCE distribution and then recompile RADIANCE to produce the executable "pflare". You'll have to play with the Makefiles a bit, but pflare.c should go in the directory ray/src/px/ in the radiance source tree. If you're using Intel Linux, then there's an executable of pflare included at the top of this page.

    Once you have pflare compiled and on your path, type:

    % pflare render.hdr -gb 10 > gblur.hdr
    % ximage gblur.hdr

    You will see a blurry image of render.hdr; pflare has applied a Gaussian Blur of 10 pixels diameter. Now try:

    % pflare render.hdr -cb 10 > cblur.hdr
    % ximage cblur.hdr

    This has applied a circular disk blur of 10 pixels; it's a more realistic out-of-focus effect. Now try:

    % pflare render.hdr -bb 10 > bblur.hdr
    % ximage bblur.hdr

    This applies a box blur; it's very fast but not very realistic. Now try:

    % pflare render.hdr -vi 200 400 > vignette.hdr
    % ximage vignette.hdr

    This darkens the corners of the image, which helps communicate the dynamic range of the since (really bright things will stay bright despite the darkening, since they were much brighter than white to begin with.)

    For efficiency, we can use -ds to downsample the image and -us to upsample it. This lets us compute large blurs more quickly, but requires evenly divisible image dimensions. We can also use the -ac accumulate feature to add together several different blurred versions of the image to form the final rendering. Here's the process used for the SIGGRAPH animation Rendering with Natural Light:

    % pflare render.hdr -ds -ds -ds -gb 12 -us -us -us -ac 0.1 -ds -ds
         -ds -gb 40 -us -us -us -ac 0.05 -ds -ds -ds -gb 3 -us -us -us
         -ac 0.1 -gb 1 -ac 0.75 | pflare -sh 0.75 -vi 150 400 > rnl.hdr
    % ximage rnl.hdr

    Make sure to type this all as one line. This also applies a tone mapping curve with a soft shoulder beginning at 75% image brightness. You can accomplish much the same effect with the hardcoded blur operation "-ha":

    % pflare render.hdr -ha | pflare -vi 150 400 -sh 0.75 > rnl.hdr
    % ximage rnl.hdr
  9. You can convert the rendered or processed image to a standard low dynamic range image format with the following commands:
    % ra_tiff render.hdr render.tif
    % ra_ppm render.hdr render.ppm
    % ra_ppm render.hdr | cjpeg -q 90 > render.jpg
    These will properly apply a gamma 2.2 curve to the data and then map the values zero to one to [0,255]. The last command requires that you've also installed the JPEG library.

  10. Finally, if you have a lot of processing power available, you can render the entire 2622-frame animation with the command:
    % mkdir frames
    % rm frames/*.hdr /tmp/ambient.amb
    % cat anim.vf | rpict -S 1 @optrad -o frames/rnl_%04d.hdr rnl_scene.oct
    The first few hundred frames will render very quickly since the camera is looking toward the sky and sees none of the objects. Most of the frames will take considerably longer. Each saved frame may be as large as a megabyte, so disk space may be an issue. This command reads in RADIANCE options from the file "optrad", which specifies an ambient cache file of /tmp/ambient.amb.

  11. Finally, if you want to process all of the frames with the blur filter and convert to JPEG images, you can execute:
    % cd frames
    % foreach i (*.hdr)
    % echo Processing $i...
    % pflare $i -ha | pflare -vi 150 400 -sh 0.75 | ra_ppm | cjpeg -q 80 > $i:r.jpg
    % end
    The actual "Rendering with Natural Light" also included a high dynamic range fade-in at the beginning and fade-out at the end.

  12. To learn more about RADIANCE, try the RADIANCE tutorial at:

Paul E. Debevec /