OpenShadingLanguage 1.01
# Compiled by oslc 1.6.2
light cylinderlight%emit{1}
param	float	intensity	1		%read{52,52} %write{2147483647,-1}
param	color	lightcolor	1 1 1		%read{52,52} %write{2147483647,-1}
param	float	falloff	2		%read{53,53} %write{2147483647,-1}
param	float	zmin	0		%read{2,40} %write{2147483647,-1} %derivs
param	float	zmax	1		%read{2,38} %write{2147483647,-1} %derivs
param	float	radius	1		%read{3,44} %write{2147483647,-1} %derivs
param	float	samples	16		%read{6,16} %write{2147483647,-1} %derivs
oparam	float	__nonspecular	1		%read{23,23} %write{2147483647,-1}
global	normal	N	%read{1,1} %write{2147483647,-1} %derivs
global	point	Ps	%read{18,56} %write{2147483647,-1} %derivs
global	color	Cl	%read{59,63} %write{59,63}
local	float	anglesamples	%read{16,62} %write{6,15} %derivs
local	float	zsamples	%read{26,62} %write{7,17} %derivs
local	float	i	%read{24,61} %write{24,61} %derivs
local	float	j	%read{24,61} %write{24,61} %derivs
local	color	c	%read{24,61} %write{24,61}
local	color	cl	%read{2147483647,-1} %write{0,0}
local	vector	l	%read{24,61} %write{24,61}
local	vector	ln	%read{24,61} %write{24,61}
local	vector	Nn	%read{18,49} %write{1,1} %derivs
local	point	p	%read{20,61} %write{18,61} %derivs
local	float	angle	%read{24,61} %write{24,61} %derivs
local	float	z	%read{24,61} %write{24,61} %derivs
local	float	dist	%read{24,61} %write{24,61}
local	float	LdotN	%read{24,61} %write{24,61}
const	int	$const1	0		%read{0,50} %write{2147483647,-1}
temp	float	$tmp1	%read{4,4} %write{2,2}
const	float	$const2	0.2		%read{3,3} %write{2147483647,-1}
temp	float	$tmp2	%read{4,4} %write{3,3}
temp	int	$tmp3	%read{5,5} %write{4,4}
const	int	$const3	1		%read{7,12} %write{2147483647,-1}
temp	float	$tmp4	%read{10,10} %write{8,8}
temp	float	$tmp5	%read{10,10} %write{9,9}
const	float	$const5	5		%read{9,9} %write{2147483647,-1}
temp	int	$tmp6	%read{11,11} %write{10,10}
temp	float	$tmp7	%read{15,15} %write{14,14} %derivs
temp	float	$tmp8	%read{17,17} %write{16,16} %derivs
temp	int	$tmp9	%read{22,22} %write{21,21}
temp	point	$tmp10	%read{21,21} %write{20,20}
const	string	$const6	"shader"		%read{20,45} %write{2147483647,-1}
const	string	$const7	"transform"		%read{19,19} %write{2147483647,-1}
const	string	$const8	"common"		%read{20,20} %write{2147483647,-1}
const	string	$const9	"__nonspecular"		%read{23,23} %write{2147483647,-1}
temp	int	$tmp11	%read{24,61} %write{24,61}
temp	int	$tmp12	%read{27,60} %write{27,60}
const	float	$const11	3.1415927		%read{30,30} %write{2147483647,-1}
temp	float	$tmp13	%read{33,33} %write{30,30} %derivs
const	float	$const12	2		%read{30,30} %write{2147483647,-1}
temp	float	$tmp14	%read{32,32} %write{31,31} %derivs
temp	float	$tmp15	%read{33,33} %write{32,32} %derivs
temp	float	$tmp16	%read{34,34} %write{33,33} %derivs
temp	float	$tmp17	%read{36,36} %write{35,35} %derivs
temp	float	$tmp18	%read{37,37} %write{36,36} %derivs
temp	float	$tmp19	%read{39,39} %write{38,38} %derivs
temp	float	$tmp20	%read{40,40} %write{39,39} %derivs
temp	float	$tmp21	%read{42,42} %write{41,41} %derivs
temp	float	$tmp22	%read{45,45} %write{42,42} %derivs
temp	float	$tmp23	%read{44,44} %write{43,43} %derivs
temp	float	$tmp24	%read{45,45} %write{44,44} %derivs
temp	int	$tmp25	%read{51,51} %write{50,50}
temp	float	$tmp26	%read{55,55} %write{54,54}
temp	float	$tmp27	%read{54,54} %write{53,53}
temp	color	$tmp28	%read{57,57} %write{56,56}
const	float	$const13	1		%read{60,61} %write{2147483647,-1}
temp	float	$tmp29	%read{63,63} %write{62,62}
code ___main___
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:25
#     vector l, ln, Nn = normalize(N);
	assign		cl $const1 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl"} %line{25} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:26
#     point p;
	normalize	Nn N 	%line{26} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:32
