Sunday, November 25, 2012

The Sinister Foliage Method

This goes way, way back to the conception of Sinister ... I knew I wanted to use the (then) brand-new medium of computer animation, and I was looking for analogues in traditional media. That's when I first discovered Eyvind Earle, best known as the production designer for Disney's Sleeping Beauty.

His style was meant to evoke tapestry art, in high fairy tale tradition. He played geometric and organic forms against each other and used solid areas of color. I felt this would be a suitable visual target for the computer graphics of the time. (A little history - I first started Sinister in 1999, so graphic capabilities were primitive by today's standards, and I was searching for a look that was achievable without compromise.)

One thing Eyvind discovered was that complexity can be visually inferred by starting with a dark mass and building toward lighter values with successive layers of pattern.

Even with today's computer graphic capabilities, there is a lesson here about economy and process approach for environment artists who deal daily with complexity issues, especially when depicting foliage and other organic forms. I decided the abstract look of Sinister would be one of simple layering of repeated patterns. I would start with a dark base - representing the inner shadowed core - and around that build one or two more layers of successively brighter elements, representing the outer illuminated layers. The benefit of this approach: you can handle the dark inner layers in very low resolution, saving the processing cost of higher-res elements for the outer shell where detail will be noticed. Here's a simple example based on Sinister's "target tree" - the tree he uses for target practice.

First, I build a lowpoly mesh in Maya by extruding polygons. I usually block things out according to storyboards frames such as those above, and then export individual meshes to their own referenced files. Here's the base mesh for the target tree in Maya:

Next I export this in .obj format to ZBrush, where I first build up the trunk.

After the trunk begins to stabilize and I do a couple test exports of the normal map (FlipG and FlipV!), I focus on the foliage. Switching to the subtool representing the topiary shape of the foliage canopy, I dial in some noise using the Tool>Deformation menu.

Under the Fibermesh menu, I click Preview. At first, it looks like a bunch of hair. But with careful tweaking, we can make Fibermesh "leaves" to model convincing foliage (at least for the inner layers).

Adjust Fibermesh settings: Turn Maxfibers way down, Length way down, Slim, Twist and Revolve low or off, raise Coverage. Add a positive Imbed value to set leaves "into" the base mesh shape. This is good for the inner leaves. Keep Segments low (3) and adjust Width Profile for leaf-shape. Make the color black at the base, dark green at the tip. Hit Accept to generate foliage mesh subtool. Under BPR Settings, turn off Fast Preview and lower Sides to 2.

With the fiber subtool selected, go to Tool>UV Map and click FiberUV with map size 256 or 512. Under Texture Map click New from Polypaint

This will make every leaf share the same UV map, and write a simple gradient texture from base to tip based on the fiber color values. You can later open this texture in Photoshop to create a leaf texture that will be applied to every leaf at once!

Hit GoZ and send this inner canopy to Maya. Save it out as a .ma file and close Maya.

Go back to the original canopy shape subtool and repeat each of these steps for the outer canopy, but adjust Imbed to a negative value (so leaves will rest above the base mesh, outside of the dark inner canopy), lighten tip color to a light green, and consider lowering Maxfibers for sparser leaves and/or raising Segments for higher-resolution leaves.

After you've got all this assembled by importing trunk, inner, and outer canopy into a composite Maya scene, you should be able to do a Mental Ray render that looks pretty similar to your ZBrush master file. The poly count is reasonable, and provides good interaction.

Now, if you want to do something fancier, you can model any leaf-shape as a separate piece of geometry. Then instance it to all of your Fibermesh fibers. Custom leaf shapes! Geometry>Modify Topology>Micromesh>select mesh to use as leaves. BPR will render each fiber as the Micromesh (custom leaf) shape. To create permanent geometry out of the Micromesh (to export to Maya, for example), Geometry>Convert BPR to Geo.

No comments: