Go to: Related nodes. Attributes.

HairTubeShader simulates a thin tube, where the width of the tube is small enough that local shading effects can be ignored. The surface normal of the tube is ignored and all shading derives from the view and the tube direction. The direction of the tube is assumed to be either the u or the v tangent. Because the highlights are spread across the entire tube width, the render of objects like fine hairs do not require as high antialiasing levels as one would need using shaders like Blinn or Phong.

Aside from the attributes described here, the Anisotropic shader inherits many attributes from its parents Reflect and Lambert. The lambert portion of this shading is defined with translucence and no diffuse to better handle hair shading.

In the table below, important attribute have their names indicated in bold in the description column.

This node is MP safe

Node nameParentsClassificationMFn typeCompatible function sets
hairTubeShaderreflectshader/surface:drawdb/shader/surface/hairTubeShaderkHairTubeShaderkBase
kNamedObject
kDependencyNode
kLambert
kReflect
kHairTubeShader

Related nodes

lambert, reflect, phongE, phong, blinn, volumeShader, simpleVolumeShader, surfaceShader, displacementShader, layeredShader, useBackground, defaultShaderList, shadingMap

Attributes (23)

colorScale, colorScale_Color, colorScale_ColorB, colorScale_ColorG, colorScale_ColorR, colorScale_Interp, colorScale_Position, scatter, scatterPower, specularPower, specularShift, tangentUCamera, tangentUCameraX, tangentUCameraY, tangentUCameraZ, tangentVCamera, tangentVCameraX, tangentVCameraY, tangentVCameraZ, tubeDirection, uCoord, uvCoord, vCoord

Long name (short name)TypeDefaultFlags
tangentUCamera (utan) float3outputinputconnectable
u-tangent at sample point
tangentUCameraX (utnx) float1.0outputinputconnectable
u-tangent x value
tangentUCameraY (utny) float1.0outputinputconnectable
u-tangent y value
tangentUCameraZ (utnz) float1.0outputinputconnectable
u-tangent z value
tangentVCamera (vtan) float3outputinputconnectable
v-tangent at sample point
tangentVCameraX (vtnx) float1.0outputinputconnectable
v-tangent x value
tangentVCameraY (vtny) float1.0outputinputconnectable
v-tangent y value
tangentVCameraZ (vtnz) float1.0outputinputconnectable
v-tangent z value
uvCoord (uv) float20.0, 0.0outputinputconnectable
The UV coords of the current sample point
uCoord (uvu) float0.0outputinputconnectable
The u component of the current sample position
vCoord (uvv) float0.0outputinputconnectable
The v component of the current sample position
tubeDirection (tdr) enum0outputinputconnectablestorablekeyable
The shading assumes that the primary direction of the tube lines up with either the U or V parameterization. This parameter should be set to match the tube for correct shading. 0 - The U tangent defines the primary tube axis 1 - The V tangent defines the primary tube axis
colorScale (cls) compoundn/aarrayoutputinputconnectablestorablekeyable
This scales, or multiplies, the base color of the surface. This allows one to vary the color from root to tip of hair tubes. The ramp is mapped along U or V of the surface depending on the tube direction attribute.
colorScale_Position (clsp) float0.0outputinputconnectablestorablekeyable
Position of ramp value on normalized 0-1 scale
colorScale_Color (clsc) float3outputinputconnectablestorablekeyable
Ramp color at the sibling position
colorScale_ColorR (clscr) float0.0outputinputconnectablestorablekeyable
Ramp red channel value at the sibling position
colorScale_ColorG (clscg) float0.0outputinputconnectablestorablekeyable
Ramp green channel value at the sibling position
colorScale_ColorB (clscb) float0.0outputinputconnectablestorablekeyable
Ramp blue channel value at the sibling position
colorScale_Interp (clsi) enum0outputinputconnectablestorablekeyable
Ramp Interpolation controls the way the intermediate values are calculated. The values are:
    None: No interpolation is done; the different colors just show up as different bands in the final texture.

    Linear: The values are interpolated linearly in RGB color space.

    Smooth: The values are interpolated along a bell curve, so that each color on the ramp dominates the region around it, then blends quickly to the next color.

    Spline: The values are interpolated with a spline curve, taking neighboring indices into account for greater smoothness.

specularPower (sp) float20.0outputinputconnectablestorablekeyable
Specular Power is used to control the "tightness" of the specular highlights (also called 'hot spots') on the surface. The minimum value is 2. The higher the value, the more tighly focussed (smaller) is the highlight, simulating smoother hair.
specularShift (ssh) float5.0outputinputconnectablestorablekeyable
Specular Shift is used to control the offset of the specular highlight along the tube. This models the way hairs are composed of conical segments, somewhat like a Chinese pagoda. As a result the surface is not exactly parallel to the tube direction, which results in a slight shift of the highlight. The units represent degrees of incline relative to the primary tube direction.
scatterPower (scp) float5.0outputinputconnectablestorablekeyable
Scatter Power is used to control the "tightness" of the highlights caused by light bouncing around inside hair tubes. These highlights pick up the color of the hair. The higher the value, the more tighly focussed (smaller) is the highlight, simulating smoother hair. For best results this value should be lower than the specular power.
scatter (sct) float0.2outputinputconnectablestorablekeyable
Scatter controls how much specular interscattering occurs within the hair, where the light bounces inside the simulated hair and emerges like a spread out colored highlight. This is like a broad specular highlight that picks up the surface color, and the effect is particularily noticable in brown hair, where one sees large brown highlight regions. The general diffuse contribution is near black outside these regions.