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 ().
To create the xgen_hair_phen, first select your object, then select the XGen Shelf and click to open the . Click and .
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 and 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 .
-
-
Set to black by default, which means it does not affect the xgen_hair_phong’s . As the becomes lighter, it affects the xgen_hair_phong’s 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.
-
-
Select this option so that the shading normal is modified to make flat hair look tubular.
-
-
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 (in the XGen Window, 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.
-
-
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.
-
-
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.
- /
-
Set the first specular highlight using these values.
- /
-
Set the second specular highlight using these values.
-
-
Back lighting is computed by inverting the surface normal before computing the diffuse.
-
-
A power function is applied to the computed illumination. This helps to obtain a thinner or wider backlighting effect on the outer edge of surfaces.
-
-
Include indirect lighting in the calculations.
-
-
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.
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License