OpenShadingLanguage 1.00
# Compiled by oslc 1.11.17
# options: -q -I/build/openshadinglanguage/src/OpenShadingLanguage-Release-1.11.17.0/src/shaders -I/build/openshadinglanguage/src/OpenShadingLanguage-Release-1.11.17.0/src/shaders -I/build/openshadinglanguage/src/OpenShadingLanguage-Release-1.11.17.0/src/shaders -o /build/openshadinglanguage/src/OpenShadingLanguage-Release-1.11.17.0/build/src/shaders/glass.oso
surface glass	%meta{string,help,"Simple dielectric material"} 
param	float	Ks	1		%meta{string,help,"Color scaling of the refraction"} %meta{float,min,0} %meta{float,max,1}  %read{21,24} %write{2147483647,-1}
param	color	Cs	1 1 1		%meta{string,help,"Base color"} %meta{float,min,0} %meta{float,max,1}  %read{17,26} %write{2147483647,-1}
param	float	eta	1.5		%meta{string,help,"Index of refraction"} %meta{float,min,1} %meta{float,max,3}  %read{15,25} %write{2147483647,-1}
param	int	caustics	0		%meta{string,help,"Enable indirect lighting through glass"} %meta{string,widget,"checkBox"}  %read{0,0} %write{2147483647,-1}
param	int	TIR	0		%meta{string,help,"Enable Total Internal Reflection"} %meta{string,widget,"checkBox"}  %read{18,18} %write{2147483647,-1}
global	normal	N	%read{16,25} %write{2147483647,-1}
global	closure color	Ci	%read{22,22} %write{17,27}
temp	int	$tmp1	%read{1,12} %write{0,11}
const	int	$const1	0		%read{0,10} %write{2147483647,-1}
temp	int	$tmp2	%read{3,3} %write{2,2}
const	string	$const2	"glossy"		%read{2,2} %write{2147483647,-1}
temp	int	$tmp3	%read{4,4} %write{3,3}
temp	int	$tmp4	%read{5,10} %write{4,9}
temp	int	$tmp5	%read{7,7} %write{6,6}
const	string	$const3	"diffuse"		%read{6,6} %write{2147483647,-1}
temp	int	$tmp6	%read{8,8} %write{7,7}
temp	int	$tmp7	%read{9,9} %write{8,8}
temp	int	$tmp8	%read{11,11} %write{10,10}
temp	int	$tmp9	%read{14,14} %write{13,13}
temp	closure color	$tmp10	%read{17,17} %write{16,16}
const	float	$const4	1		%read{15,19} %write{2147483647,-1}
temp	float	$tmp11	%read{16,16} %write{15,15}
const	string	$const5	"refraction"		%read{16,25} %write{2147483647,-1}
temp	closure color	$tmp12	%read{21,21} %write{20,20}
temp	float	$tmp13	%read{20,20} %write{19,19}
const	string	$const6	"reflection"		%read{20,23} %write{2147483647,-1}
temp	closure color	$tmp14	%read{22,22} %write{21,21}
temp	closure color	$tmp15	%read{24,24} %write{23,23}
temp	closure color	$tmp16	%read{27,27} %write{24,24}
temp	closure color	$tmp17	%read{26,26} %write{25,25}
temp	closure color	$tmp18	%read{27,27} %write{26,26}
code ___main___
# /build/openshadinglanguage/src/OpenShadingLanguage-Release-1.11.17.0/src/shaders/glass.osl:32
#     if (caustics || (!raytype("glossy") && !raytype("diffuse"))) {
	neq		$tmp1 caustics $const1 	%filename{"/build/openshadinglanguage/src/OpenShadingLanguage-Release-1.11.17.0/src/shaders/glass.osl"} %line{32} %argrw{"wrr"}
	if		$tmp1 2 12 	%argrw{"r"}
	raytype		$tmp2 $const2 	%argrw{"wr"}
	eq		$tmp3 $tmp2 $const1 	%argrw{"wrr"}
	neq		$tmp4 $tmp3 $const1 	%argrw{"wrr"}
	if		$tmp4 10 10 	%argrw{"r"}
	raytype		$tmp5 $const3 	%argrw{"wr"}
	eq		$tmp6 $tmp5 $const1 	%argrw{"wrr"}
	neq		$tmp7 $tmp6 $const1 	%argrw{"wrr"}
	assign		$tmp4 $tmp7 	%argrw{"wr"}
	neq		$tmp8 $tmp4 $const1 	%argrw{"wrr"}
	assign		$tmp1 $tmp8 	%argrw{"wr"}
	if		$tmp1 28 28 	%argrw{"r"}
# /build/openshadinglanguage/src/OpenShadingLanguage-Release-1.11.17.0/src/shaders/glass.osl:34
#         if (backfacing()) {
	backfacing	$tmp9 	%line{34} %argrw{"w"}
	if		$tmp9 23 28 	%argrw{"r"}
# /build/openshadinglanguage/src/OpenShadingLanguage-Release-1.11.17.0/src/shaders/glass.osl:35
#             Ci = Cs * refraction(N, 1.0 / eta);
	div		$tmp11 $const4 eta 	%line{35} %argrw{"wrr"}
	closure		$tmp10 $const5 N $tmp11 	%argrw{"wrrr"}
	mul		Ci $tmp10 Cs 	%argrw{"wrr"}
# /build/openshadinglanguage/src/OpenShadingLanguage-Release-1.11.17.0/src/shaders/glass.osl:39
#             if (TIR)
	if		TIR 23 23 	%line{39} %argrw{"r"}
# /build/openshadinglanguage/src/OpenShadingLanguage-Release-1.11.17.0/src/shaders/glass.osl:40
#                Ci += Ks * reflection(N, 1.0 / eta);
	div		$tmp13 $const4 eta 	%line{40} %argrw{"wrr"}
	closure		$tmp12 $const6 N $tmp13 	%argrw{"wrrr"}
	mul		$tmp14 $tmp12 Ks 	%argrw{"wrr"}
	add		Ci Ci $tmp14 	%argrw{"wrr"}
# /build/openshadinglanguage/src/OpenShadingLanguage-Release-1.11.17.0/src/shaders/glass.osl:42
#             Ci = Ks * reflection(N, eta) + Cs * refraction(N, eta);
	closure		$tmp15 $const6 N eta 	%line{42} %argrw{"wrrr"}
	mul		$tmp16 $tmp15 Ks 	%argrw{"wrr"}
	closure		$tmp17 $const5 N eta 	%argrw{"wrrr"}
	mul		$tmp18 $tmp17 Cs 	%argrw{"wrr"}
	add		Ci $tmp16 $tmp18 	%argrw{"wrr"}
	end
