...
The angle of the scales which form the surface of the hair fiber, in radians. It affects the position of the highlight on the strand. This will typically be in the range of -0.05 to -0.1 radians for human hair (negative to tilt towards the root). Note that the final position is computed from this angle differently for each lobe so using the same value for all lobes will produce distinct highlights.
A very basic OSL hair shader is presented below.
| Code Block |
|---|
#include "3delightosl.h"
surface basic_hair(
color absorption = 1 - color( 0.99, 0.8, 0.6 ),
float weight[3] = { 1, 1, 1 },
float roughness[3] = { 0.03, 0.4, 0.6 },
float highlight_position[3] = { 0.05, 0.05, 0.05 }
)
{
closure color hair_ci =
hair(
dPdv, 1.55, absorption,
weight[0] * hair_component( "R", roughness[0], roughness[0], -highlight_position[0] ) +
weight[1] * hair_component( "TT", roughness[1], roughness[1], -highlight_position[1] ) +
weight[2] * hair_component( "TRT", roughness[2], roughness[2], -highlight_position[2] )
);
Ci = hair_ci;
} |