OpenShadingLanguage 1.01
# Compiled by oslc 1.6.2
volume desatdist	%meta{string,description,"Desaturate the appearance of distant objects"} 
param	float	extinctiondist	100		%meta{string,description,"Distance at which saturation decreases by 1/e"} %meta{float,UImin,0}  %read{5,5} %write{2147483647,-1}
param	float	mindist	0		%meta{string,description,"Minimum distance at which desaturation starts"} %meta{float,UImin,0}  %read{3,4} %write{2147483647,-1}
param	float	maxdist	1000000		%meta{string,description,"Maximum distance at which desaturation ends"} %meta{float,UImin,0}  %read{2,2} %write{2147483647,-1}
param	string	units	"common"		%meta{string,description,"Units used for distances"} %meta{string,UItype,"enum:common,km,m,cm,mm,mi,ft,in"}  %read{2147483647,-1} %write{2147483647,-1}
global	vector	I	%read{0,0} %write{2147483647,-1}
global	color	C	%read{6,10} %write{10,10}
local	float	Ilen	%read{2,4} %write{0,3}
local	float	d	%read{8,8} %write{5,5}
const	string	$const1	"clamp"		%read{1,1} %write{2147483647,-1}
temp	float	$tmp1	%read{3,3} %write{2,2}
temp	float	$tmp2	%read{5,5} %write{4,4}
temp	color	$tmp3	%read{10,10} %write{7,7}
temp	float	$tmp4	%read{7,7} %write{6,6}
temp	float	$tmp5	%read{10,10} %write{9,9}
temp	float	$tmp6	%read{9,9} %write{8,8}
code ___main___
# D:\\xrt.git\\src\\osl\\shaders\\desatdist.osl:70
#     Ilen = clamp (Ilen, mindist, maxdist);
	length		Ilen I 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\desatdist.osl"} %line{70} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\desatdist.osl:71
#     float d = (Ilen - mindist) / extinctiondist;
	functioncall	$const1 4 	%line{71} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:144
#     point  name (point x, float y) BUILTIN;     \
	min		$tmp1 Ilen maxdist 	%filename{"D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h"} %line{144} %argrw{"wrr"}
	max		Ilen $tmp1 mindist 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\desatdist.osl:72
#     C = mix (color(luminance(C)), C, exp(-d));
	sub		$tmp2 Ilen mindist 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\desatdist.osl"} %line{72} %argrw{"wrr"}
	div		d $tmp2 extinctiondist 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\desatdist.osl:73
# }
	luminance	$tmp4 C 	%line{73} %argrw{"wr"}
	assign		$tmp3 $tmp4 	%argrw{"wr"}
	neg		$tmp6 d 	%argrw{"wr"}
	exp		$tmp5 $tmp6 	%argrw{"wr"}
	mix		C $tmp3 C $tmp5 	%argrw{"wrrr"}
	end
