OpenShadingLanguage 1.00
# Compiled by oslc 1.4.0
shader node_layer_weight
param	float	Blend	0.5 		 %read{1,3} %write{2147483647,-1}
param	normal	Normal	0 0 0 		 %read{2,2} %write{0,0}
oparam	float	Fresnel	0 		 %read{2147483647,-1} %write{33,33}
oparam	float	Facing	0 		 %read{46,47} %write{34,47}
global	vector	I	 %read{2,2} %write{2147483647,-1}
global	normal	N	 %read{0,0} %write{2147483647,-1}
local	float	___310_c	 %read{12,24} %write{9,9}
local	float	___310_g	 %read{14,23} %write{13,16}
local	float	___310_result	 %read{33,33} %write{31,32}
local	float	___311_A	 %read{27,28} %write{19,19}
local	float	___311_B	 %read{29,29} %write{26,26}
local	float	blend	 %read{35,46} %write{1,45}
local	float	cosi	 %read{9,34} %write{2,2}
local	float	eta	 %read{7,10} %write{4,7}
const	float	$const1	1		 %read{3,47} %write{2147483647,-1}
temp	float	$tmp1	 %read{4,4} %write{3,3}
const	float	$const2	9.9999997e-006		 %read{4,37} %write{2147483647,-1}
temp	int	$tmp2	 %read{6,6} %write{5,5}
const	string	$const3	"fresnel_dielectric_cos"		 %read{8,8} %write{2147483647,-1}
temp	float	$tmp3	 %read{11,11} %write{10,10}
temp	float	$tmp4	 %read{13,13} %write{11,11}
temp	float	$tmp5	 %read{13,13} %write{12,12}
const	int	$const5	0		 %read{14,14} %write{2147483647,-1}
temp	int	$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{21,21} %write{20,20}
temp	float	$tmp10	 %read{22,22} %write{21,21}
temp	float	$tmp11	 %read{26,26} %write{22,22}
temp	float	$tmp12	 %read{24,24} %write{23,23}
temp	float	$tmp13	 %read{25,25} %write{24,24}
temp	float	$tmp14	 %read{26,26} %write{25,25}
const	float	$const6	0.5		 %read{27,45} %write{2147483647,-1}
temp	float	$tmp15	 %read{28,28} %write{27,27}
temp	float	$tmp16	 %read{31,31} %write{28,28}
temp	float	$tmp17	 %read{30,30} %write{29,29}
temp	float	$tmp18	 %read{31,31} %write{30,30}
temp	int	$tmp19	 %read{36,36} %write{35,35}
const	float	$const7	0		 %read{40,40} %write{2147483647,-1}
temp	float	$tmp20	 %read{39,39} %write{37,37}
const	string	$const8	"clamp"		 %read{38,38} %write{2147483647,-1}
temp	float	$tmp21	 %read{40,40} %write{39,39}
temp	int	$tmp22	 %read{42,42} %write{41,41}
const	float	$const9	2		 %read{43,43} %write{2147483647,-1}
temp	float	$tmp23	 %read{45,45} %write{44,44}
code Normal
# D:\\blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:23
# 	output float Fresnel = 0.0,
	assign		Normal N 	%filename{"D:\\blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl"} %line{23} %argrw{"wr"}
code ___main___
# D:\\blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:27
# 	float cosi = dot(I, Normal);
	assign		blend Blend 	%filename{"D:\\blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl"} %line{27} %argrw{"wr"}
# D:\\blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:28
# 
	dot		cosi I Normal 	%line{28} %argrw{"wrr"}
# D:\\blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:31
# 	eta = backfacing() ? eta : 1.0 / eta;
	sub		$tmp1 $const1 Blend 	%line{31} %argrw{"wrr"}
	max		eta $tmp1 $const2 	%argrw{"wrr"}
# D:\\blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:32
# 	Fresnel = fresnel_dielectric_cos(cosi, eta);
	backfacing	$tmp2 	%line{32} %argrw{"w"}
	if		$tmp2 7 8 	%argrw{"r"}
	div		eta $const1 eta 	%argrw{"wrr"}
# D:\\blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:33
# 
	functioncall	$const3 34 	%line{33} %argrw{"r"}
# D:/blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_fresnel.h:21
# 	float c = fabs(cosi);
	fabs		___310_c cosi 	%filename{"D:/blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_fresnel.h"} %line{21} %argrw{"wr"}
