OpenShadingLanguage 1.01
# Compiled by oslc 1.6.2
surface glassrefr
param	float	Kr	1		%read{76,79} %write{2147483647,-1}
param	float	Kt	1		%read{83,86} %write{2147483647,-1}
param	float	ior	1.5		%read{13,14} %write{2147483647,-1} %derivs
param	float	Ks	1		%read{100,100} %write{2147483647,-1}
param	float	shinyness	50		%read{99,99} %write{2147483647,-1}
global	point	P	%read{80,94} %write{2147483647,-1} %derivs
global	vector	I	%read{1,1} %write{2147483647,-1} %derivs
global	normal	N	%read{0,0} %write{2147483647,-1} %derivs
global	color	C	%read{82,102} %write{15,102}
global	vector	L	%read{95,95} %write{2147483647,-1}
global	color	Cl	%read{101,101} %write{2147483647,-1}
local	float	___216_IdotN	%read{58,66} %write{56,56} %derivs
local	float	___216_k	%read{62,67} %write{61,61} %derivs
local	float	___217_c	%read{18,46} %write{17,20}
local	float	___217_g	%read{32,46} %write{31,34}
local	float	___219_beta	%read{39,47} %write{35,35}
local	float	___219_F	%read{43,51} %write{41,50}
local	normal	Nn	%read{3,10} %write{0,0} %derivs
local	vector	In	%read{3,65} %write{1,1} %derivs
local	normal	Nf	%read{17,98} %write{6,7} %derivs
local	vector	V	%read{96,96} %write{9,9}
local	vector	reflDir	%read{80,80} %write{25,25} %derivs
local	vector	refrDir	%read{87,87} %write{64,74} %derivs
local	float	eta	%read{27,66} %write{13,14} %derivs
local	float	kr	%read{52,79} %write{51,72}
local	float	kt	%read{83,86} %write{54,75}
local	vector	___291_Ln	%read{90,102} %write{90,102}
local	vector	___291_H	%read{90,102} %write{90,102}
const	string	$const1	"faceforward"		%read{2,2} %write{2147483647,-1}
temp	float	$tmp1	%read{4,4} %write{3,3}
const	int	$const2	0		%read{4,84} %write{2147483647,-1}
temp	int	$tmp2	%read{5,5} %write{4,4}
temp	float	$tmp3	%read{11,11} %write{10,10}
temp	int	$tmp4	%read{12,12} %write{11,11}
const	float	$const4	1		%read{13,75} %write{2147483647,-1}
const	string	$const5	"fresnel"		%read{16,16} %write{2147483647,-1}
temp	int	$tmp5	%read{19,19} %write{18,18}
const	string	$const6	"reflect"		%read{21,21} %write{2147483647,-1}
temp	float	$tmp6	%read{23,23} %write{22,22} %derivs
temp	float	$tmp7	%read{24,24} %write{23,23} %derivs
const	float	$const8	2		%read{23,93} %write{2147483647,-1}
temp	vector	$tmp8	%read{25,25} %write{24,24} %derivs
temp	float	$tmp9	%read{28,28} %write{27,27}
const	string	$const9	"sqr"		%read{26,48} %write{2147483647,-1}
temp	float	$tmp10	%read{29,29} %write{28,28}
temp	float	$tmp11	%read{31,31} %write{29,29}
temp	float	$tmp12	%read{31,31} %write{30,30}
const	float	$const10	0		%read{32,73} %write{2147483647,-1}
temp	int	$tmp13	%read{33,33} %write{32,32}
temp	float	$tmp14	%read{37,37} %write{36,36}
temp	float	$tmp15	%read{38,38} %write{37,37}
temp	float	$tmp16	%read{41,41} %write{38,38}
temp	float	$tmp17	%read{40,40} %write{39,39}
temp	float	$tmp18	%read{41,41} %write{40,40}
const	float	$const11	0.5		%read{45,45} %write{2147483647,-1}
temp	float	$tmp19	%read{44,44} %write{43,43}
temp	float	$tmp20	%read{45,45} %write{44,44}
temp	float	$tmp21	%read{50,50} %write{49,49}
temp	float	$tmp22	%read{47,47} %write{46,46}
temp	float	$tmp23	%read{49,49} %write{47,47}
temp	float	$tmp24	%read{53,53} %write{52,52}
temp	float	$tmp25	%read{54,54} %write{53,53}
const	string	$const12	"refract"		%read{55,55} %write{2147483647,-1}
temp	float	$tmp26	%read{60,60} %write{57,57} %derivs
temp	float	$tmp27	%read{59,59} %write{58,58} %derivs
temp	float	$tmp28	%read{60,60} %write{59,59} %derivs
temp	float	$tmp29	%read{61,61} %write{60,60} %derivs
temp	int	$tmp30	%read{63,63} %write{62,62}
const	vector	$const13	0 0 0		%read{64,74} %write{2147483647,-1}
temp	vector	$tmp31	%read{70,70} %write{65,65} %derivs
temp	float	$tmp32	%read{68,68} %write{66,66} %derivs
temp	float	$tmp33	%read{68,68} %write{67,67} %derivs
temp	float	$tmp34	%read{69,69} %write{68,68} %derivs
temp	vector	$tmp35	%read{70,70} %write{69,69} %derivs
temp	float	$tmp36	%read{77,77} %write{76,76}
temp	int	$tmp37	%read{78,78} %write{77,77}
temp	float	$tmp38	%read{81,81} %write{79,79}
temp	color	$tmp39	%read{81,81} %write{80,80}
temp	color	$tmp40	%read{82,82} %write{81,81}
temp	float	$tmp41	%read{84,84} %write{83,83}
temp	int	$tmp42	%read{85,85} %write{84,84}
temp	float	$tmp43	%read{88,88} %write{86,86}
temp	color	$tmp44	%read{88,88} %write{87,87}
temp	color	$tmp45	%read{89,89} %write{88,88}
const	float	$const14	3.1415927		%read{91,93} %write{2147483647,-1}
temp	float	$tmp46	%read{92,92} %write{91,91}
temp	int	$tmp47	%read{90,102} %write{90,102}
temp	float	$tmp48	%read{94,94} %write{93,93}
temp	vector	$tmp49	%read{97,97} %write{96,96}
temp	float	$tmp50	%read{100,100} %write{99,99}
temp	float	$tmp51	%read{99,99} %write{98,98}
temp	float	$tmp52	%read{101,101} %write{100,100}
temp	color	$tmp53	%read{90,102} %write{90,102}
code ___main___
# D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl:14
#   vector In = normalize(I);
	normalize	Nn N 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl"} %line{14} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl:15
