VEX hair shader 
arno_hair_far_field
																													
parametric far field hair / fiber shader:

- physically based (full implementation of Marschner et al. plus some additional corrections of the formulae)
- for hair with circular cross section (another version for elliptical cross sections is available !)
- distant viewer & distant light sources	
- includes three scattering components: 

R:   direct backward reflection (white)
TT:  one time forward transmitted (colored, very strong when there is a light source from behind)
TRT: backward transmitted-internal reflected-transmitted (colored)

Note:

All parameters passed to the shaders are local ("per vertex" + interpolation) parameters unlike the standard VEX hair shader.
Please let me know if you need a  per hair ("per primitive") version of this shader with tip / root parameter sets. 

history:	 
-------														

version 0.1 (3.01.05)
	first build 
version 1.0 (17.01.05)
	fixed: a_caustic: float -> vector
	fixed: caustic intensity estimation 
version 1.1 (21.01.05)
	fixed: opacity hack: theta_r -> abs(theta_r)
	fixed: opacity hack: linear interpolation instead of smooth(), opacity_offset 
version 1.2 (21.01.05)
	fixed: 1/theta_d instead of 1/_theta_d2 
	fixed: test if circular -> use dPds as major_axis vector
	problem: too bright spots in the R-component (from fresnel!)
version 1.3 (9.02.05)
	fixed: ambient illumination
	fixed: history :)
version 1.4 (14.03.05)
	fixed: removed n_TRT = set (0.,0.,0.)
	fixed: fresnel cos_theta = 0 -> return 1.
	fixed: opacity for each color component
	fixed: floating point consistency !!!!!!
version 1.4a (29.03.05)
	other opacity formula
version 1.5 
	"circular symmetric version"
	n_per_2
	new opacity formula
version 1.6
	scale_diffuse == diffuse_intensity
	scale_ambient == ambient_intensity
	scale_total
	fade_phi_R
	fade_phi_TT
	fade_phi_TRT
version 1.7
	cos^n instead fade_phi_R,TT,TRT
version 1.8
	removed: cos^n instead fade_phi_R,TT,TRT
	removed: n_per_2
version 1.9
	added floating point hack (limits ray density factor) to remove "bright spot" artifacts

	

copyright:
----------

All copyrights (c) 2004,05,06,07 Arno Zinke
Please do not modify without my permission !

contact:
--------

If you need support, or other sophisticated (simplified & ultra fast, more accurate, near field: for close-ups & light hair, GI)
fiber shaders, parameter settings or if you have any comments feel free to contact me... 

www.gfar.de
zinke@gfar.de
arnozinke@gmx.de
 

external parameters:
--------------------


matrial properties
------------------


//shifts of the modes with respect to specular cone
longitudinal_shift_R
longitudinal_shift_TT
longitudinal_shift_TRT

// width of the modes
// to be more precise: 0.5/(width*width)
longitudinal_width_R			
longitudinal_width_TT			
longitudinal_width_TRT			

// glint scale factor
glint_scale					

// azimutal width of the caustic
azimutal_caustic_width		

// fade range of the caustic
fade_range_caustic_merge		

// intensity limit of the caustic
caustic_intensity_limit		

// to scale the intensity of each mode independently
// these factors could be used for normalization purposes widht respect to the widths (for the Gaussians: 1/(sqrt(2*PI)*width))
scale_R
scale_TT					
scale_TRT					

// absolute absorption coefficients per unit length (for: red, green, blue)
float absorption_coefficient_r		
float absorption_coefficient_g		
float absorption_coefficient_b		

// diffuse color
// could be set with respect to absorption coefficients: exp(-1.5*absorption*radius)
diffuse_color

// diffuse intensity
scale_diffuse			

// ambient color
// could be set with respect to absorption coefficients: exp(-2.*absorption*radius)
ambient_color

//ambient intensity
scale_ambient

//total scale
scale_total

//azimuthal fading

fade_phi_R
fade_phi_TT
fade_phi_TRT

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

// factor for opacity correction
opacity_factor

// offset for opacity correction
opacity_offset

geometrical properties
----------------------

// fiber cross section radius
radius
			






			

 																															 																					
