OpenShadingLanguage 1.00
# Compiled by oslc 1.3.0
shader node_layer_weight
param	float	Blend	0.5 		 %read{1,2} %write{2147483647,-1}
param	normal	Normal	0 0 0 		 %read{8,34} %write{0,0}
oparam	float	Fresnel	0 		 %read{2147483647,-1} %write{33,33}
oparam	float	Facing	0 		 %read{47,48} %write{35,48}
global	vector	I	 %read{8,34} %write{2147483647,-1}
global	normal	N	 %read{0,0} %write{2147483647,-1}
local	float	___293_c	 %read{12,24} %write{9,9}
local	float	___293_g	 %read{14,23} %write{13,16}
local	float	___293_result	 %read{33,33} %write{31,32}
local	float	___294_A	 %read{27,28} %write{19,19}
local	float	___294_B	 %read{29,29} %write{26,26}
local	float	blend	 %read{36,47} %write{1,46}
local	float	eta	 %read{6,10} %write{3,6}
const	float	$const1	1		 %read{2,48} %write{2147483647,-1}
temp	float	$tmp1	 %read{3,3} %write{2,2}
const	float	$const2	9.9999997e-006		 %read{3,38} %write{2147483647,-1}
temp	int	$tmp2	 %read{5,5} %write{4,4}
const	string	$const3	"fresnel_dielectric"		 %read{7,7} %write{2147483647,-1}
temp	float	$tmp3	 %read{9,9} %write{8,8}
temp	float	$tmp4	 %read{11,11} %write{10,10}
temp	float	$tmp5	 %read{13,13} %write{11,11}
temp	float	$tmp6	 %read{13,13} %write{12,12}
const	int	$const5	0		 %read{14,14} %write{2147483647,-1}
temp	int	$tmp7	 %read{15,15} %write{14,14}
temp	float	$tmp8	 %read{19,19} %write{17,17}
temp	float	$tmp9	 %read{19,19} %write{18,18}
temp	float	$tmp10	 %read{21,21} %write{20,20}
temp	float	$tmp11	 %read{22,22} %write{21,21}
temp	float	$tmp12	 %read{26,26} %write{22,22}
temp	float	$tmp13	 %read{24,24} %write{23,23}
temp	float	$tmp14	 %read{25,25} %write{24,24}
temp	float	$tmp15	 %read{26,26} %write{25,25}
const	float	$const6	0.5		 %read{27,46} %write{2147483647,-1}
temp	float	$tmp16	 %read{28,28} %write{27,27}
temp	float	$tmp17	 %read{31,31} %write{28,28}
temp	float	$tmp18	 %read{30,30} %write{29,29}
temp	float	$tmp19	 %read{31,31} %write{30,30}
temp	float	$tmp20	 %read{35,35} %write{34,34}
temp	int	$tmp21	 %read{37,37} %write{36,36}
const	float	$const7	0		 %read{41,41} %write{2147483647,-1}
temp	float	$tmp22	 %read{40,40} %write{38,38}
const	string	$const8	"clamp"		 %read{39,39} %write{2147483647,-1}
temp	float	$tmp23	 %read{41,41} %write{40,40}
temp	int	$tmp24	 %read{43,43} %write{42,42}
const	float	$const9	2		 %read{44,44} %write{2147483647,-1}
temp	float	$tmp25	 %read{46,46} %write{45,45}
code Normal
# D:\\blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:25
# 	output float Fresnel = 0.0,
	assign		Normal N 	%filename{"D:\\blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl"} %line{25} %argrw{"wr"}
code ___main___
# D:\\blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:29
# 
	assign		blend Blend 	%filename{"D:\\blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl"} %line{29} %argrw{"wr"}
# D:\\blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:32
# 	eta = backfacing() ? eta : 1.0 / eta;
	sub		$tmp1 $const1 Blend 	%line{32} %argrw{"wrr"}
	max		eta $tmp1 $const2 	%argrw{"wrr"}
# D:\\blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:33
# 	Fresnel = fresnel_dielectric(I, Normal, eta);
	backfacing	$tmp2 	%line{33} %argrw{"w"}
	if		$tmp2 6 7 	%argrw{"r"}
	div		eta $const1 eta 	%argrw{"wrr"}
# D:\\blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:34
# 
	functioncall	$const3 34 	%line{34} %argrw{"r"}
# D:/blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_fresnel.h:21
# 	float c = fabs(dot(Incoming, Normal));
	dot		$tmp3 I Normal 	%filename{"D:/blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_fresnel.h"} %line{21} %argrw{"wrr"}
	fabs		___293_c $tmp3 	%argrw{"wr"}
