Goal
Butterflies are beautiful composites of wonderful fractal patterns, geometry and surface properties. Our goal was to understand and replicate some of these properties to procedurally generate, with parameterized input, a variety of butterfly models, with slightly varying reflectance/surface properties, coloration, and geometry. We planned to model the reflection/iridescence, texture, and fractal-like outline of the butterfly wings.  

 

Gallery of Results
Below is just a small sample of the numerous variety of butterflies our random procedural algorithm produced. To see more please look at our Butterfly Gallery

redNblue03.jpg (39570 bytes)blueEmperor.jpg (39949 bytes)NileRuler.jpg (25999 bytes)jungledesert.jpg (40375 bytes)

View the entire Gallery

Application & Source Code
Below are links to our modified LRT source code as well as an OpenGL application we wrote to develop the wing geometry algorithm:

LRT application and Source
Type "lrt butterfly.rib" to generate a butterfly. The output file will be wtest.tif

OpenGL application
Press J on the keyboard to jiggle the wings
Press the spacebar to see an intersection test of a random point
Press ESC to quit

 

The Science of Wing Development
From a developmental perspective, the formation of a butterfly wing pattern is the result of a complex coordination of processes, timing and genetics. The mechanics that determine the scales, pigmentation, pattern element size, shape, position, and symmetry, ultimately determine the pattern. Experiments have revealed pattern determination is established and finalized within the first few days after the caterpillar enters its pupal stage. At this time, the wing views, the wing shape, the epidermal membrane, pattern elements and coloration are determined. At the root of the pattern development mechanism is the diffusion of a morphogenic substance through the epidermal layers. These diffusions, controlled by activating and inhibiting enzymes, result in gradients of the morphogenic substance. Reaction thresholds based on the concentration of the morphogen determine the contours of the actual pattern elements. Some pattern elements are formed from the source position of the morphogen while others are initiated by the absence of the morphogen (concentration sink). The exact pattern shapes are usually formed from the contours generated from the addition of multiple morphogen gradient sources or inhibitions. Controlled by genetic and environmental factors, the final pattern might best be described as a developmental freeze-frame at the beginning of pupal stage when the pattern finalized. (source: http://www.bugbios.com )

 

Graphic Properties

A butterfly is composed of a tube-like body and four wings . The upper wings overlap the bottom wings slightly and the patterns are symmetrical left to right. The top and bottom wings are often very similar, but can be completely different in some species of butterflies.
     The shapes of the patterns are driven by the geometry of branch like veins in the wings. These veins begin near the body and subdivide in a fractal pattern out toward the edge of the wing. Common features on wings include strips, color gradients, bands of alternating color, eye-like patterns, speckles, and a variety of spot shapes.
     At a microscope scale, the wings are a formation of scales that produce phenomena like iridescence, metal-like features, and sub-surface scattering.


Electron microscope
image of scales

 

 


irridescence

 

Procedurally Generating Butterflies

Wing Outline
The wings were modeled using a NURBS on a plane. We wrote curve object to support cubic curves that would maintain C-2 continuity.  Curve points can be specified arbitrarily and the control points automatically adjusts to maintain smoothness and C-2 continuity.  We took measurements from pictures of actual butterfly wings to form the basic shape for our wing generation algorithm. The wing was broken down into a set of fundamental control points each specified by a angle and length from the butterfly's shoulder.  

The shape of the wing outline could be changed in three fundamental ways: 

  1. Random polar distortion, in which the radius and angle from the horizontal for a given point can be altered (within a certain range, to ensure that points do not cross over each other).
  2. Recursive, random subdivision, in which a point is inserted on the curve between two other points and offset by a small amount.

  3. A compression factor, adjusting the total theta sweep of the whole wing.  Several constants and randomization steps in our code were used to influence these processes.

We can also specify the height and width of the wing.

After specification, the NURBS outline is evaluated into a long string of line segments. Intersection with the wing outline is determined by first testing ray intersection with the finite plane in which the wing is located, and then testing whether this point of intersection is located within the segmented outline.

 

 

 

 

 

Measuring the wings

veincurve.gif (3780 bytes)

Creating curved segments

 

 

subdivison.jpg (9066 bytes)
Recursive Subdivision

 

Veins

Veins are also important in the wing structure, especially for texture mapping.  We specify the number of veins at the shoulder edge on the wing and the number of veins at the outer edge of the wing.  These two values determine the need for branching veins.  We use NURBS curves to model the veins.  The veins divide the wing into sections.  Textures and patterns on the butterfly wing seem to align themselves to these sections.  To this end, we enable a [u,v] coordinatizing of each section, so that spots, stripes, etc. will follow the curves and also align with the spots in adjacent sections.  

We wanted the curvature and branching of the veins to be as natural as possible.  We specified the control points of the curves to emphasize the slope or curvature of the wing, with minimal modifying by random values.

 

Vening Samples
(click to enlarge)

b&w06.jpg (20234 bytes)b&w15.jpg (23253 bytes)

b&w13.jpg (20282 bytes)

 

Surface
The surface of the butterfly wings was colored using layered texture maps. After the wing outline and veins are generated our algorithm composites a texture map for the upper and lower wings using a library of textures, hand-drawn spots, and scale patterns. We added alpha channel support as well as a variety of blending functions so textures could be combined in a variety of ways. Textures could also be converted to a HSV representation where just the hue could be modified thus allowing us to change the color of a single texture while maintaining the pattern.

The texture compositor used several stages to generate the final upper and lower wing texture.

  1. First a background containing either a randomly generated color and/or repeated scale texture was placed
  2. Then sectors were mapped. Each section of a wing could be identified and mapped from sector space to wing space. This allowed us make spots that curve inside the veins and place textures in rows along different vein sections.
  3. Larger spots are then placed outside of vein sections. Their position is based on the vein representation since the veins give us an idea of where in wing space we are.
  4. Finally the upper and lower wing textures are duplicated and flipped to create horizontal symmetry.

LRT Primitive
Our butterfly is completely specified in the Renderman file using the butterfly primitive object we created. The wings as well as the body geometry are not specified in the rib file. This permits butterflies to be specified very easily. You could easily write an algorithm to populate a scene with hundreds of butterflies. The syntax is as follows:

butterfly <wing width> <wing height> <wing spread angle> <wing roughness>

These parameters as well as many random factors create the final rendered image.

 

 

 

 

         

 

 

 

 

  

 

   

 

Conclusion
Our goal was to procedurally create realistic butterflies, using as little measurement data as possible and generating convincing, widely varying characteristics with our own processes.  We would have liked to have had more texture elements be procedurally generated, such as noise-modified color gradients and spots, instead of randomly composited and arrayed elements taken from pictures.  We also wanted to implement a system to model the subsurface scattering and resulting interference patterns due to the microscopic multi-layering  of the mircoscales.  We had quite a large amount of structure to implement, however, and did not arrive at these goals.   We also invested many hours in connecting our butterfly with the LRT structure, and implementing it as an LRT primitive. 

Though we would have liked more time for the project, we were surprised and pleased with the appearance and variety of the 3D butterflies our system generated.  With a little more refinement, our system could be used to populate 3D environments with multitudes of beauteous butterfly species.


Copyright 2001 �
Tyler Voliter and Peter Douglas