Pixar’s RenderMan & Marschner Hair

To quote a recent Pixar Technical article “A quarter-century after the pioneering work of Kajiya and Kay (SIGGRAPH 1989: ‘Rendering fur with three dimensional textures’), rendering hair and fur in 3D animation remains a challenge.” In that original paper, presented at Boston SIGGRAPH, CalTech’s James Kajiya and Tim Kay published an approach of treating fine detail fur and hair not as just geometry but as a texture.

Pixar has long needed to be able to produce CG hair for film’s such as Monsters University, Good Dinosaur, Finding Dory (the seals) and many others. Hair is a key factor in so much of Pixar’s character work. A major milestone in RenderMan’s hair solution was the addition and subsequent update of the Marschner Hair shader. This remarkable work has been both significant and enormously impactful. Believable hair adds not only realism but production value and key character personality.

The Marschner Hair shader was first released in RenderMan 19 and it has been improved for the newest release 21.5. The advanced hair model is innovative for its complex backscattering and glint and when it was released in RenderMan 19, it was the only commercial renderer that offered those features.

An example of Backscattering.  (Model and Groom by TELYUKA created with Maya, Shave and a Haircut, & RenderMan (see also our Saya story on Telyuka)).

The primary Marschner model has been optimised and extended by the Pixar Rendering Research Group from the initial paper published in 2003 by Steve Marschner et al : Light Scattering from Human Hair Fibers. We spoke to both Professor Steve Marschner at Cornell University and Christophe Hery at Pixar Research group about the evolution of Pixar’s PxrMarschnerHair solution.

The success of the Marschner model is in great part due to the specular estimatation and it’s deployment of three specular lobes using multiple specular transport paths:

  • Primary Specular: This can be described as the specular reflection.
  • Secondary Specular: TRT “transmit” this becomes the colored specular contribution.
  • Transmit Specular: TT light transmits through the hair surface (forward scattering) and produces the important back lighting.
The Marschner spec model

The key contribution of that original paper was to “identify, explain, and verify these different modes of scattering in hair and the appearance characteristics they are responsible for, as well as to provide a simple model to simulate them” commented Marschner when he spoke recently to fxguide.

The components of the original (2003 model. The first three hair examples are circular hair (1) The primary highlight) alone; (2) the TRT component (secondary highlight) alone; (3) the combined model. The 4th example (right) is the same full model showing elliptical hairs with texture due to glints.

“My interest in hair scattering started while I was at Microsoft and Jed Lengyel (a former lab-mate of mine at Cornell) showed me some cosmetic chemistry papers he had come across while working on a real-time hair rendering system” explained Marschner.  Lengyel thought someone who cared about reflectance and scattering ought to take a look and import them to high end graphics, and this got Marschner interested in Hair for the first time.

“When I moved to Stanford I found that Pat and Henrik were independently also looking at the same papers—so we knew we had to pursue it!  We did the first part of the work (including the measurements that supported the paper) while I was at Stanford, and finished up the paper after I moved to Cornell” he comments referring to several of his co-authors. The 2003 paper was co-authored with Steve Marschner by Henrik Wann Jensen, Mike Cammarano, Steve Worley, and Pat Hanrahan. This was quite the research group, each member is a towering figure in CG. For example, Jensen was awarded an Academy Award in 2004 together with Marschner and Hanrahan for ‘pioneering research in simulating subsurface scattering of light in translucent materials’ as presented in their paper “A Practical Model for Subsurface Light Transport.”. Their technique for Sub-Surface Scattering (SSS) has been used by renderers such as Mental Ray or V-Ray worldwide.  Hanrahan himself was a founding employee at Pixar Animation Studios from 1986 to 1989 and was a part of the design team on the original RenderMan Interface Specification and language. He is now at Stanford University.  Back in 2003, Hanrahan was also advising Mike Cammarano on his PhD in the Stanford Computer Graphics lab.

In 2006 Jonathan Moon co-published another paper Marschner titled: Simulating Multiple Scattering in Hair Using a Photon Mapping Approach. Interestingly, the 2006 paper compared their new Photon Mapping approach against a full path traced solution. Today the RIS integrator in RenderMan that solves Marschner Hair is a fully ray traced solution. The notion, ten years ago, was that a brute force full path traced solution could only be used as an expensive ‘ground truth’ and the baseline that their 2006 contribution should be judged against it. This was sensible, as just ten years ago, the notion of a commercially viable fully raytraced hair solution seemed completely impractical. “Well, as in many parts of rendering,” Marschner comments,  “we all assumed at that time (or at least I did) that brute force path tracing was obviously too expensive for practical use, so we were looking for ways to speed up multiple scattering”.  As in other rendering applications, ultimately renderer and hardware performance have progressed to where the brute force solution is now the standard in production.  However he highlights that the points made in the 2006 paper may still be relevant for fast multiple scattering solutions in real-time engines.

PxrMarschnerHair

PxrSurface and PxrMarschnerHair, are shipped as standard in RenderMan v21.5. In RenderMan’s  PxrSurface there are ten lobes that cover the entire gamut of surface materials, from metals to water to skin, (see Pixar’s technical note):

  • 1 di‚use,
  • 1 back di‚use,
  • 3 specular,
  • 1 iridescence,
  • 1 fuzz,
  • 1 subsurface,
  • 1 single sca‹tter, and
  • 1 glass lobe.

Each of the BSDF lobes is energy conserving. The system combines these lobes as simple linear blends. RenderMan supplements this somewhat with user adjustable layered material descriptions (or parameters). ‘This allows users the ƒflexibility of a multilayered shading pipeline, while maintaining a consistent rendering behavior.

