OpenShadingLanguage 1.01
# Compiled by oslc 1.6.2
light spherelight%emit{1}
param	float	intensity	1		%read{42,42} %write{2147483647,-1}
param	color	lightcolor	1 1 1		%read{42,42} %write{2147483647,-1}
param	float	falloff	2		%read{43,43} %write{2147483647,-1}
param	point	from	0 0 0		%read{35,35} %write{0,0} %derivs %initexpr
param	float	radius	1		%read{34,34} %write{2147483647,-1} %derivs
param	float	samples	16		%read{1,3} %write{2147483647,-1} %derivs
oparam	float	__nonspecular	1		%read{9,9} %write{2147483647,-1}
global	normal	N	%read{5,6} %write{2147483647,-1} %derivs
global	point	Ps	%read{6,46} %write{2147483647,-1} %derivs
global	color	Cl	%read{49,53} %write{49,53}
local	float	anglesamples	%read{3,52} %write{2,2} %derivs
local	float	zsamples	%read{12,52} %write{4,4} %derivs
local	float	i	%read{10,51} %write{10,51} %derivs
local	float	j	%read{10,51} %write{10,51} %derivs
local	color	c	%read{10,51} %write{10,51}
local	vector	l	%read{10,51} %write{10,51}
local	vector	ln	%read{10,51} %write{10,51}
local	vector	Nn	%read{39,39} %write{5,5}
local	point	p	%read{7,51} %write{6,51} %derivs
local	float	angle	%read{10,51} %write{10,51} %derivs
local	float	z	%read{10,51} %write{10,51} %derivs
local	float	r	%read{10,51} %write{10,51} %derivs
local	float	dist	%read{10,51} %write{10,51}
local	float	___295_dot	%read{10,51} %write{10,51}
const	string	$const1	"shader"		%read{0,0} %write{2147483647,-1}
const	int	$const2	0		%read{11,40} %write{2147483647,-1}
const	float	$const3	0		%read{0,0} %write{2147483647,-1}
temp	float	$tmp1	%read{2,2} %write{1,1} %derivs
temp	float	$tmp2	%read{4,4} %write{3,3} %derivs
temp	int	$tmp3	%read{8,8} %write{7,7}
const	string	$const4	"__nonspecular"		%read{9,9} %write{2147483647,-1}
temp	int	$tmp4	%read{10,51} %write{10,51}
temp	int	$tmp5	%read{13,50} %write{13,50}
const	float	$const6	3.1415927		%read{16,16} %write{2147483647,-1}
temp	float	$tmp6	%read{19,19} %write{16,16} %derivs
const	float	$const7	2		%read{16,24} %write{2147483647,-1}
temp	float	$tmp7	%read{18,18} %write{17,17} %derivs
temp	float	$tmp8	%read{19,19} %write{18,18} %derivs
temp	float	$tmp9	%read{20,20} %write{19,19} %derivs
temp	float	$tmp10	%read{22,22} %write{21,21} %derivs
temp	float	$tmp11	%read{23,23} %write{22,22} %derivs
temp	float	$tmp12	%read{25,25} %write{24,24} %derivs
const	float	$const9	1		%read{25,51} %write{2147483647,-1}
temp	float	$tmp13	%read{27,27} %write{26,26} %derivs
temp	float	$tmp14	%read{28,28} %write{27,27} %derivs
temp	vector	$tmp15	%read{34,34} %write{33,33} %derivs
temp	float	$tmp16	%read{30,30} %write{29,29} %derivs
temp	float	$tmp17	%read{33,33} %write{30,30} %derivs
temp	float	$tmp18	%read{32,32} %write{31,31} %derivs
temp	float	$tmp19	%read{33,33} %write{32,32} %derivs
temp	vector	$tmp20	%read{35,35} %write{34,34} %derivs
temp	int	$tmp21	%read{41,41} %write{40,40}
temp	float	$tmp22	%read{45,45} %write{44,44}
temp	float	$tmp23	%read{44,44} %write{43,43}
temp	color	$tmp24	%read{47,47} %write{46,46}
temp	float	$tmp25	%read{53,53} %write{52,52}
code from
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:15
#     float radius = 1,   /* radius of sphere */
	point		from $const1 $const3 $const3 $const3 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl"} %line{15} %argrw{"wrrrr"}
code ___main___
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:21
#     float zsamples = floor(samples/anglesamples);
	sqrt		$tmp1 samples 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl"} %line{21} %argrw{"wr"}
	floor		anglesamples $tmp1 	%argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:22