# D:/blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_fresnel.h:22
# 	float g = eta * eta - 1 + c * c;
	mul		$tmp3 eta eta 	%line{22} %argrw{"wrr"}
	sub		$tmp4 $tmp3 $const1 	%argrw{"wrr"}
	mul		$tmp5 ___310_c ___310_c 	%argrw{"wrr"}
	add		___310_g $tmp4 $tmp5 	%argrw{"wrr"}
# D:/blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_fresnel.h:25
# 	if (g > 0) {
	gt		$tmp6 ___310_g $const5 	%line{25} %argrw{"wrr"}
	if		$tmp6 32 33 	%argrw{"r"}
# D:/blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_fresnel.h:26
# 		g = sqrt(g);
	sqrt		___310_g ___310_g 	%line{26} %argrw{"wr"}
# D:/blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_fresnel.h:27
# 		float A = (g - c) / (g + c);
	sub		$tmp7 ___310_g ___310_c 	%line{27} %argrw{"wrr"}
	add		$tmp8 ___310_g ___310_c 	%argrw{"wrr"}
	div		___311_A $tmp7 $tmp8 	%argrw{"wrr"}
# D:/blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_fresnel.h:28
# 		float B = (c * (g + c) - 1) / (c * (g - c) + 1);
	add		$tmp9 ___310_g ___310_c 	%line{28} %argrw{"wrr"}
	mul		$tmp10 ___310_c $tmp9 	%argrw{"wrr"}
	sub		$tmp11 $tmp10 $const1 	%argrw{"wrr"}
	sub		$tmp12 ___310_g ___310_c 	%argrw{"wrr"}
	mul		$tmp13 ___310_c $tmp12 	%argrw{"wrr"}
	add		$tmp14 $tmp13 $const1 	%argrw{"wrr"}
	div		___311_B $tmp11 $tmp14 	%argrw{"wrr"}
# D:/blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_fresnel.h:29
# 		result = 0.5 * A * A * (1 + B * B);
	mul		$tmp15 $const6 ___311_A 	%line{29} %argrw{"wrr"}
	mul		$tmp16 $tmp15 ___311_A 	%argrw{"wrr"}
	mul		$tmp17 ___311_B ___311_B 	%argrw{"wrr"}
	add		$tmp18 $const1 $tmp17 	%argrw{"wrr"}
	mul		___310_result $tmp16 $tmp18 	%argrw{"wrr"}
# D:/blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_fresnel.h:32
# 		result = 1.0;  /* TIR (no refracted component) */
	assign		___310_result $const1 	%line{32} %argrw{"wr"}
# D:/blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_fresnel.h:34
# 	return result;
	assign		Fresnel ___310_result 	%line{34} %argrw{"wr"}
# D:\\blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:36
#  * Copyright 2011-2013 Blender Foundation
	fabs		Facing cosi 	%filename{"D:\\blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl"} %line{36} %argrw{"wr"}
# D:\\blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:38
#  * Licensed under the Apache License, Version 2.0 (the "License");
	neq		$tmp19 blend $const6 	%line{38} %argrw{"wrr"}
	if		$tmp19 47 47 	%argrw{"r"}
# D:\\blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:39
#  * you may not use this file except in compliance with the License.
	sub		$tmp20 $const1 $const2 	%line{39} %argrw{"wrr"}
	functioncall	$const8 41 	%argrw{"r"}
# D:/blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\stdosl.h:144
# vector log (vector a, float b) { return log(a)/log(b); }
	min		$tmp21 blend $tmp20 	%filename{"D:/blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\stdosl.h"} %line{144} %argrw{"wrr"}
	max		blend $tmp21 $const7 	%argrw{"wrr"}
# D:\\blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:40
# 
	lt		$tmp22 blend $const6 	%filename{"D:\\blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl"} %line{40} %argrw{"wrr"}
	if		$tmp22 44 46 	%argrw{"r"}
	mul		blend $const9 blend 	%argrw{"wrr"}
	sub		$tmp23 $const1 blend 	%argrw{"wrr"}
	div		blend $const6 $tmp23 	%argrw{"wrr"}
# D:\\blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:42
# 	}
	pow		Facing Facing blend 	%line{42} %argrw{"wrr"}
# D:\\blender_dev\\code\\blender\\intern\\cycles\\kernel\\shaders\\node_layer_weight.osl:45
# }
	sub		Facing $const1 Facing 	%line{45} %argrw{"wrr"}
	end