Blond hair is normally harder to achieve than darker hair. PxrMarschnerHair can a blond
look with path-traced multiple scatt‹ering.

By 2009 at SIGGRAPH ASIA in Japan, Marschner was researching hair sampling and the measuring real hairstyles.  “We did that 2009 paper because we felt we had progressed to where the quality of the small-scale fiber assembly details was becoming a limiting factor.  I still think this is true, if you want hair that can be put side-by-side with real hair” Marschner explains.  But while his focus moved to styles not specific hair rendering, Marschner does not think that the latest PxrMarschnerHair is the endpoint of all hair shading.  “Since the 2003 paper we have highlighted that there are interesting effects of non-circular cross sections, though we have struggled to put together a practical shading model that can capture them adequately.  My student Pramook (Pramook Khungurn at Cornell University) and I published a paper in TOG this year about eccentricity, (Azimuthal Scattering from Elliptical Hair Fibers) and I still think we can get a bump in quality from a good model of noisy/glinty highlights in hair”.

From  the 2017 TOG paper: Actual real hair cross sections. Note that the most round is the D. The Artificial Wig. All other hairs have cross sections that are elliptical. (click for larger)

This work challenges the assumption that many people have that one’s hairs are round. As appearance of rendered CG hair follows from the geometry of hair fibers, their cross-sectional shape matters and affects the azimuthal distribution of scattered light. Generally, in the past there have been no commercial solutions that accurately model the scattering models for non-circular fibers or elliptical (cross sectional) fibers. Marschner and Khungurn attribute some of the uniqueness of hair to be due to this non-circular cross section (otherwise known as eccentricity). Pixar implemented this eccentricity with elliptical cross-sections, and extended it by adding azimuthal roughness control, and natural fiber torsion.

Straight hair (even distribution of cells (middle).

To understand this work, it is helpful to also look at the actual internal structure of a hair. The distribution of ‘cortical cells’ in a hair fiber affects how much hairs curl in on themselves.

Inside a hair is a distribution of cortical cells.  If they are symmetrical and in concentric circles then this produces straight hair.  If not the shape is more curly.  More asymmetry distributions result in both curlier and more ‘eccentric’ fibers. The curl of hair affects light scattering as the position of fiber axis relative to camera direction rotates down the length of the hair. In other words, it affects the position of the elliptical hair’s cross-section.

Non circular cross section, of what would appear as curly hair.

 

 

The effect of increasingly elliptical hair fibers, from left to right, 0.85, 0.90, 0.95, 1.00 (values in RenderMan)

Hair Colour

Melanin, color and dye

The cortical cells, or the cells of the cortex of a hair also play a key role in hair colour. The cortex of the hair shaft (between the outer hair cuticle and medulla – the very central core of a hair). The cortex is the thickest hair layer. It also contains most of the hair’s pigment, giving the hair its color. The pigment in the cortex is melanin, which is also found in skin and it is what gives you your eyes colour.

In v21.5 there is now more controls for adding Melanin and Dye to hair of characters.  “The PxrHairColor pattern node has two modes: artistic (with the color inversion) or physical (with melanin and such controls). Though this works hand in hand with PxrMarschnerHair, it acts “simply” as an input provider to the bxdf” explains Hery.

The Physical mode produces very realistic results with controls such as ‘Darken Roots‘, or “Melanin randomizing‘. The Artistic version allows these controls, plus just being able to apply a simple colour that then appears as a dye to the Hair. It does this by an inverse albedo and without needing to be physically based. It just provides the hair colour the artists requested.

Diffuse.

The PxrMarschnerHair in RenderMan, in their current implementation of hair, offers a physically plausible and energy conserving model this has been improved in v21.5 of RenderMan. In addition to the specular discussed above, it is offered with the choice of two diffuse models:  Zinke and Kajiya. The original work done by Marschner disregarded diffuse to keep the model clean, “but we always knew a diffuse lobe would be needed in production” explained Marschner.  “We also didn’t pay enough attention to energy conservation in that original model, and some of the follow-on work, eg Zinke, d’Eon, etc., as well as the RenderMan shader have made really nice improvements in that regard” he adds.

Christophe Hery explains that the diffuse lobe can be used in two ways and this irrespective of either Zinke or Kajiya:

  1. a separate additive lobe, for which the user decides on the amplitude of its contribution (for instance, it can be made the sole active lobe, thereby turning PxrMarschnerHair into a “simple” diffuse model)
  2. a residual lobe after all the contributions of the three Specular: R, TT and TRT (and Glints). This is triggered via the parameter specularEnergyCompensation. “This is the preferred and more modern way, where all input gains are equal to 1 (specular for R, TT and TRT, plus this diffuse) and fresnelMix is also 1″. This diffuse component then acts as an approximation of the low level more complex internal events and this term is similar in essence, to a 4th lobe.  “The choice may not matter that much. As a separate (additive) lobe, it is a look or artistic issue” Hery comments.

Summary

According to Hery, what makes the PxrMarschnerHair implementation unique in RenderMan is

  1. Full importance sampling and full energy conservation;
  2. Suport for a full model, including separate glints control and eccentricity;
  3. Extra controls to soften the azimuthal distribution in TRT (and glints), called glintWidth and a glow option.
  4. The potential addition of the extra residual diffuse (mentioned above)

The end result is remarkably believable hair that is both accurate and controllable.

1 thought on “Pixar’s RenderMan & Marschner Hair”

Comments are closed.