Maya - Hair

Maxwell offers a procedural primitive which can render hair faster and with significantly lower memory usage compared to converting the hair to polygons. The Maya plug-in exports XGen interactive groom type, PaintFX strokes and Shave&Haircut hair to this primitive.

XGen

The plugin supports the hair generated with interactive groom splines

 

However, the other types of hair (controlled by expressions or placing and shaping guides) can be also rendered if they are converted to interactive groom using this option from the Generate menu:

 

 

PaintFX

The plug-in supports any PaintFX lines, which includes Maya hair. Only main lines are supported, no leaf or flower lines. The plug-in adds a Maxwell Render group on the pfxHair node where you can control the render type, motion blur type, render flags and vertex color export. See below for an explanation of the vertex color feature. Since Maya has no concept of material for PaintFX, the plug-in also offers a Material control in the added rollup. Clicking the map button next to the control brings up a list of existing Maxwell materials from the scene and also allows you to create a new material for the hair. The "Render Type" attribute allows you to specify if the hairs will be rendered as cones or blades (planes).

 

Shave&Haircut

Maxwell supports Shave&Haircut by Joe Alter. The colors computed by Shave from the root/tip color, hue/value variation and mutant hair parameters can be exported and used as vertex colors; these parameters can also be textured. A Maxwell Render group is added on the Shave hair shape node, containing render flags, a material control and the vertex color toggle, just like for PaintFX hair.



Vertex Colors

The Maxwell hair primitive allows a color to be specified at each hair point (knot). These colors are interpolated along each segment and modulated (multiplied) by the reflectance 0 texture of the material. Therefore, when the hair system can generate color information, as is the case for Maya hair and Shave, you can use these computed colors inside Maxwell by applying a white texture on the reflectance 0 attribute of the material. The look of the hair in the following image was obtained by manipulating the Shave settings and applying a simple Maxwell material with only a white, 1-pixel texture:

Important note: vertex colors will not work with non-textured materials. Due to a limitation inside the render engine, it is not possible to obtain the same result by setting reflectance 0 to white. You always need to use a texture, even if it's just a 1x1 white image.

 

Mapping Textures

Maxwell automatically generates a UV set in which the V coordinate goes from 0 to 1 along the length (height) of each hair. When rendering as blades, the U coordinate goes from 0 to 1 along the width of each blade; when using cones, U is 0 everywhere. This UV set is placed in channel 0, so any textures you use in a material will use it implicitly. Since the set is generated, it doesn't depend on the mappings applied to the object that was used to place the hair. The following image is obtained by mapping a red to green gradient texture on the reflectance 0 of a material, using channel 0:

Root UVs are computed by taking the UV coordinate that the generator surface has at the location of each hair root. This UV set is placed in channel 1. To use it, open the Maxwell Image Controls rollup on the file texture node and set the UV Channel control to 1:

The two channels can be used at the same time to create interesting effects, such as using different textures for the root and the tip and interpolating between them. The Texturing hair and fur page in the Knowledge Base explains how to achieve this.

The Hair type of the Material Assistants adapts to this perfectly.

Do not forget to uncheck Export Vertex Colors when using color textures on the reflectance 0 slots of your hair materials. There are valid cases where you can use the two features together (e.g. setting up the vertex colors so that they provide some randomness across the hair mass and combining that with the color texture), but most of the time you just want the color textures to be rendered as they are, in which case the vertex colors must be turned off so they don't modulate the texture.