#   normal Nf = faceforward(Nn, In, Nn);
	normalize	In I 	%line{15} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl:16
#   vector V = -In;   /* view direction */
	functioncall	$const1 9 	%line{16} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:192
# float dot (vector a, vector b) BUILTIN;
	dot		$tmp1 In Nn 	%filename{"D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h"} %line{192} %argrw{"wrr"}
	gt		$tmp2 $tmp1 $const2 	%argrw{"wrr"}
	if		$tmp2 7 8 	%argrw{"r"}
	neg		Nf Nn 	%argrw{"wr"}
	assign		Nf Nn 	%argrw{"wr"}
	return
# D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl:17
#   vector reflDir, refrDir;
	neg		V In 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl"} %line{17} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl:19
#   float kr, kt;
	dot		$tmp3 In Nn 	%line{19} %argrw{"wrr"}
	lt		$tmp4 $tmp3 $const2 	%argrw{"wrr"}
	if		$tmp4 14 15 	%argrw{"r"}
	div		eta $const4 ior 	%argrw{"wrr"}
	assign		eta ior 	%argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl:22
# 
	assign		C $const2 	%line{22} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl:26
#   kt = 1 - kr;
	functioncall	$const5 75 	%line{26} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:209
#     if(dd == 0.0)
	dot		___217_c In Nf 	%filename{"D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h"} %line{209} %argrw{"wrr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:210
#         return distance(q, a);
	lt		$tmp5 ___217_c $const2 	%line{210} %argrw{"wrr"}
	if		$tmp5 21 21 	%argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:211
#     float t = dot(q - a, d)/dd;
	neg		___217_c ___217_c 	%line{211} %argrw{"wr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:212
#     return distance(q, a + clamp(t, 0.0, 1.0)*d);
	functioncall	$const6 26 	%line{212} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:198
# vector reflect (vector I, vector N) { return I - 2*dot(N,I)*N; }
	dot		$tmp6 Nf In 	%line{198} %argrw{"wrr"}
	mul		$tmp7 $const8 $tmp6 	%argrw{"wrr"}
	mul		$tmp8 $tmp7 Nf 	%argrw{"wrr"}
	sub		reflDir In $tmp8 	%argrw{"wrr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:213
#     float g = 1.0 / sqr(eta) - 1.0 + c * c;
	functioncall	$const9 28 	%line{213} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:208
#     float sqr(float x) { return x*x; }
	mul		$tmp9 eta eta 	%line{208} %argrw{"wrr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:213
#     float g = 1.0 / sqr(eta) - 1.0 + c * c;
	div		$tmp10 $const4 $tmp9 	%line{213} %argrw{"wrr"}
	sub		$tmp11 $tmp10 $const4 	%argrw{"wrr"}
	mul		$tmp12 ___217_c ___217_c 	%argrw{"wrr"}
	add		___217_g $tmp11 $tmp12 	%argrw{"wrr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:214
#     if (g >= 0.0) {
	ge		$tmp13 ___217_g $const10 	%line{214} %argrw{"wrr"}
	if		$tmp13 72 75 	%argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:215
#         g = sqrt (g);
	sqrt		___217_g ___217_g 	%line{215} %argrw{"wr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:216
#         float beta = g - c;
	sub		___219_beta ___217_g ___217_c 	%line{216} %argrw{"wrr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:217
#         float F = (c * (g+c) - 1.0) / (c * beta + 1.0);
	add		$tmp14 ___217_g ___217_c 	%line{217} %argrw{"wrr"}
	mul		$tmp15 ___217_c $tmp14 	%argrw{"wrr"}
	sub		$tmp16 $tmp15 $const4 	%argrw{"wrr"}
	mul		$tmp17 ___217_c ___219_beta 	%argrw{"wrr"}
	add		$tmp18 $tmp17 $const4 	%argrw{"wrr"}
	div		___219_F $tmp16 $tmp18 	%argrw{"wrr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:218
#         F = 0.5 * (1.0 + sqr(F));
	functioncall	$const9 44 	%line{218} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:208
#     float sqr(float x) { return x*x; }
	mul		$tmp19 ___219_F ___219_F 	%line{208} %argrw{"wrr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:218
#         F = 0.5 * (1.0 + sqr(F));
	add		$tmp20 $const4 $tmp19 	%line{218} %argrw{"wrr"}
	mul		___219_F $const11 $tmp20 	%argrw{"wrr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:219
#         F *= sqr (beta / (g+c));
	add		$tmp22 ___217_g ___217_c 	%line{219} %argrw{"wrr"}
	div		$tmp23 ___219_beta $tmp22 	%argrw{"wrr"}
	functioncall	$const9 50 	%argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:208
#     float sqr(float x) { return x*x; }
	mul		$tmp21 $tmp23 $tmp23 	%line{208} %argrw{"wrr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:219
#         F *= sqr (beta / (g+c));
	mul		___219_F ___219_F $tmp21 	%line{219} %argrw{"wrr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:220
#         Kr = F;
	assign		kr ___219_F 	%line{220} %argrw{"wr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:221
#         Kt = (1.0 - Kr) * eta*eta;
	sub		$tmp24 $const4 kr 	%line{221} %argrw{"wrr"}
	mul		$tmp25 $tmp24 eta 	%argrw{"wrr"}
	mul		kt $tmp25 eta 	%argrw{"wrr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:224
#         T = refract(I, N, eta);
	functioncall	$const12 72 	%line{224} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:200
#     float IdotN = dot (I, N);
	dot		___216_IdotN In Nf 	%line{200} %argrw{"wrr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:201
#     float k = 1 - eta*eta * (1 - IdotN*IdotN);
	mul		$tmp26 eta eta 	%line{201} %argrw{"wrr"}
	mul		$tmp27 ___216_IdotN ___216_IdotN 	%argrw{"wrr"}
	sub		$tmp28 $const4 $tmp27 	%argrw{"wrr"}
	mul		$tmp29 $tmp26 $tmp28 	%argrw{"wrr"}
	sub		___216_k $const4 $tmp29 	%argrw{"wrr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:202
#     return (k < 0) ? vector(0,0,0) : (eta*I - N * (eta*IdotN + sqrt(k)));
	lt		$tmp30 ___216_k $const2 	%line{202} %argrw{"wrr"}
	if		$tmp30 65 71 	%argrw{"r"}
	assign		refrDir $const13 	%argrw{"wr"}
	mul		$tmp31 eta In 	%argrw{"wrr"}
	mul		$tmp32 eta ___216_IdotN 	%argrw{"wrr"}
	sqrt		$tmp33 ___216_k 	%argrw{"wr"}
	add		$tmp34 $tmp32 $tmp33 	%argrw{"wrr"}
	mul		$tmp35 Nf $tmp34 	%argrw{"wrr"}
	sub		refrDir $tmp31 $tmp35 	%argrw{"wrr"}
	return
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:227
#         Kr = 1.0;
	assign		kr $const4 	%line{227} %argrw{"wr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:228
#         Kt = 0.0;
	assign		kt $const10 	%line{228} %argrw{"wr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:229
#         T = vector (0,0,0);
	assign		refrDir $const13 	%line{229} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl:27
#   
	sub		kt $const4 kr 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl"} %line{27} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl:30
#     C += Kr * kr * trace(P, reflDir);
	mul		$tmp36 Kr kr 	%line{30} %argrw{"wrr"}
	gt		$tmp37 $tmp36 $const2 	%argrw{"wrr"}
	if		$tmp37 83 83 	%argrw{"r"}
# D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl:31
# 
	mul		$tmp38 Kr kr 	%line{31} %argrw{"wrr"}
	trace		$tmp39 P reflDir 	%argrw{"wrr"} %argderivs{1,2}
	mul		$tmp40 $tmp38 $tmp39 	%argrw{"wrr"}
	add		C C $tmp40 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl:34
#     C += Kt * kt * trace(P, refrDir);	
	mul		$tmp41 Kt kt 	%line{34} %argrw{"wrr"}
	gt		$tmp42 $tmp41 $const2 	%argrw{"wrr"}
	if		$tmp42 90 90 	%argrw{"r"}
# D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl:35
# 
	mul		$tmp43 Kt kt 	%line{35} %argrw{"wrr"}
	trace		$tmp44 P refrDir 	%argrw{"wrr"} %argderivs{1,2}
	mul		$tmp45 $tmp43 $tmp44 	%argrw{"wrr"}
	add		C C $tmp45 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl:38
#     vector Ln = normalize(L);   /* normalized direction to light source */
	for		$tmp47 93 95 103 103 	%line{38} %argrw{"r"}
	div		$tmp46 $const14 $const8 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl:42
# }
	lights_begin	P Nf $tmp46 	%line{42} %argrw{"rrr"}
# D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl:38
#     vector Ln = normalize(L);   /* normalized direction to light source */
	div		$tmp48 $const14 $const8 	%line{38} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl:42
# }
	lights		$tmp47 P Nf $tmp48 	%line{42} %argrw{"wrrr"} %argderivs{1}
# D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl:39
#     vector H = normalize(Ln + V);   /* half-way vector */
	normalize	___291_Ln L 	%line{39} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl:40
#     C += Ks * pow(dot(H, Nf), shinyness) * Cl;
	add		$tmp49 ___291_Ln V 	%line{40} %argrw{"wrr"}
	normalize	___291_H $tmp49 	%argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\glassrefr.osl:41
#   }
	dot		$tmp51 ___291_H Nf 	%line{41} %argrw{"wrr"}
	pow		$tmp50 $tmp51 shinyness 	%argrw{"wrr"}
	mul		$tmp52 Ks $tmp50 	%argrw{"wrr"}
	mul		$tmp53 $tmp52 Cl 	%argrw{"wrr"}
	add		C C $tmp53 	%argrw{"wrr"}
	end
