Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Section
Column
width45%

The Hair Sampler is an utility node that provides extra output options which can be used when shading hair.

Used with the Hair Next node, this node allows you to map color, incandescence, and transparency along the length of a hair strand, as well as the ability to randomize such properties on a per-strand basis to create stunning hair looks.

Column
width5%

 

Column
width50%

 

Parameters

...

 

Section
Column
width55%

Hair Max Distance – Allows the user to set the max strand length when using Distance Along Strand Absolute. Typically, this value should be equal to the longest strand of hair. This option is mappable, allowing different parts in a hair system to have different max lengths.

Column
width5%

 

Column
width40%

 Image Added

 

Examples

...

 

Random by Strand

 

The Hair Sampler node is set up by connecting an output from to a 2D driven texture (Color to UVW); most commonly a ramp. This example shows Hair Sampler's Random By Strand attribute to control the V channel of Color to UVW, connected to a Ramp node. The Ramp's output is connected to a VRayHairNextMtl's Dye Color parameter.

 

Section
Column
width5%

 

Column
width45%

Image Added

The Ramp is driven by the Random By Strand parameter.
The ramp is connected to the Hair Next Dye Color.

Column
width5%

 

Column
width45%

Image Added

Resulting render

 

...

 

Distance Along Strand

 

Here, Hair Sampler is used to create variation in the color along the length of a hair strand to give hair a more natural look. This is done by using the Hair Sampler's Distance Along Strand attribute to control the V channel of a Color to UVW, connected to a Ramp node. The Ramp's output is connected to a Hair Next 's Dye Color parameter. Note that the full ramp is mapped along each strand regardless of the strand's length.

 

Section
Column
width5%

 

Column
width45%

Image Added

The ramp is driven by the Distance Along Strand parameter through a Color to UVW node.
The ramp is connected to the Hair Next's Dye Color.

Column
width5%

 

Column
width45%

Image Added

Resulting Render

 

...

 

Distance Along Strand Absolute

 

This example uses the Hair Sampler's Distance Along Strand Absolute output. Similar to the previous example, it controls the V channel of a Color to UVW that is then connected to a Ramp. The Ramp is connected to a Hair Next's Dye Color parameter. However, this node uses the Hair Max Distance to allow length-dependent mapping. The renders below use the same setup and ramp but with different Hair Max Distance values. Note that when Hair Max Distance is lower than the actual length of the hair strand, the gradient is repeated over the length of the hair strand.

 

Section
Column
width5%

 

Column
width45%

Image Added

The ramp is driven by the Distance Along Strand Absolute parameter through a Color to UVW node.
The ramp is connected to the Hair Next's Dye Color.

Column
width5%

 

Column
width45%
Before after
afterLabel25cm
darktrue
beforeLabel10cm
Panel
borderStylenone

Image Added

Panel
borderStylenone

Image Added

 

...

 

Position Across Strand

 

This final example uses the Hair Sampler's Position Across Strand option. Unlike the previous examples, it controls the U channel of Color to UVW node, connected to a ramp. The Ramp is connected to a Hair Next's Transparency parameter. Note how the hair color looks more transparent to the sides of each hair compared to the other render which did not use a ramp.

 

Section
Column
width5%

 

Column
width45%

Image Added

The ramp is driven by the Position Across Strand parameter.
The ramp is connected to the Hair Next's Transparency.

Column
width5%

 

Column
width45%
Before after
afterLabelwith
beforeLabelwithout
Panel
borderStylenone

Image Added

Panel
borderStylenone

Image Added