‘wmFur’, the Marschner Model and more.
In 2005, Peter Jackson unleashed his King Kong film, showcasing state of the art creature visual effects from Weta Digital. Amongst other achievements, the VFX studio would pull off a number of accomplishments with their CG fur and hair for the 25-foot tall gorilla.
As Kong progressed through the film, his fur needed to reflect the environment and story. Sometimes it was clean and groomed, sometimes full of mud and leaves, and sprinkled with snow, or soaking wet. A fur system had to be developed to handle these situations, as well as for several digital-doubles.
In this latest retro RenderMan story, where befores & afters is featuring previously published Pixar materials, we look at what Weta Digital carried out back then with the aid of RenderMan for Kong. Note: the VFX studio now relies on its in-house spectral renderer called Manuka for rendering.
The hair system is implemented as a DSO: a procedural plug-in for RenderMan called wmFur, written by Martin Preston. The hair is created from follicles, which are spread across the subdivision surface the hair is being generated from. The hair grows straight out of the surface, then “groomed” by deformers which add life to the fur.
Deformers are the tools that the groom TDs use to create the desired look. They range from simple deformers (such as noise and wave), to more complicated directional deformers (such as clump and wire deformers). The clump deformer, as the name suggests, allows artists to bend surrounding hairs towards a central hair. The wire deformer is a curve, with an arbitrary number of CVs, that grows from the skin and can be modeled. It affects surrounding hairs, within a region of tolerance. Within a single character, there can be a number of “groom programs” that specify the fur characteristics for different parts of the body. Kong, for example, had different “groom programs” for his arms, head, chest, etc.
To control the fur deformers, artists must specify a variety of attributes across the surface, using texture maps or per-vertex primitive variables (painted in Maya’s Artisan). These attributes include length, baldness, density and other control parameters for deformers.
By layering these deformers, the artists (or fur groomers) were able to quickly create, and change, the look of Kong’s fur; in a procedural and non-destructive way. The hair, for example, could be bent in a certain direction. Then a clump deformer added. Then the bend altered. All without changing the clumping behaviors applied afterwards. This was important as the look of Kong was heavily art-directed; many iterations could be quickly tested to refine the desired look.
In the end, the DSO generated approximately 3 to 3.5 million hairs for Kong, although this varied considerably depending on the shot. Interestingly, a decision was made not to cache the fur generated by the DSO, but to regenerate it every frame. This decision was arrived at by weighing the cost of network bandwidth (considerable when moving multi-gigabyte fur caches) against the cost of recomputing the fur every time. In the end, Weta’s massive renderfarm generated the fur on a per-frame basis, foregoing the cost of moving huge cache files around the network.
Weta based the illumination model for the hair in Kong on the 2002 Siggraph paper “Light Scattering from Human Hair Fibers” by Stephen Marschner et al. The details of the paper were implemented as a RenderMan shader and modified; to give it the flexibility needed to render Kong’s rough ill-kept black hair, as well as Ann’s nicely-groomed blond hair. Out of the box, the Marschner model gave a clean ‘shampoo commercial’ look. So a series of refinements and optimizations were added to get the necessary look for Kong. The challenge was to match the RenderMan shader to the fur on the Kong maquette, made with dirty Yak’s hair.
The Marschner model
The Marschner paper bases its model of human hair on empirical measurements of light scattering from a single hair fiber. The main result of the paper is that hair scattering exhibits three highlights: a primary highlight, which is a direct specular reflection from the surface of a hair strand; a secondary highlight (shifted away from the primary), the result of light penetrating into the hair (transmission), reflecting internally, then exiting at a different location; and a transmitted component, dealing with light transmitting directly through the hair (as in illumination from back lighting).
To achieve its results, the shading model approximates each hair fiber as a transparent elliptical cylinder, with an absorbing interior and a surface covered with tilted scales (cuticle angle). As the fiber is treated as elliptical, the orientation of each hair strand impacts the shading. Certain orientations give stronger highlights than others, depending on axial rotation. Often this results in a glint, or caustic, in the secondary highlight, where the orientation of the elliptical cross-section focuses the light into a bright highlight.
The model also results in a separation of the primary and secondary highlights. The primary highlight shifts toward the root and, since it is purely reflective, takes the color of the light. The secondary highlight shifts towards the tip and, as it has transmitted internally, takes the color of the hair.
The Kong rendering setup deals with the transmission and absorption of light, in two ways. First, the shader accounts for transmission from back lighting. Second, the lighting setup deals with transmission/absorption through a volume of hair.
If a light-colored strand of hair is lit from behind, it tends to glow and fluoresce. This is light transmitting through a single strand of hair, yet tinted by the hair color (black hair does not exhibit this trait, as the hair absorbs most of the light). As noted above, there is also a caustic focusing effect of the light, which can make the light through the hair seem more intense than the light source.
The transmission and absorption of light, through a volume of hair, is addressed by accumulating color and opacity as light transmits through the volume. RenderMan’s deep shadows are the perfect tool for the job, since they accumulate opacity and color from semi-opaque objects. To generate the deep shadow maps, Weta did not wish to use the full beauty shader for each of the shadows (sometimes up to 20 or more). So they used a stripped-down version of the hair shader in the shadow render, calculating only the transmission of the hair. Rendering the deep shadow passes with this shader gave the attenuation of light through the volume for free.
Finally, Weta had to rough up the hair for Kong, then add controls to give the fur variation found in wild animals. To achieve this, they first added a cylindrical diffuse term to Kong’s hair; which accounted for dust. Second, the cuticle angle (described by Marschner) was “noised up” to represent more broken unkempt hair, similar to that observed in Yak’s hair. Lastly, controls were added for a thin-film oil layer (used for hair on the head) and shine from wetness.
Occlusion and shadows
To shadow the fur in Kong, Weta used a combination of deep shadow maps and a “volume occlusion” brick map. As mentioned, the deep shadows excelled at attenuating the light traveling through the volume of fur. They were used to shadow the key/main lights and for inter-hair color absorption.
The volume occlusion maps were developed to compute, and store, fur ambient occlusion on a per-groom basis. The volume occlusion brick maps work in the same way as ambient occlusion brick maps for surfaces. First, Kong is placed in a reference pose with a given groom on his fur (remember, this is a per-groom map).
The amount of occlusion is calculated for each point on the fur, then stored in a brick map (using a Pref with the fur ‘straight out’ to un-clump it). Like any brick map, this can be looked up by the fur shader, to find the occlusion and bent normal direction. Overall, the fur occlusion helped to conserve the clumping detail, but being groom-dependent, it needed updating for every groom change.
Join the VFX community by becoming a b&a Patreon...and get bonus content!