COMP238 Assignment 3: Procedural Texturing



Table of Contents

  1. What does the image show?
  2. What am I proud of?
  3. What was hard? (short version)
  4. How was it made?
  5. What shaders are there?
  6. What was hard? (long version)
  7. Show me the image!

What's the subject of the image?

This image shows a building vaguely similar to an art museum in Nagano, Japan. There are two rock gardens in the pond: one is on top of the island on the far right, the other is set just beneath the surface of the water on the right.


What am I proud of?

I'm particularly pleased with the way the sky, the clouds, the rocks, and the water came out. None of them are groundbreaking work by any means, but they're reasonable, plausible approximations that don't require an entire custom rendering system. The sky is a partial implementation of the sunlight/skylight model developed by Preetham, Shirley, and Smits. The clouds are low-frequency fractal noise with a little bit of reflection thrown in. The rocks in the back wall, the underwater garden, and the island are based on Steve Worley's cellular noise basis. The water ripples are more fractal noise (low-frequency, low-amplitude), and the water surface has some attenuation effects for distance and reflection angle.


What was hard? (short version)

The sunlight/skylight model is exceedingly difficult to implement in Renderman. I wound up only using the skylight part; the sunlight was too slow for my purposes, and I couldn't get the dynamic range to work out so that you could see both the outside of the building and the inside.

It's surprisingly difficult to get convincing-looking mountains. I'm not entirely happy with the way these turned out, but they'll do. If I had more time, I'd have taken another shot at aerial perspective and made the snow distribution react to the local slope of the mountain.


How was the image made?

The model itself was created in Rhino and is actually fairly simple. I've made versions with no surface shaders (everything's been replaced with plastic) and another one with no surface or displacement shaders for comparison with the final version.

I did all of my rendering in BMRT 2.4g on a Linux machine. Suitable use of environment and depth maps would probably make this image renderable under prman; the water shader would be the really difficult one, as it uses a few of BMRT's extensions to the shading language.


What shaders are in the image?

An exhaustive list:


Implementation Challenges

Sunlight and Skylight

I'll come right out and say it: the sunlight/skylight model from SIGGRAPH 99 is highly non-trivial to implement in C++, and simply murderous when attempted in the Renderman shading language. It's also difficult in the extreme to debug; the equations for sky luminance and chromaticity are quite opaque. I had to resort to the example code provided on the paper page to figure out where a few of my problems were.

Also, there are some important pieces of information missing from the paper. Certain quantities in certain integrals (the parameterized extinction coefficient at ground level, for example) aren't defined well enough to implement, and the authors assume that the reader is intimately familiar with CIE XYZ and xyY color spaces, spectral power distributions, and how to convert between them. Apple has a short FAQ on color spaces that may help if you want to try it.

Dynamic Range

The limitations of the RGB unit cube become glaringly apparent as soon as one tries to incorporate illumination from the real world. Greg Ward Larson had the right idea: store luminance along with color, and don't convert down to RGB until the last possible instant before display. I wish Renderman made this easier to do.

Polygon Edges

Most of the images authors generate to show off their terrain-effects shaders (mountains, rocks, whatever) fill the screen with a single polygon. This makes for great mountain ranges or beaches full of rocks. In this image, though, the polygons are of finite size, and I needed a way to lower the displacement amount near the edges so that the naked edges of the polygon wouldn't be visible. (This was particularly important for the underwater rock garden.) Solution: specialize the shader. Most of the displacement shaders in this image know where they're supposed to be in space and can attenuate themselves accordingly.


Show Me the Image!

Rendering done with BMRT 2.4g under Linux. You can download the image as an 800x600 JPEG (98K) or PNG (530K). I did the actual rendering at 3000x2250 with 4 samples per pixel, so if you've got your heart set on some particular resolution, send me mail -- it can probably be arranged. For the terminally curious, the final render took 9 hours on a PIII-500, and the process took up about 130MB of memory. (This is mostly the fault of all the displacement shaders. BMRT appears to generate microgeometry for each displaced surface, and at that resolution it takes a lot of triangles to avoid artifacts.)


Andy Wilson
Last modified: Wed Nov 3 15:43:41 EST 1999