mental ray XGen hair phenomenon

 
 
 

Use the xgen_hair_phen to easily customize the look of your hair via a single node.

NoteThis feature is only available when the mental ray Mayatomr.mll plug-in is loaded (Window > Settings/Preferences > Plug-in Manager).

To create the xgen_hair_phen, first select your object, then select the XGen Shelf and click to open the XGen Window. Click Create New Description and Create.

An xgen hair shading network has been created for you, and it consists of the xgen_hair_phong shader and the xgen_hair_phen. The xgen_hair_phen is connected to the xgen_hair_phong's Color and Ambient Color attributes.

The overall lighting equation is as follows:

ambient(Ac) + phongDiffuse(Dc, N) + phongSpecular(Sc1,cosPower1,N) + phongSpecular(Sc2,cosPower2,N) + phongDiffuse (Bc, inverted(N) ) + indirect

where N is the shading normal; Sc is the specular color; Ac is the ambient color, and Dc is the diffuse color.

To customize the look of your hair, use the attributes below. You can find these attributes in the xgen_hair_phen Attribute Editor.

Ambient Color
Set to black by default, which means it does not affect the xgen_hair_phong’s Color. As the Ambient Color becomes lighter, it affects the xgen_hair_phong’s Color by lightening it and blending the two colors. If there are ambient lights in the scene, the color and brightness of those lights is used to control how much the ambient color contributes to the final color of the material.
Tube Shade
Select this option so that the shading normal is modified to make flat hair look tubular.
Diffuse Color
Color for the diffuse component of the Phong illumination model. XGen can override this color on a per hair basis when adding the root_color and tip_color parameters in the XGen Custom Shader Parameters (in the XGen Window, Preview/Output tab). If only root_color is specified, each hair is colored using a single color. If both root_color and tip_color are specified, the hair color is interpolated from root_color at the root of the hair to tip_color at the tip of the hair.
Diffuse Root Tip Interp
Set this attribute to 0 for RGB interpolation mode and to 1 for HSL interpolation mode. When set to RGB (that is, 0), the color is interpolated on a per component basis. When set to HSL (that is, 1), the color is first converted to HSL color space, interpolated in that space, and converted back to RGB.
Diffuse Root Tip Gamma
A power function is applied to the position along the length of the hair while performing the interpolation. (The position value ranges from 0 at the root to 1 at the tip.) This helps move the center color to the tip or to the root depending on the desired effect.
Cosine Power/Specular Color
Set the first specular highlight using these values.
Cosine Power 2/Specular Color 2
Set the second specular highlight using these values.
Back Color
Back lighting is computed by inverting the surface normal before computing the diffuse.
Back Gamma
A power function is applied to the computed Back Color illumination. This helps to obtain a thinner or wider backlighting effect on the outer edge of surfaces.
Indirect
Include indirect lighting in the calculations.
Mode
Controls which lights to use.
  • 0 - Link selected lights in the scene to the shader. To select lights, connect the message attribute of spotLightShape to the lights[0] attribute of xgen_hair_phen. If no lights are selected, then use the instance light list; if no instance light list is specified, then use all lights in the scene.
  • 1 - Illumination using the specified lights in inclusive mode. Selected lights in the scene are linked to the shader. Instances of groups of light instances are evaluated to all light instances in the group.
  • 2 - Illumination using all lights in the scene except for the selected lights.
  • 4 - Illumination using all lights in the scene.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License