# D:/blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_fresnel.h:22
# 	float g = eta * eta - 1 + c * c;
	mul		$tmp4 eta eta 	%line{22} %argrw{"wrr"}
	sub		$tmp5 $tmp4 $const1 	%argrw{"wrr"}
	mul		$tmp6 ___293_c ___293_c 	%argrw{"wrr"}
	add		___293_g $tmp5 $tmp6 	%argrw{"wrr"}
# D:/blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_fresnel.h:25
# 	if (g > 0) {
	gt		$tmp7 ___293_g $const5 	%line{25} %argrw{"wrr"}
	if		$tmp7 32 33 	%argrw{"r"}
# D:/blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_fresnel.h:26
# 		g = sqrt(g);
	sqrt		___293_g ___293_g 	%line{26} %argrw{"wr"}
# D:/blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_fresnel.h:27
# 		float A = (g - c) / (g + c);
	sub		$tmp8 ___293_g ___293_c 	%line{27} %argrw{"wrr"}
	add		$tmp9 ___293_g ___293_c 	%argrw{"wrr"}
	div		___294_A $tmp8 $tmp9 	%argrw{"wrr"}
# D:/blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_fresnel.h:28
# 		float B = (c * (g + c) - 1) / (c * (g - c) + 1);
	add		$tmp10 ___293_g ___293_c 	%line{28} %argrw{"wrr"}
	mul		$tmp11 ___293_c $tmp10 	%argrw{"wrr"}
	sub		$tmp12 $tmp11 $const1 	%argrw{"wrr"}
	sub		$tmp13 ___293_g ___293_c 	%argrw{"wrr"}
	mul		$tmp14 ___293_c $tmp13 	%argrw{"wrr"}
	add		$tmp15 $tmp14 $const1 	%argrw{"wrr"}
	div		___294_B $tmp12 $tmp15 	%argrw{"wrr"}
# D:/blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_fresnel.h:29
# 		result = 0.5 * A * A * (1 + B * B);
	mul		$tmp16 $const6 ___294_A 	%line{29} %argrw{"wrr"}
	mul		$tmp17 $tmp16 ___294_A 	%argrw{"wrr"}
	mul		$tmp18 ___294_B ___294_B 	%argrw{"wrr"}
	add		$tmp19 $const1 $tmp18 	%argrw{"wrr"}
	mul		___293_result $tmp17 $tmp19 	%argrw{"wrr"}
# D:/blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_fresnel.h:32
# 		result = 1.0;  /* TIR (no refracted component) */
	assign		___293_result $const1 	%line{32} %argrw{"wr"}
# D:/blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_fresnel.h:34
# 	return result;
	assign		Fresnel ___293_result 	%line{34} %argrw{"wr"}
# D:\\blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:37
#  *
	dot		$tmp20 I Normal 	%filename{"D:\\blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl"} %line{37} %argrw{"wrr"}
	abs		Facing $tmp20 	%argrw{"wr"}
# D:\\blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:39
#  * modify it under the terms of the GNU General Public License
	neq		$tmp21 blend $const6 	%line{39} %argrw{"wrr"}
	if		$tmp21 48 48 	%argrw{"r"}
# D:\\blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:40
#  * as published by the Free Software Foundation; either version 2
	sub		$tmp22 $const1 $const2 	%line{40} %argrw{"wrr"}
	functioncall	$const8 42 	%argrw{"r"}
# D:/blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\stdosl.h:142
# PERCOMP1 (expm1)
	min		$tmp23 blend $tmp22 	%filename{"D:/blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\stdosl.h"} %line{142} %argrw{"wrr"}
	max		blend $tmp23 $const7 	%argrw{"wrr"}
# D:\\blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:41
# 
	lt		$tmp24 blend $const6 	%filename{"D:\\blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl"} %line{41} %argrw{"wrr"}
	if		$tmp24 45 47 	%argrw{"r"}
	mul		blend $const9 blend 	%argrw{"wrr"}
	sub		$tmp25 $const1 blend 	%argrw{"wrr"}
	div		blend $const6 $tmp25 	%argrw{"wrr"}
# D:\\blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:43
# 	}
	pow		Facing Facing blend 	%line{43} %argrw{"wrr"}
# D:\\blender_dev\\code\\trunk\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:46
# }
	sub		Facing $const1 Facing 	%line{46} %argrw{"wrr"}
	end