#         anglesamples = samples;
	sub		$tmp1 zmax zmin 	%line{32} %argrw{"wrr"}
	mul		$tmp2 $const2 radius 	%argrw{"wrr"}
	lt		$tmp3 $tmp1 $tmp2 	%argrw{"wrr"}
	if		$tmp3 8 18 	%argrw{"r"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:33
#         zsamples = 1;
	assign		anglesamples samples 	%line{33} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:34
#     } else if (zmax - zmin > 5 * radius) { /* cylinder is rather skinny */
	assign		zsamples $const3 	%line{34} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:35
#         anglesamples = 1;
	sub		$tmp4 zmax zmin 	%line{35} %argrw{"wrr"}
	mul		$tmp5 $const5 radius 	%argrw{"wrr"}
	gt		$tmp6 $tmp4 $tmp5 	%argrw{"wrr"}
	if		$tmp6 14 18 	%argrw{"r"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:36
#         zsamples = samples;
	assign		anglesamples $const3 	%line{36} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:37
#     } else { /* cylinder neither flat nor skinny */
	assign		zsamples samples 	%line{37} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:39
#         zsamples = floor(samples/anglesamples);
	sqrt		$tmp7 samples 	%line{39} %argrw{"wr"}
	floor		anglesamples $tmp7 	%argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:40
#     }
	div		$tmp8 samples anglesamples 	%line{40} %argrw{"wrr"}
	floor		zsamples $tmp8 	%argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:43
# 
	add		p Ps Nn 	%line{43} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:45
# 		setmessage ("__nonspecular", __nonspecular);
	functioncall	$const7 21 	%line{45} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:249
# void fresnel (vector I, normal N, float eta,
	transform	$tmp10 $const8 $const6 p 	%filename{"D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h"} %line{249} %argrw{"wrrr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:72
# }
	emit		$tmp9 $tmp10 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl"} %line{72} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:45
# 		setmessage ("__nonspecular", __nonspecular);
	if		$tmp9 64 64 	%line{45} %argrw{"r"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:46
#         for (j = 0; j < zsamples; j += 1)  {
	setmessage	$const9 __nonspecular 	%line{46} %argrw{"rr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:47
#             for (i = 0; i < anglesamples; i += 1)  {
	for		$tmp11 26 27 61 62 	%line{47} %argrw{"r"}
	assign		j $const1 	%argrw{"wr"}
	lt		$tmp11 j zsamples 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:48
#                 /* Compute stratified random angle in [0,2pi] */
	for		$tmp12 29 30 60 61 	%line{48} %argrw{"r"}
	assign		i $const1 	%argrw{"wr"}
	lt		$tmp12 i anglesamples 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:50
#                 /* Compute stratified random z in [zmin,zmax] */
	mul		$tmp13 $const12 $const11 	%line{50} %argrw{"wrr"}
	random		$tmp14 	%argrw{"w"}
	add		$tmp15 i $tmp14 	%argrw{"wrr"}
	mul		$tmp16 $tmp13 $tmp15 	%argrw{"wrr"}
	div		angle $tmp16 anglesamples 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:52
#                 z = zmin + z * (zmax - zmin);
	random		$tmp17 	%line{52} %argrw{"w"}
	add		$tmp18 j $tmp17 	%argrw{"wrr"}
	div		z $tmp18 zsamples 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:53
#                 /* Compute point p on cylinder */
	sub		$tmp19 zmax zmin 	%line{53} %argrw{"wrr"}
	mul		$tmp20 z $tmp19 	%argrw{"wrr"}
	add		z zmin $tmp20 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:55
#                 /* Compute distance from point p to surface point Ps */
	cos		$tmp21 angle 	%line{55} %argrw{"wr"}
	mul		$tmp22 radius $tmp21 	%argrw{"wrr"}
	sin		$tmp23 angle 	%argrw{"wr"}
	mul		$tmp24 radius $tmp23 	%argrw{"wrr"}
	point		p $const6 $tmp22 $tmp24 z 	%argrw{"wrrrr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:57
#                 dist = length(l);
	sub		l p Ps 	%line{57} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:58
#                 ln = l / dist;
	length		dist l 	%line{58} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:59
#                 /* Compute light from point p to surface point Ps */
	div		ln l dist 	%line{59} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:61
# 	        if (LdotN > 0) {
	dot		LdotN ln Nn 	%line{61} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:62
#                     c = intensity * lightcolor;
	gt		$tmp25 LdotN $const1 	%line{62} %argrw{"wrr"}
	if		$tmp25 60 60 	%argrw{"r"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:63
#                     c *= pow(dist, -falloff);   /* distance falloff */
	mul		c intensity lightcolor 	%line{63} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:64
#                     c *= transmission(Ps, p);   /* ray traced occlusion */
	neg		$tmp27 falloff 	%line{64} %argrw{"wr"}
	pow		$tmp26 dist $tmp27 	%argrw{"wrr"}
	mul		c c $tmp26 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:65
#                     c *= LdotN;   /* Lambert's cosine law at the surface */
	transmission	$tmp28 Ps p 	%line{65} %argrw{"wrr"} %argderivs{1,2}
	mul		c c $tmp28 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:66
#                     Cl += c;
	mul		c c LdotN 	%line{66} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:67
#                 }
	add		Cl Cl c 	%line{67} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:48
#                 /* Compute stratified random angle in [0,2pi] */
	add		i i $const13 	%line{48} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:47
#             for (i = 0; i < anglesamples; i += 1)  {
	add		j j $const13 	%line{47} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\cylinderlight.osl:71
#     }
	mul		$tmp29 zsamples anglesamples 	%line{71} %argrw{"wrr"}
	div		Cl Cl $tmp29 	%argrw{"wrr"}
	end
