Tutorial (arno_hair_far_field version 1.2) 
------------------------------------------


(c) Arno Zinke 2004 ,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 !).


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/(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: { 114,171,280} 	

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

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



diffuse intensity
-----------------

Sets intensity of diffuse scattering.

float diffuse_intensity | 0 .. 0.05			


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

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

float index_of_refraction_ratio | 1.55


_1_div_cos_max_theta
--------------------

This factor limits the intensity factor due to projection of the solid angle

float _1_div_cos_max_theta | 2 .. 10	




opacity
-------

This is a quick hack for the opacity. Its modeled as a linear falloff (controled by opacity factor) 
from opacity_offset:

opacity = 1. - (opacity_offset - opacity_factor * theta_r) * TT_color + diffuse_intensity * ({1.,1.,1.} - diffuse_color)


float opacity_offset | 0 (black) ... 0.7 (blond)
float opacity_factor | 0.55 * opacity_offset  



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

Effective radius of the cross section:

float radius | 0.002 - 0.005


eccentricity
------------

Eccentricity of the cross section (semi_minor / semi_major):

float eccentricity | 0.8 .. 1.0	(circular)			


hair tangent
------------

Local (unnormalized) fiber tangent direction (for hairs: points from root to top)

vector tangent

semi major axis vector
----------------------

An unnormalized direction of the local  semi major axis vector.
Basically a vector which is projected onto the local cross section plane
and then defines the semi major axis of a noncircular cross section
Not used if eccentricity = 1 (circular cross section).

vector major_axis


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

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

float _per_par_polarization_ratio
 																															 																					
