Flower

Kok-Wei Koh, Xinru Ng Woo

CS348b - Spring 2001

 

For our final project, we modeled and rendered a picture of a flower.  The above image is the one that we used as our entry for the class rendering competition, which was held on Friday, June 8th in the Sweet Hall Graphics Lab.  Due to time constraints, we were only able to render the 320x240 image using 4 samples per pixel and 50 samples per light source.  Much to our delight, it was awarded "Honorable Mention" from the panel of judges, which consisted of Brian Smits from PIXAR, Dan Wexler from PDI, and Steve Marschner from Stanford.  This was an extremely satisfying award, considering all the amazing images that were created by our classmates.

Our image was based on the following two pictures which we found on the internet:

We chose this scene because we feel that images of nature are especially challenging to simulate.  While it is relatively simple to create plastic-looking flowers, making them look realistic and life-like is another story.  Here is our original project proposal.

For just about all of the project, we both worked closely together to figure out the problems and challenges we would face, and to solve each problem as described below.  Where necessary, we worked out the equations together and outlined the pseudo-code before actually programming.

Modeling

To model the flower, we used Maya, an excellent modeling software package from Alias|Wavefront.  Each petal began life as a NURBs curve revolved around a central axis, creating a cylindrical shape, which was then flattened down to a certain thickness.  To bend the petals into their curved shape, we had to repeatedly rotate subsections of the petal just a few degrees at a time.  Finally, many individual control points were moved around to give each petal a more natural look.  Here is an image of the wire mesh model of the flower:

In order for LRT to read the RIB files, we had to first triangulate all of the NURBs objects.  Then, using secrets taken from Jeff Mancuso's "Wonderful (Only not...) Guide to exporting LRT compatible RIB's from Maya 3.0" we had to strip off certain sets of duplicate data and modify various parts of the file.  We wrote a little utility in C that automated part of this process.

Subsurface Scattering

To simulate the soft, natural look of the flower petals, we implemented a reflection model based on subsurface scattering, as described by Hanrahan and Krueger [1].  When light hits a layered surface, such as a flower petal, some amount is reflected by the outer surface, while the remainder penetrates into the subsurface, bounces around, getting partially absorbed along the way, and finally either reflects back out of the outer surface, or gets transmitted through to the next layer or out of the outer-most later.  This is best understood by looking at Figure 1, taken from [1]:

 

We implemented this by extending our Monte-Carlo integration code to sum up the reflected radiance due to surface scattering with the reflected radiance due to subsurface scattering:

                Lr (θr,φr) = Lr,s (θr,φr) + Lr,v (θr,φr)

Texel/Texture Mapping 

At first, we experimented with using texels to simulate the central pollen area of the flower, as described by Kajiya and Kay [2].  Texels are a way of representing a 3D volumes while only storing information for a 2D array.  It is based on volume rendering algorithms.  A simplified explanation is that a texel volume is generated by producing a density and coordinate in the third dimension given coordinates in two dimensions.  It is mapped from object to world space by converting the texel coordinates into bilinear patches with which rays are intersected.

The following is one of our unsatisfactory attempts at creating a pollen-like texel:

However, the nature of texels doesn't lend itself to creating structures where the components curve around and are as complex as the pollen for this flower.  In the end, we texture mapped the center using a little 13x19 texture which was clipped from the original image.  The end effect was, surprisingly, closer to what we wanted the pollen to look like.

Depth of Field

The blurry background was achieved by implementing a depth of field effect.  We set the aperture size of F7.0, focal length of 1.0, and focal distance of 4.0.  The center of the flower was a distance of about 5.0 away from the camera.

Final Image

The following image is a 480x360 image rendered using 5 pixels per sample and 75 samples per light source (originally a 237k tiff file, converted to a medium-quality 23k jpeg file via Photoshop for easier web viewing):

We are currently in the process of rendering an even larger, higher quality image using more samples per pixel and more samples per light source.  Stay tuned for an update...

Source Code

Here are the links to our gzipped source code and our RIB file.

References

[1] HANRAHAN, P. AND KRUEGER, W.  Reflection from layered surfaces due to subsurface scattering.  In ACM Computer Graphics (SIGGRAPH '93), pages 165-174, August 1993.
[2] KAJIYA, J., KAY, T., Rendering Fur with Three Dimensional Textures, Computer Graphics, (SIGGRAPH '89, VOL. 23, NO. 3), pages 271-280, July 1989.