OpenShadingLanguage 1.01
# Compiled by oslc 1.6.2
light spotlight	%meta{string,help,"Spot light, simple, with shadows"} %emit{1}
param	float	intensity	1		%meta{string,help,"Overall light intensity"} %meta{float,min,0}  %read{25,25} %write{2147483647,-1}
param	color	lightcolor	1 1 1		%meta{string,help,"Overall light color"}  %read{26,26} %write{2147483647,-1}
param	point	from	0 0 0		%meta{string,help,"Light origin (default: local origin)"}  %read{8,34} %write{0,0} %derivs %initexpr
param	point	to	0 0 1		%meta{string,help,"Light target (default: local +z)"}  %read{8,8} %write{1,1} %initexpr
param	float	coneangle	0		%meta{string,help,"Cone illumination angle"} %meta{float,min,0}  %read{10,21} %write{4,4} %initexpr
param	float	conedeltaangle	0		%meta{string,help,"Cone falloff angle"} %meta{float,min,0}  %read{21,21} %write{7,7} %initexpr
param	float	beamdistribution	2		%meta{string,help,"Angular falloff exponent"} %meta{float,min,0}  %read{17,17} %write{2147483647,-1}
param	float	falloff	2		%meta{string,help,"Distance falloff exponent"} %meta{float,min,0} %meta{float,max,3}  %read{18,18} %write{2147483647,-1}
param	string	shadowname	""		%meta{string,help,"Shadow name (map or geomset)"}  %read{27,34} %write{2147483647,-1}
param	float	shadowsamples	1		%meta{string,help,"Shadow samples"} %meta{int,min,1} %meta{int,max,256}  %read{33,33} %write{2147483647,-1}
param	float	shadowblur	0		%meta{string,help,"Shadow blur"} %meta{float,min,0} %meta{float,max,1}  %read{34,34} %write{2147483647,-1}
param	float	shadowbias	-1		%meta{string,help,"Shadow bias (-1 means default)"} %meta{float,min,0} %meta{float,max,1}  %read{34,34} %write{2147483647,-1}
param	float	__nonspecular	0		%meta{string,help,"Non-specular"} %meta{float,min,0} %meta{float,max,1}  %read{12,12} %write{2147483647,-1}
global	point	Ps	%read{34,34} %write{2147483647,-1} %derivs
global	vector	L	%read{13,15} %write{2147483647,-1}
global	color	Cl	%read{35,35} %write{26,35}
local	vector	axis	%read{10,14} %write{9,9}
local	float	___291_Llen	%read{16,18} %write{13,13}
local	float	___291_cosangle	%read{17,23} %write{16,16}
local	float	___291_atten	%read{24,29} %write{19,25}
const	string	$const1	"shader"		%read{0,1} %write{2147483647,-1}
const	int	$const2	0		%read{30,30} %write{2147483647,-1}
const	float	$const3	0		%read{0,1} %write{2147483647,-1}
const	float	$const5	1		%read{1,1} %write{2147483647,-1}
const	float	$const7	30		%read{4,4} %write{2147483647,-1}
const	string	$const8	"radians"		%read{2,5} %write{2147483647,-1}
const	float	$const9	3.1415927		%read{3,6} %write{2147483647,-1}
const	float	$const10	180		%read{3,6} %write{2147483647,-1}
temp	float	$tmp1	%read{4,4} %write{3,3}
const	float	$const12	5		%read{7,7} %write{2147483647,-1}
temp	float	$tmp2	%read{7,7} %write{6,6}
temp	vector	$tmp3	%read{9,9} %write{8,8}
temp	int	$tmp4	%read{11,11} %write{10,10}
const	string	$const13	"__nonspecular"		%read{12,12} %write{2147483647,-1}
temp	float	$tmp5	%read{16,16} %write{15,15}
temp	vector	$tmp6	%read{15,15} %write{14,14}
temp	float	$tmp7	%read{19,19} %write{17,17}
temp	float	$tmp8	%read{19,19} %write{18,18}
temp	float	$tmp9	%read{24,24} %write{23,23}
temp	float	$tmp10	%read{23,23} %write{20,20}
temp	float	$tmp11	%read{23,23} %write{22,22}
temp	float	$tmp12	%read{22,22} %write{21,21}
temp	int	$tmp13	%read{28,32} %write{27,31}
const	string	$const14	""		%read{27,27} %write{2147483647,-1}
const	float	$const15	9.9999997e-005		%read{29,29} %write{2147483647,-1}
temp	int	$tmp14	%read{30,30} %write{29,29}
temp	int	$tmp15	%read{31,31} %write{30,30}
temp	color	$tmp16	%read{35,35} %write{34,34}
const	string	$const16	"traceset"		%read{34,34} %write{2147483647,-1}
const	string	$const17	"samples"		%read{34,34} %write{2147483647,-1}
temp	int	$tmp17	%read{34,34} %write{33,33}
const	string	$const18	"blur"		%read{34,34} %write{2147483647,-1}
const	string	$const19	"bias"		%read{34,34} %write{2147483647,-1}
code from
# D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl:70
#         [[  string help = "Light origin (default: local origin)" ]],
	point		from $const1 $const3 $const3 $const3 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl"} %line{70} %argrw{"wrrrr"}
