"Tutorial" (arno_hair_far_field version 1.9 (circular)) 
--------------------------------------------------------


(c) Arno Zinke 2004,05 arnozinke@gmx.de

The shader bases on a model proposed by Marschner et al. 2003 at SIGGRAPH. Its a full implementation
including lots of corrections (some formulae in the paper were wrong !). Note that this version is for
hair with a circular cross section only. However, another (slightly more complex) shader allowing for elliptical
cross sections is available (zinke@gfar.de)...


The shader computes the first three scattering components (highlights) for distant hair fibers & distant
light sources (compared to the hair radius):

1.) R: direct (white) reflection at surface
2.) TT: two times transmitted light (colored), very bright when lit from behind
3.) TRT: transimted - internally reflected - transmitted light (colored)









Definitions (see Marschner)
---------------------------

incoming/ outgoing inklination: angle between cross section plane and incoming light / outgoing view direction
incoming/ outgoing azimuth: angle between projected major_axis vector and projected incoming light / outgoing view direction
within the cross section plane



A brief description of the shader parameters:




parameter settings
------------------


parameter | typical values for human hair





shifts of the modes with respect to specular cone
-------------------------------------------------

For a perfect dielectric cylinder all these modes have an outgoing inklination to a plane perpendicular to 
the cross section, which is equal to the incoming one.
But since the hair surface is tiled, these highlights are shifted along th hair tangent by a small angle, R to hair tip
TT,TRT to hair root. 


float longitudinal_shift_R   | -3/180 * PI ... -7/180 * PI         
float longitudinal_shift_TT  | - 0.5 * longitudinal_shift_R 
float longitudinal_shift_TRT | - 1.5 * longitudinal_shift_R



longitudinal widths of the modes
--------------------------------

These parameters set the longitudinal width (to be more precise: 0.5/width^2) of each highlight lobe (modeled as Gaussians). 
The bigger the widths, the more prominent the highlight with respect to inclination. 

 
float longitudinal_width_R  | 0.5/width_R^2 			
float longitudinal_width_TT | 0.5/widht_TT^2            		
float longitudinal_width_TRT| 0.5/widht_TRT^2 				

with

width_R = 5/180 * PI ... 15/180 * PI
width_TT = 0.5 * width_R
width_TRT = 2 * width_R

Widht_R, Widht_TT,Widht_TRT are not parameters of the shader, they just denotes the "real" standard deviation of lobes. 



azimutal width of the caustic
-----------------------------

Caustics which occur for a perfect (TRT component) dielectric cylinder are smoothed by replacing them with a lobe.
The width of this lobe is defined by the azimutal_caustic_width parameter. The bigger this width,
the more prominent is this the caustic with respect to azimuth.


float azimutal_caustic_width | 7.5/180 * PI ... 25/180 * PI	



glint scale factor
------------------
This lobe is scaled by the glint_scale. The bigger this factor, the more prominent are the glints.

float glint_scale | 0.5 ... 5				


fade range of the caustic
-------------------------


Tells, how fast the caustic disapear. Should be set to 0.3.

float fade_range_caustic_merge		


intensity limit of the caustic
------------------------------

should be set to 0.5

float caustic_intensity_limit		

scale factors
-------------

To scale the intensity of each mode independently. These factors could be used for normalization purposes widht 
respect to the widthswidth_R,widht_TT,width_TRT (for the Gaussians: 1/(sqrt(2*PI)*width))

float scale_R   | 1/(sqrt(2*PI)*width_R)
float scale_TT  | 1.5/(sqrt(2*PI)*width_TT)					
float scale_TRT | 1/(sqrt(2*PI)*width_TRT)					

absolute absorption coefficients per unit length (for: red, green, blue)
------------------------------------------------------------------------

The absorption coefficients of the inner of the hair are responsible for the hair color.
They tell how much intensity is absorbted per unit length for every R,G,B channel
Small values make the hair colorlighter, big values darker.


vector absorption_coefficient | { 20 ... inf, 20 ... inf, 20 ... inf	}

brown hair: { 120,180,235} 	

diffuse color
-------------

The diffuse scattering color.It should be set with respect to the absorption coefficients: 
vector diffuse_color |{ exp(-1.5 * absorption_coefficient_r * hair_radius, exp(-1.5 * absorption_coefficient_g * hair_radius,exp(-1.5 * absorption_coefficient_b * hair_radius}



scale_diffuse
-----------------

Sets intensity of diffuse scattering.

float diffuse_intensity			



ambient color / scale_ambient 
---------------------------------

This is similar to the diffuse color / intensity, but for ambient illumination.

vector ambient_color


index of refraction ratio
-------------------------

The ratio between index of refractions inside the hair and surrounding medium (ior_inside/ior_outside)

float index_of_refraction_ratio | 1.55





opacity
-------

This is a quick hack for the opacity. Its modeled by the following expression:

Of = CLIP( {1.,1.,1.}-(opacity_factor*physically_based_transmission_coefficient+opacity_offset));


Here, CLIP denotes a function clipping undesired values >1,<0 for each component. Usually the opacity_offset is set to 
{0.,0.,0.} and the opacity_factor to 0.25.
In this case the opacity value is computed "fully physically based".

vector opacity_offset | {0.,0.,0.}
float opacity_factor | 0.25  


scale total
-----------

-Scales the total outgoing intensity to adapt it to the lighting



fade_phi_R,fade_phi_TT,fade_phi_TRT
-----------------------------------

Hard to explain... for experts only... :-)

float fade_phi | 0.0 - 1.0 (typically 0.8)

0.0 = perfect reflection (smooth glass)
1.0 = total diffuse reflection


If fade_phi_R=fade_phi_TT=fade_phi_TRT=0 this shader gives exactly the same results as version 1.5.


fiber cross section radius
--------------------------

Effective radius of the cross section:

float radius | 0.002 - 0.005 (typically 0.0035)




internal parameters
-------------------

Ratio between perpendicular and parallel polarized light, usually 0.5 (unpolarized)

float _per_par_polarization_ratio
 																															 																					
