W Coordinate


The W Coordinate texture can access the OctaneRender® W Coordinate System, which can place Gradients on hair geometry. The hair geometry stores an inherent Hair Gradient Interpolation along with hair data exported from 3D modeling applications. W is an attribute of the Mesh node, which defines a coordinate for every hair vertex per strand. This attribute is loaded from an AlembicAn open format used to bake animated scenes for easy transfer between digital content creation tools. file input. However, if the attribute is not in the Alembic file, OctaneRender® creates the coordinates per strand. OctaneRender® uses the resulting vertex coordinates to distribute a gradient per strand, and the gradient interpolation is based on settings in the Preferences pane's Import tab.

Figure 1: Import tab settings for the Hair Gradient Interpolation


To use the W attribute for applying gradient colors to the hair data, you must plug a W Coordinate texture as the Input of an OctaneRender® Gradient. This tells OctaneRender® to render the inputs as a Gradient mapping, and OctaneRender® uses the specified Gradient interpolation to distribute the gradient. This is based on either the hair length or the segment count per strand, depending on what is set in the Import tab for hair geometry.

Figure 2: Gradient texture nodes with and without W Coordinates


For example, if the hair strand has three segments and each segment is a different length, the Hair Length option distributes the W evenly from root to tip. Segment Count distributes the W independent of the segment lengths, so the first segment goes from 0 to 1/3, the second segment goes from 1/3 to 2/3, and the last segment goes from 2/3 to 1.

Figure 3: Hair segmentation and length


Figure 4: Hair Segment Interpolation


Figure 5: Hair Length Interpolation