VSFX 319 - Programming Models and Shaders

Pre-baked Animation

Project Summary:
The static images, movies and technical breakdown on this page demonstrate how an animation can be baked (exported) as a sequence of rib archive files. An explanation is also given of how other Maya scenes can reference the achived assets in such a way that complex scenes can be rendered without the need for Maya to directly display multiple copies of the original geometry.

Results:
Click on the image to the right to see the final animation.

Reference Images

Every good project starts with reference material and this one is no exception. Below are a sampling of the reference photos I used for shape, color, and overall construction of the palmetto plant. The movement used later in the process is a simplified version of what I observed while watching the plants blow in the wind.

This shot shows the overall construction of the plant, particularly the grouping and spacing of the leaves and the axial symmetry of the base. For clarity, the bottom leaves of this plant have been trimmed off but the final version for this project will be a "wild grown" plant.

This shot shows how the leaf spirals nearly 90 degrees towards the tip. Note that the spiraling doesn't really start until nearly half way up the leaf stem. The same is true of the gradual bend in the leaf, the lower half of the stem is mainly rigid. This detail was important in the animation of the stem later.

I took this shot to get a better idea of the translucency of the leaves, the way each affects the other below it and the layering of color.


Another shot for translucency and shadowing below and within the plant. This one really shows how very little light gets thru the bottom of the plant.


Here is a detail shot of the splitting at the end of every smaller leaf, I included this in the modeling although in a simpler form to keep poly count as low as possible.


Construction

The construction of the plant began with a single leaf, and that began with a single poly plane. I then extruded edges, scaling and rotating them as I went, to shape one side of the leaf. Once I was happy with the results, I duplicated it to the other side and merged it down the middle. This pinched the back end of the leaf where it attaches to the plant into a single edge, much like the real plant. I specifically kept the geometry as simple as possible to save on processing and rendering time since each stem would have close to 100 leaves.

The stem was also kept simple and light on geometry, it started as a poly cylinder that I adjusted and then extruded, shrinking and reshaping as I went. I gave the stem more divisions along its length so that it would bend and deform properly instead of looking like it was hinged in the middle.

Once the two parts were finished I scaled the leaf and aligned it to the base of the stem. I planned on using an animated snapshot to duplicate the leaves down the stem so I set up keyframes of the leaf translating along the stem, rotating slightly forward and shrinking as it went.

While the animation snapshot got me close and saved alot of tedious work it was nowhere near correct for a truly organic looking leaf. So, I set to work manually repositioning and grouping the leaves in ways similar to what I observed on the real plant. I noticed that towards the tip of each stem the leaves had very little space between them. However as they traveled back towards the base they began to group into sections of 2, 3, or 4 leaves with a growing amount of space between each group. This varied per stem and I tried to make it as natural looking as possible, even going so far as to make the spacing and grouping on each side of the stem different, rather than just duplicate them across.

Also, there seemed to be two seperate rows of leaves. One that stuck horizontally out from the stem and another than was inclined about 20 degrees up from that plane. The two gradually come together towards the tip so I again incrementally adjusted small groups of leaves until I was satisfied with the look. The detail shots below have a simple green lambert applied to them, this would change later in the process once full plants were constructed.

 
 

Rigging, Deformation, and Animation

I specifically modeled the stem flat because I knew how I would animate it down the road. Rather than try and build it with the characteristic bend and twist I planned on using deformers on the overall model. That way not only could I more easily control the deformations, I could key them as well to make the animation loop. Below I have several angles of the rig and the attributes applied to it. The fourth shot shows how I used a locator to control the overall circular motion of the whole stem. The two deformers and leaf group were grouped together and to that hierarchy I applied an aim constraint at the locator. I then used a simple expression on the locators X and Y translates to make it trace a circular path slowly. With the stem following that automatically I could easily animate the deformers to produce the secondary motion of the leaf catching the wind: it straightens out and twists a little further. Click the fourth image to see the locator motion and the expression used to produce it.



Here are some further detail shots of the leaf after the deformers were applied. Click on the first image to see the completed animation loop twice.

   

Proxies and Shading

The point of this whole ordeal was to learn and demonstrate the power behind RenderMan's ability to enable the artist or animator to use proxy objects and replace them at render time with a pre-made geometry. Below is the scene as it exists in Maya and on the right is the rendered image of that scene. Code inserted before the shape node of the node tree tells the renderer to replace the object's geometry with that of a specified .rib file. This keeps scene files in Maya light and manageable and places all the hard work at render time.



A new surface shader with ramp color node and translucence built in was added to the leaves for a more realistic result. I had intended to texture the whole thing using Photoshop and some more reference images but I ran into a problem. When I used animation snapshot to make the numerous leave it created new geometry rather than making instances so I wasn't able to make the texture to one leaf and apply it to all of them. With so many leaves, especially with the final image having several full plants, texturing each one in the small amount of time left became too daunting of a task. However, in lieu of that I feel that the ramp color I used works well and gets the job done while keeping rendering time down. The individual leaves are not seen in enough of a close up to justify a highly detailed texture.



Once a single proxy object worked I used duplicate special to make the bottom most ring of branches. I then repeated it for each row working my way up to a completed plant. Below on the left is the grouping of proxy objects and on the right is the render. To the scene I added a directional light to simulate sunlight, a ground plane with a simple texture, and changed the camera environment settings to add some sky-blue. I used RenderMan's own version of d-map shadows called Deep Shadows to support the translucency of the leaves.

 

The final steps of the project involved using a series of rib files made from an animation of a single leaf to populate the entire plant so that each would animate seperately. This involved changing the pre-shape MEL script within the single leaf proxy object to call a range of .rib files instead of a single one. I then export the group of single leaf proxy objects as a rib and made a larger proxy object to represent the whole plant. This also received the new script that calls a sequence of .ribs. You can see the code and options set below. Note, the camera angle in in proxy shot has been altered to show the cubes in their entirety.



Final Composition and Rendering

And finally, the animation sequence for each leaf in a group of full plants is complete. Click on the rendered image below to see the final animation. I do have an issue with the shadows. They seem to "swim" or flicker as the animation plays. I tried various iterations of changing the pixel sample rate, the d-map resolution, etc. but nothing seemed to really help. The final light settings used are to the right. Future testing may uncover the culprit.