OpenShadingLanguage 1.01
# Compiled by oslc 1.6.2
light linearlight%emit{1}
param	float	intensity	1		%read{22,22} %write{2147483647,-1}
param	color	lightcolor	1 1 1		%read{22,22} %write{2147483647,-1}
param	float	falloff	2		%read{23,23} %write{2147483647,-1}
param	point	point1	0 0 0		%read{2,15} %write{0,0} %derivs %initexpr
param	point	point2	1 0 0		%read{2,2} %write{1,1} %derivs %initexpr
param	float	samples	16		%read{11,31} %write{2147483647,-1} %derivs
oparam	float	__nonspecular	1		%read{8,8} %write{2147483647,-1}
global	normal	N	%read{3,3} %write{2147483647,-1} %derivs
global	point	Ps	%read{5,26} %write{2147483647,-1} %derivs
global	color	Cl	%read{29,31} %write{29,31}
local	vector	dir	%read{14,14} %write{2,2} %derivs
local	float	i	%read{9,30} %write{9,30} %derivs
local	vector	Nn	%read{5,19} %write{3,3} %derivs
local	float	offset	%read{12,12} %write{4,4} %derivs
local	point	p	%read{6,30} %write{5,30} %derivs
local	vector	___293_l	%read{9,30} %write{9,30}
local	float	___293_dist	%read{9,30} %write{9,30}
local	vector	___293_ln	%read{9,30} %write{9,30}
local	float	___293_dot	%read{9,30} %write{9,30}
local	color	___294_c	%read{9,30} %write{9,30}
const	string	$const1	"shader"		%read{0,1} %write{2147483647,-1}
const	int	$const2	0		%read{10,20} %write{2147483647,-1}
const	float	$const3	0		%read{0,1} %write{2147483647,-1}
const	float	$const5	1		%read{1,30} %write{2147483647,-1}
temp	int	$tmp1	%read{7,7} %write{6,6}
const	string	$const6	"__nonspecular"		%read{8,8} %write{2147483647,-1}
temp	int	$tmp2	%read{9,30} %write{9,30}
temp	float	$tmp3	%read{13,13} %write{12,12} %derivs
temp	float	$tmp4	%read{14,14} %write{13,13} %derivs
temp	vector	$tmp5	%read{15,15} %write{14,14} %derivs
temp	int	$tmp6	%read{21,21} %write{20,20}
temp	float	$tmp7	%read{25,25} %write{24,24}
temp	float	$tmp8	%read{24,24} %write{23,23}
temp	color	$tmp9	%read{27,27} %write{26,26}
code point1
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:14
#     point point2 = point ("shader", 1,0,0),   /* other end of line */
	point		point1 $const1 $const3 $const3 $const3 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl"} %line{14} %argrw{"wrrrr"}
code point2
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:15
#     float samples = 16,   /* number of sample points on the light source */
	point		point2 $const1 $const5 $const3 $const3 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl"} %line{15} %argrw{"wrrrr"}
code ___main___
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:20
#     float i;
	sub		dir point2 point1 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl"} %line{20} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:22
#     float offset = random();
	normalize	Nn N 	%line{22} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:23
# 
	random		offset 	%line{23} %argrw{"w"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:25
# 
	add		p Ps Nn 	%line{25} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:47
# }
	emit		$tmp1 p 	%line{47} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:27
# 		setmessage ("__nonspecular", __nonspecular);
	if		$tmp1 32 32 	%line{27} %argrw{"r"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:28
#         for (i = 0; i < samples; i += 1)  {
	setmessage	$const6 __nonspecular 	%line{28} %argrw{"rr"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:29
#             /* Compute point p on line segment between point1 and point2 */
	for		$tmp2 11 12 30 31 	%line{29} %argrw{"r"}
	assign		i $const2 	%argrw{"wr"}
	lt		$tmp2 i samples 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:31
#             /* Compute distance from point p to surface point Ps */
	add		$tmp3 i offset 	%line{31} %argrw{"wrr"}
	div		$tmp4 $tmp3 samples 	%argrw{"wrr"}
	mul		$tmp5 $tmp4 dir 	%argrw{"wrr"}
	add		p point1 $tmp5 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:33
#             float dist = length(l);
	sub		___293_l p Ps 	%line{33} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:34
#             vector ln = l / dist;
	length		___293_dist ___293_l 	%line{34} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:35
#             /* Compute light from point p to surface point Ps */
	div		___293_ln ___293_l ___293_dist 	%line{35} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:37
#             if (dot > 0) {
	dot		___293_dot ___293_ln Nn 	%line{37} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:38
# 	        color c = intensity * lightcolor;
	gt		$tmp6 ___293_dot $const2 	%line{38} %argrw{"wrr"}
	if		$tmp6 30 30 	%argrw{"r"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:39
#                 c *= pow(dist, -falloff);   /* distance falloff */
	mul		___294_c intensity lightcolor 	%line{39} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:40
# 	        c *= transmission(Ps, p);   /* ray traced occlusion (shadow) */
	neg		$tmp8 falloff 	%line{40} %argrw{"wr"}
	pow		$tmp7 ___293_dist $tmp8 	%argrw{"wrr"}
	mul		___294_c ___294_c $tmp7 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:41
#                 c *= dot;   /* Lambert's cosine law at the surface */
	transmission	$tmp9 Ps p 	%line{41} %argrw{"wrr"} %argderivs{1,2}
	mul		___294_c ___294_c $tmp9 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:42
#                 Cl += c; 
	mul		___294_c ___294_c ___293_dot 	%line{42} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:43
#             }
	add		Cl Cl ___294_c 	%line{43} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:29
#             /* Compute point p on line segment between point1 and point2 */
	add		i i $const5 	%line{29} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\linearlight.osl:46
#     }
	div		Cl Cl samples 	%line{46} %argrw{"wrr"}
	end