code to
# D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl:72
#         [[  string help = "Light target (default: local +z)" ]],
	point		to $const1 $const3 $const3 $const5 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl"} %line{72} %argrw{"wrrrr"}
code coneangle
# D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl:75
#         [[  string help = "Cone illumination angle",
	functioncall	$const8 5 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl"} %line{75} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:88
# //   contributors may be used to endorse or promote products derived from
	div		$tmp1 $const9 $const10 	%filename{"D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h"} %line{88} %argrw{"wrr"}
	mul		coneangle $const7 $tmp1 	%argrw{"wrr"}
code conedeltaangle
# D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl:78
#         [[  string help = "Cone falloff angle",
	functioncall	$const8 8 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl"} %line{78} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:88
# //   notice, this list of conditions and the following disclaimer in the
	div		$tmp2 $const9 $const10 	%filename{"D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h"} %line{88} %argrw{"wrr"}
	mul		conedeltaangle $const12 $tmp2 	%argrw{"wrr"}
code ___main___
# D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl:105
# //   shadowname - the name of the shadow map, or geometry set for ray
	sub		$tmp3 to from 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl"} %line{105} %argrw{"wrr"}
	normalize	axis $tmp3 	%argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl:121
# // met:
	emit		$tmp4 from axis coneangle 	%line{121} %argrw{"wrrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl:107
# 		setmessage ("__nonspecular", __nonspecular);
	if		$tmp4 36 36 	%line{107} %argrw{"r"}
# D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl:108
#         float Llen = length(L);
	setmessage	$const13 __nonspecular 	%line{108} %argrw{"rr"}
# D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl:109
# 		float cosangle = dot (L, -axis) / Llen;
	length		___291_Llen L 	%line{109} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl:110
# 		float atten = pow (cosangle, beamdistribution) / pow (Llen, falloff);
	neg		$tmp6 axis 	%line{110} %argrw{"wr"}
	dot		$tmp5 L $tmp6 	%argrw{"wrr"}
	div		___291_cosangle $tmp5 ___291_Llen 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl:111
# 		atten *= smoothstep (cos(coneangle), cos(coneangle-conedeltaangle),
	pow		$tmp7 ___291_cosangle beamdistribution 	%line{111} %argrw{"wrr"}
	pow		$tmp8 ___291_Llen falloff 	%argrw{"wrr"}
	div		___291_atten $tmp7 $tmp8 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl:112
# 					 cosangle);
	cos		$tmp10 coneangle 	%line{112} %argrw{"wr"}
	sub		$tmp12 coneangle conedeltaangle 	%argrw{"wrr"}
	cos		$tmp11 $tmp12 	%argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl:113
# 		atten *= intensity;
	smoothstep	$tmp9 $tmp10 $tmp11 ___291_cosangle 	%line{113} %argrw{"wrrr"}
	mul		___291_atten ___291_atten $tmp9 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl:114
# 		Cl = atten * lightcolor;
	mul		___291_atten ___291_atten intensity 	%line{114} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl:115
# 
	mul		Cl ___291_atten lightcolor 	%line{115} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl:118
#             Cl *= transmission (Ps, from, "traceset", shadowname, "samples", (int)shadowsamples,
	neq		$tmp13 shadowname $const14 	%line{118} %argrw{"wrr"}
	if		$tmp13 32 32 	%argrw{"r"}
	gt		$tmp14 ___291_atten $const15 	%argrw{"wrr"}
	neq		$tmp15 $tmp14 $const2 	%argrw{"wrr"}
	assign		$tmp13 $tmp15 	%argrw{"wr"}
	if		$tmp13 36 36 	%argrw{"r"}
# D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl:119
#                                       "blur", shadowblur, "bias", shadowbias);
	assign		$tmp17 shadowsamples 	%line{119} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\spotlight.osl:120
#     }
	transmission	$tmp16 Ps from $const16 shadowname $const17 $tmp17 $const18 shadowblur $const19 shadowbias 	%line{120} %argrw{"wrrrrrrrrrr"} %argderivs{1,2}
	mul		Cl Cl $tmp16 	%argrw{"wrr"}
	end
