Lost at Sea

CS348B Final Project

Dmitry Belogolovsky & Woodley Packard


Our presentation can be found here.
Our short movies can be found here and here.


Our goal was to render an electric storm striking an ocean. We both took several years of ancient Greek in high school, so we decided to theme the picture along those lines; they scene is supposed to represent a Greek ship lost on its way to battle. Here are a couple of lightning photographs that we found inspirational while working on the project:

The image consists of several fairly independent components:

  1. Sky
  2. Ocean
  3. Lightning
  4. Boat



The ocean in our scene is a procedural heightfield. The altitude as a function of the projected planar position is calculated as a sum of sinudoidal wave patterns with varying frequencies and amplitudes. We used two types of waves: The technique is the one described by M. Finch [6]. We found that if we only used one type of waves, the water looked nice locally but had obvious repeating patterns globally. Using the two techniques in tandem made the ocean look much more dynamic.

The ocean is raytraced using Musgrave's QAEB-tracing algorithm [5]. Precise procedural normals are available from the underlying analytically defined surface. Reflection rays are generated upon collision, and weighted by a function of their incident angle. We did not trace any rays underwater, but we did use an approximation to the subsurface scattering caused by the bright lightning:

No Subsurface Scattering With Subsurface Scattering

Since the water is defined by simple wave functions, it was possible to accurately solve the governing partial differential equations for its motion. Using d'Alembert's solution to the wave equation [7], we animated the water in a physically accurate fashion without having to numerically solve PDEs.



Since our project primarly focused on lightning, we decided to use a model from a standard model library instead of modeling our own. Later, we realized the need for more complex lighting for the boat, so we added a latern to the model of the boat. We model the latern as a short segment of lightning with a differenet color than the lightning itself. In the movie, the boat and lantern rock back and forth. The boat uses a procedural Perlin noise texture for the sail, since we wanted to avoid the use of any external textures for our project. Diffuse shading and soft shadows are done by integrating the light sources by arc length, using Monte Carlo sampling.

Grid Computing

To speed up our test cycle, we implemented a simple network job distribution system. The program breaks the image down into one-pixel-wide vertical strips, and farms them out to participating cluster nodes. The overhead of this level of granularity is low, since each cluster node only loads the data component and performs preprocessing steps once per complete image render, and henceforth is available to render any number of strips sequentially. This approach allowed us to render the scene in a quasi-random order, and to display the results as they arrived, rather than waiting for the entire image to finish. In this way, we were often able to cancel bad renders after seconds rather than hours. For the last few days, we assembled a heterogenous cluster of the various computers we had access to (not including the public Stanford labs of course, since we knew everyone in the class needed those!). We managed to put together about 18GHz of processing power to render our final images!

The final images were rendered at 3600 by 2700 pixels with 100 shadow rays per eye ray, and then resampled down to 1280 by 960 to reduce aliasing. The close-up image of the boat with the purple lightning took about 8 hours of rendering time, and the distant views took about 1 hour each.


  1. Jensen, Henrik W.: "Realistic Image Synthesis Using Photon Mapping." AK Peters, 2001.
  2. Williams, Peter L.: "A Volume Density Optical Model." ACM Press, New York, 1992.
  3. Ebert, David S.: "Procedural Volumetric Cloud Modeling, Animation, and Real-time Techniques."
  4. Dobashi, Y. et al: "Efficient Rendering of Lightning taking into Account Scattering Effects due to Clouds and Atmospheric Particles."
  5. Musgrave, F. Kenton: "Quasi-Analytic Error-Bounded Ray Tracing of Procedural Height Fields."
  6. Finch, M.: "Effective Water Simulation from Physical Models," in GPU Gems. Addison-Wesley, Boston, 2004.
  7. Strauss, Walter A.: "Partial Differential Equations, An Introduction." John Wiley & Sons, Inc., New York, 1992.
  8. Internet: Vaisala Thunderstorm. "Frequently asked Questions About Lightning." http://www.lightningstorm.com/tux/jsp/faq/index.jsp, 2004.