#     float i, j;
	div		$tmp2 samples anglesamples 	%line{22} %argrw{"wrr"}
	floor		zsamples $tmp2 	%argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:25
#     point p = Ps + N;   /* point above Ps to get N.L = 1 in surf. shader */
	normalize	Nn N 	%line{25} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:26
#     float angle, z, r, dist;
	add		p Ps N 	%line{26} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:57
# }
	emit		$tmp3 p 	%line{57} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:29
# 		setmessage ("__nonspecular", __nonspecular);
	if		$tmp3 54 54 	%line{29} %argrw{"r"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:30
#         for (j = 0; j < zsamples; j += 1)  {
	setmessage	$const4 __nonspecular 	%line{30} %argrw{"rr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:31
#             for (i = 0; i < anglesamples; i += 1)  {
	for		$tmp4 12 13 51 52 	%line{31} %argrw{"r"}
	assign		j $const2 	%argrw{"wr"}
	lt		$tmp4 j zsamples 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:32
#                 /* Compute stratified random angle in [0,2pi] */
	for		$tmp5 15 16 50 51 	%line{32} %argrw{"r"}
	assign		i $const2 	%argrw{"wr"}
	lt		$tmp5 i anglesamples 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:34
# 	        /* Compute stratified random z in [-1,1] */
	mul		$tmp6 $const7 $const6 	%line{34} %argrw{"wrr"}
	random		$tmp7 	%argrw{"w"}
	add		$tmp8 i $tmp7 	%argrw{"wrr"}
	mul		$tmp9 $tmp6 $tmp8 	%argrw{"wrr"}
	div		angle $tmp9 anglesamples 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:36
#                 z = 2 * z - 1;
	random		$tmp10 	%line{36} %argrw{"w"}
	add		$tmp11 j $tmp10 	%argrw{"wrr"}
	div		z $tmp11 zsamples 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:37
#                 /* Compute point p on sphere */
	mul		$tmp12 $const7 z 	%line{37} %argrw{"wrr"}
	sub		z $tmp12 $const9 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:39
#                 p = from + radius * vector(r * cos(angle), r * sin(angle), z);
	mul		$tmp13 z z 	%line{39} %argrw{"wrr"}
	sub		$tmp14 $const9 $tmp13 	%argrw{"wrr"}
	sqrt		r $tmp14 	%argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:40
#                 /* Compute distance from point p to surface point Ps */
	cos		$tmp16 angle 	%line{40} %argrw{"wr"}
	mul		$tmp17 r $tmp16 	%argrw{"wrr"}
	sin		$tmp18 angle 	%argrw{"wr"}
	mul		$tmp19 r $tmp18 	%argrw{"wrr"}
	vector		$tmp15 $tmp17 $tmp19 z 	%argrw{"wrrr"}
	mul		$tmp20 radius $tmp15 	%argrw{"wrr"}
	add		p from $tmp20 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:42
#                 dist = length(l);
	sub		l p Ps 	%line{42} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:43
#                 ln = l / dist;
	length		dist l 	%line{43} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:44
#                 /* Compute light from point p to surface point Ps */
	div		ln l dist 	%line{44} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:46
# 	        if (dot > 0) {
	dot		___295_dot ln Nn 	%line{46} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:47
#                     c = intensity * lightcolor;
	gt		$tmp21 ___295_dot $const2 	%line{47} %argrw{"wrr"}
	if		$tmp21 50 50 	%argrw{"r"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:48
#                     c *= pow(dist, -falloff);   /* distance falloff */
	mul		c intensity lightcolor 	%line{48} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:49
#                     c *= transmission(Ps, p);   /* ray traced occlusion */
	neg		$tmp23 falloff 	%line{49} %argrw{"wr"}
	pow		$tmp22 dist $tmp23 	%argrw{"wrr"}
	mul		c c $tmp22 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:50
#                     c *= dot;   /* Lambert's cosine law at the surface */
	transmission	$tmp24 Ps p 	%line{50} %argrw{"wrr"} %argderivs{1,2}
	mul		c c $tmp24 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:51
#                     Cl += c;
	mul		c c ___295_dot 	%line{51} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:52
#                 }
	add		Cl Cl c 	%line{52} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:32
#                 /* Compute stratified random angle in [0,2pi] */
	add		i i $const9 	%line{32} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:31
#             for (i = 0; i < anglesamples; i += 1)  {
	add		j j $const9 	%line{31} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spherelight.osl:56
#     }
	mul		$tmp25 zsamples anglesamples 	%line{56} %argrw{"wrr"}
	div		Cl Cl $tmp25 	%argrw{"wrr"}
	end
