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