You can color spline primitives along their length by setting root and tip colors. To do this, use a custom shader parameter or connect an
xgen_root_tip_color_blend node to your hair shader. Root and tip colors appear in the rendered Description, but not in the XGen preview.
Color root and tip color using a custom shading parameter
- Click the
Preview/Output tab, and in the
Custom Shader Parameters section, do the following:
- In the space beside Name, type tip_color.
- From the drop-down list beside
Name, select
color.
- Click
to create the parameter.
The
tip_color parameter appears in the
Custom Shader Parameters.
- Repeat step
1 to create a parameter named
root_color.
Use an expression to add color for the tip and root color.
- Click this icon
beside the parameters to open the
XGen Expression Editor.
- In the
XGen Expression Editor, click the
Samples tab.
- Click the
+
beside
Global and then
+
beside
UI.
- From the expression list that appears, click a color-related expression such as
color_green.
- Click
Accept.
The
tip_color parameter is now set to green.
- Click the color swatch to set a new color.
- Repeat steps 4 to 8 for
root_color.
Note: If your
Customer Shader Parameters do not affect the rendered Description, you may need to delete the Descriptions xgmr:geoshader object. To do this, in the
Outliner, expand the Description until the
xgmr:geoshader object displays, then delete it. Rebuild the shading network by clicking
Setup
in the
mental ray Settings of the
Preview/Output tab. Render your Description again.
You can blend the root and tip colors using an expression. See
Render Description workflow examples.
Color root and tip using an
xgen_root_tip_color_blend node
Connecting an
xgen_root_tip_color_blend node to your hair shader lets you set hair root and tip color, and then output these colors as a single channel to the shader.
- In the
Hypergraph, select your XGen hair shader network.
- In the
Node Editor (
Window > Node Editor), display the shader node connections.
For information about displaying node connections, creating nodes, and connecting nodes, see
Node Editor basics.
- Create an
xgen_root_tip_color_blend node.
- Connect the node's
Output Value to a color channel input on your hair shader node.
- Double-click the
xgen_root_tip_color_blend node.
- In the node's
Attribute Editor, click the swatches beside
Root Color and
Tip Color to set colors.
- Render your Description with mental ray.
You can also apply a texture map to the root or tip color by connecting an
xgen_ptex_map_lookup node.
Apply a texture map to the root or tip color
- In the
Node Editor, double-click the
xgen_root_tip_color_blend node.
- In the node's
Attribute Editor, click the map
icon beside
Root Color or
Tip Color.
- In the
Hypershade, create an
xgen_ptex_lookup node.
- In the node's
Attribute Editor, click
beside
File Name and browse to the location of the Ptex map or texture file.
- Render your Description with mental ray.