OpenShadingLanguage 1.00
# Compiled by oslc 1.3.2
shader node_environment_texture
param	int	use_mapping	0 		 %read{2,2} %write{2147483647,-1}
param	matrix	mapping	0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0		 %read{3,3} %write{2147483647,-1} %derivs
param	vector	Vector	0 0 0 		 %read{1,1} %write{0,0} %derivs
param	string	filename	"" 		 %read{49,49} %write{2147483647,-1}
param	string	projection	"Equirectangular" 		 %read{5,5} %write{2147483647,-1}
param	string	color_space	"sRGB" 		 %read{66,66} %write{2147483647,-1}
param	int	is_float	1 		 %read{62,62} %write{2147483647,-1}
param	int	use_alpha	1 		 %read{50,50} %write{2147483647,-1}
oparam	color	Color	0 0 0 		 %read{59,99} %write{49,114}
oparam	float	Alpha	1 		 %read{52,59} %write{49,49}
global	point	P	 %read{0,0} %write{2147483647,-1} %derivs
local	float	___629_u	 %read{26,26} %write{14,14} %derivs
local	float	___629_v	 %read{26,26} %write{25,25} %derivs
local	float	___630_div	 %read{36,38} %write{35,35} %derivs
local	float	___630_u	 %read{45,45} %write{41,41} %derivs
local	float	___630_v	 %read{45,45} %write{44,44} %derivs
local	vector	p	 %read{3,47} %write{1,45} %derivs
const	string	$const1	"Equirectangular"		 %read{5,5} %write{2147483647,-1}
temp	int	$tmp1	 %read{6,6} %write{5,5}
const	string	$const2	"environment_texture_direction_to_equirectangular"		 %read{7,7} %write{2147483647,-1}
temp	float	$tmp2	 %read{11,11} %write{10,10} %derivs
const	int	$const3	1		 %read{8,84} %write{2147483647,-1}
temp	float	$tmp3	 %read{10,10} %write{8,8} %derivs
const	int	$const4	0		 %read{9,69} %write{2147483647,-1}
temp	float	$tmp4	 %read{10,10} %write{9,9} %derivs
temp	float	$tmp5	 %read{13,13} %write{11,11} %derivs
const	float	$const5	2		 %read{12,35} %write{2147483647,-1}
const	float	$const6	3.1415927		 %read{12,24} %write{2147483647,-1}
temp	float	$tmp6	 %read{13,13} %write{12,12} %derivs
temp	float	$tmp7	 %read{14,14} %write{13,13} %derivs
const	float	$const7	0.5		 %read{14,44} %write{2147483647,-1}
temp	float	$tmp8	 %read{24,24} %write{23,23} %derivs
const	int	$const8	2		 %read{15,99} %write{2147483647,-1}
temp	float	$tmp9	 %read{23,23} %write{15,15} %derivs
temp	float	$tmp10	 %read{23,23} %write{22,22} %derivs
temp	float	$tmp11	 %read{19,19} %write{16,16} %derivs
temp	float	$tmp12	 %read{20,20} %write{17,17} %derivs
const	string	$const9	"hypot"		 %read{18,18} %write{2147483647,-1}
temp	float	$tmp13	 %read{21,21} %write{19,19} %derivs
temp	float	$tmp14	 %read{21,21} %write{20,20} %derivs
temp	float	$tmp15	 %read{22,22} %write{21,21} %derivs
temp	float	$tmp16	 %read{25,25} %write{24,24} %derivs
const	float	$const10	0		 %read{26,105} %write{2147483647,-1}
const	string	$const11	"environment_texture_direction_to_mirrorball"		 %read{27,27} %write{2147483647,-1}
temp	float	$tmp17	 %read{29,29} %write{28,28} %derivs
const	float	$const12	1		 %read{29,110} %write{2147483647,-1}
temp	float	$tmp18	 %read{30,30} %write{29,29} %derivs
temp	float	$tmp19	 %read{35,35} %write{34,34} %derivs
temp	float	$tmp20	 %read{34,34} %write{33,33} %derivs
const	float	$const13	-0.5		 %read{32,32} %write{2147483647,-1}
temp	float	$tmp21	 %read{32,32} %write{31,31} %derivs
temp	float	$tmp22	 %read{33,33} %write{32,32} %derivs
temp	int	$tmp23	 %read{37,37} %write{36,36}
temp	float	$tmp24	 %read{40,40} %write{39,39} %derivs
temp	float	$tmp25	 %read{41,41} %write{40,40} %derivs
temp	float	$tmp26	 %read{43,43} %write{42,42} %derivs
temp	float	$tmp27	 %read{44,44} %write{43,43} %derivs
temp	float	$tmp28	 %read{49,49} %write{46,46} %derivs
temp	float	$tmp29	 %read{48,48} %write{47,47} %derivs
temp	float	$tmp30	 %read{49,49} %write{48,48} %derivs
const	string	$const14	"wrap"		 %read{49,49} %write{2147483647,-1}
const	string	$const15	"periodic"		 %read{49,49} %write{2147483647,-1}
const	string	$const16	"alpha"		 %read{49,49} %write{2147483647,-1}
const	string	$const17	"color_unpremultiply"		 %read{51,51} %write{2147483647,-1}
temp	int	$tmp31	 %read{53,53} %write{52,52}
temp	int	$tmp32	 %read{54,58} %write{53,57}
temp	int	$tmp33	 %read{56,56} %write{55,55}
temp	int	$tmp34	 %read{57,57} %write{56,56}
temp	int	$tmp35	 %read{63,63} %write{62,62}
temp	color	$tmp36	 %read{65,65} %write{64,64}
const	string	$const18	"sRGB"		 %read{66,66} %write{2147483647,-1}
temp	int	$tmp37	 %read{67,67} %write{66,66}
const	string	$const19	"color_srgb_to_scene_linear"		 %read{68,100} %write{2147483647,-1}
temp	float	$tmp38	 %read{114,114} %write{75,82}
temp	float	$tmp39	 %read{71,79} %write{69,69}
const	float	$const20	0.040449999		 %read{71,101} %write{2147483647,-1}
temp	int	$tmp40	 %read{72,72} %write{71,71}
temp	int	$tmp41	 %read{74,74} %write{73,73}
const	float	$const21	12.92		 %read{76,106} %write{2147483647,-1}
temp	float	$tmp42	 %read{77,77} %write{76,76}
const	float	$const22	0.055		 %read{79,109} %write{2147483647,-1}
temp	float	$tmp43	 %read{81,81} %write{79,79}
const	float	$const23	1.0549999		 %read{80,110} %write{2147483647,-1}
temp	float	$tmp44	 %read{81,81} %write{80,80}
temp	float	$tmp45	 %read{82,82} %write{81,81}
const	float	$const24	2.4000001		 %read{82,112} %write{2147483647,-1}
temp	float	$tmp46	 %read{114,114} %write{90,97}
temp	float	$tmp47	 %read{86,94} %write{84,84}
temp	int	$tmp48	 %read{87,87} %write{86,86}
temp	int	$tmp49	 %read{89,89} %write{88,88}
temp	float	$tmp50	 %read{92,92} %write{91,91}
temp	float	$tmp51	 %read{96,96} %write{94,94}
temp	float	$tmp52	 %read{96,96} %write{95,95}
temp	float	$tmp53	 %read{97,97} %write{96,96}
temp	float	$tmp54	 %read{114,114} %write{105,112}
temp	float	$tmp55	 %read{101,109} %write{99,99}
temp	int	$tmp56	 %read{102,102} %write{101,101}
temp	int	$tmp57	 %read{104,104} %write{103,103}
temp	float	$tmp58	 %read{107,107} %write{106,106}
temp	float	$tmp59	 %read{111,111} %write{109,109}
temp	float	$tmp60	 %read{111,111} %write{110,110}
temp	float	$tmp61	 %read{112,112} %write{111,111}
code Vector
# intern/cycles/kernel/shaders/node_environment_texture.osl:45
# 	vector Vector = P,
	assign		Vector P 	%filename{"intern/cycles/kernel/shaders/node_environment_texture.osl"} %line{45} %argrw{"wr"}
code ___main___
# intern/cycles/kernel/shaders/node_environment_texture.osl:54
# 	vector p = Vector;
	assign		p Vector 	%filename{"intern/cycles/kernel/shaders/node_environment_texture.osl"} %line{54} %argrw{"wr"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:56
# 	if (use_mapping)
	if		use_mapping 4 4 	%line{56} %argrw{"r"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:57
# 		p = transform(mapping, p);
	transformv	p mapping p 	%line{57} %argrw{"wrr"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:59
# 	p = normalize(p);
	normalize	p p 	%line{59} %argrw{"wr"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:61
# 	if (projection == "Equirectangular")
	eq		$tmp1 projection $const1 	%line{61} %argrw{"wrr"}
	if		$tmp1 27 46 	%argrw{"r"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:62
# 		p = environment_texture_direction_to_equirectangular(p);
	functioncall	$const2 27 	%line{62} %argrw{"r"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:22
# 	float u = -atan2(dir[1], dir[0]) / (2.0 * M_PI) + 0.5;
	compref		$tmp3 p $const3 	%line{22} %argrw{"wrr"}
	compref		$tmp4 p $const4 	%argrw{"wrr"}
	atan2		$tmp2 $tmp3 $tmp4 	%argrw{"wrr"}
	neg		$tmp5 $tmp2 	%argrw{"wr"}
	mul		$tmp6 $const5 $const6 	%argrw{"wrr"}
	div		$tmp7 $tmp5 $tmp6 	%argrw{"wrr"}
	add		___629_u $tmp7 $const7 	%argrw{"wrr"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:23
# 	float v = atan2(dir[2], hypot(dir[0], dir[1])) / M_PI + 0.5;
	compref		$tmp9 p $const8 	%line{23} %argrw{"wrr"}
	compref		$tmp11 p $const4 	%argrw{"wrr"}
	compref		$tmp12 p $const3 	%argrw{"wrr"}
	functioncall	$const9 23 	%argrw{"r"}
# intern/cycles/kernel/shaders/stdosl.h:113
# PERCOMP1 (sin)
	mul		$tmp13 $tmp11 $tmp11 	%filename{"intern/cycles/kernel/shaders/stdosl.h"} %line{113} %argrw{"wrr"}
	mul		$tmp14 $tmp12 $tmp12 	%argrw{"wrr"}
	add		$tmp15 $tmp13 $tmp14 	%argrw{"wrr"}
	sqrt		$tmp10 $tmp15 	%argrw{"wr"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:23
# 	float v = atan2(dir[2], hypot(dir[0], dir[1])) / M_PI + 0.5;
	atan2		$tmp8 $tmp9 $tmp10 	%filename{"intern/cycles/kernel/shaders/node_environment_texture.osl"} %line{23} %argrw{"wrr"}
	div		$tmp16 $tmp8 $const6 	%argrw{"wrr"}
	add		___629_v $tmp16 $const7 	%argrw{"wrr"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:25
# 	return vector(u, v, 0.0);
	vector		p ___629_u ___629_v $const10 	%line{25} %argrw{"wrrr"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:64
# 		p = environment_texture_direction_to_mirrorball(p);
	functioncall	$const11 46 	%line{64} %argrw{"r"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:30
# 	dir[1] -= 1.0;
	compref		$tmp17 p $const3 	%line{30} %argrw{"wrr"}
	sub		$tmp18 $tmp17 $const12 	%argrw{"wrr"}
	compassign	p $const3 $tmp18 	%argrw{"wrr"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:32
# 	float div = 2.0 * sqrt(max(-0.5 * dir[1], 0.0));
	compref		$tmp21 p $const3 	%line{32} %argrw{"wrr"}
	mul		$tmp22 $const13 $tmp21 	%argrw{"wrr"}
	max		$tmp20 $tmp22 $const10 	%argrw{"wrr"}
	sqrt		$tmp19 $tmp20 	%argrw{"wr"}
	mul		___630_div $const5 $tmp19 	%argrw{"wrr"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:33
# 	if (div > 0.0)
	gt		$tmp23 ___630_div $const10 	%line{33} %argrw{"wrr"}
	if		$tmp23 39 39 	%argrw{"r"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:34
# 		dir /= div;
	div		p p ___630_div 	%line{34} %argrw{"wrr"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:36
# 	float u = 0.5 * (dir[0] + 1.0);
	compref		$tmp24 p $const4 	%line{36} %argrw{"wrr"}
	add		$tmp25 $tmp24 $const12 	%argrw{"wrr"}
	mul		___630_u $const7 $tmp25 	%argrw{"wrr"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:37
# 	float v = 0.5 * (dir[2] + 1.0);
	compref		$tmp26 p $const8 	%line{37} %argrw{"wrr"}
	add		$tmp27 $tmp26 $const12 	%argrw{"wrr"}
	mul		___630_v $const7 $tmp27 	%argrw{"wrr"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:39
# 	return vector(u, v, 0.0);
	vector		p ___630_u ___630_v $const10 	%line{39} %argrw{"wrrr"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:67
# 	Color = (color)texture(filename, p[0], 1.0 - p[1], "wrap", "periodic", "alpha", Alpha);
	compref		$tmp28 p $const4 	%line{67} %argrw{"wrr"}
	compref		$tmp29 p $const3 	%argrw{"wrr"}
	sub		$tmp30 $const12 $tmp29 	%argrw{"wrr"}
	texture		Color filename $tmp28 $tmp30 $const14 $const15 $const16 Alpha 	%argrw{"wrrrrrrw"} %argderivs{2,3}
# intern/cycles/kernel/shaders/node_environment_texture.osl:69
# 	if (use_alpha) {
	if		use_alpha 66 66 	%line{69} %argrw{"r"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:70
# 		Color = color_unpremultiply(Color, Alpha);
	functioncall	$const17 62 	%line{70} %argrw{"r"}
# intern/cycles/kernel/shaders/node_color.h:51
# 	if (alpha != 1.0 && alpha != 0.0)
	neq		$tmp31 Alpha $const12 	%filename{"intern/cycles/kernel/shaders/node_color.h"} %line{51} %argrw{"wrr"}
	neq		$tmp32 $tmp31 $const4 	%argrw{"wrr"}
	if		$tmp32 58 58 	%argrw{"r"}
	neq		$tmp33 Alpha $const10 	%argrw{"wrr"}
	neq		$tmp34 $tmp33 $const4 	%argrw{"wrr"}
	assign		$tmp32 $tmp34 	%argrw{"wr"}
	if		$tmp32 61 61 	%argrw{"r"}
# intern/cycles/kernel/shaders/node_color.h:52
# 		return c / alpha;
	div		Color Color Alpha 	%line{52} %argrw{"wrr"}
	return
# intern/cycles/kernel/shaders/node_color.h:54
# 	return c;
	assign		Color Color 	%line{54} %argrw{"wr"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:72
# #include "node_color.h"
	eq		$tmp35 is_float $const4 	%filename{"intern/cycles/kernel/shaders/node_environment_texture.osl"} %line{72} %argrw{"wrr"}
	if		$tmp35 66 66 	%argrw{"r"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:73
# 
	assign		$tmp36 $const12 	%line{73} %argrw{"wr"}
	min		Color Color $tmp36 	%argrw{"wrr"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:76
# 	float u = -atan2(dir[1], dir[0]) / (2.0 * M_PI) + 0.5;
	eq		$tmp37 color_space $const18 	%line{76} %argrw{"wrr"}
	if		$tmp37 115 115 	%argrw{"r"}
# intern/cycles/kernel/shaders/node_environment_texture.osl:77
# 	float v = atan2(dir[2], hypot(dir[0], dir[1])) / M_PI + 0.5;
	functioncall	$const19 115 	%line{77} %argrw{"r"}
# intern/cycles/kernel/shaders/node_color.h:36
# 		color_srgb_to_scene_linear(c[0]),
	compref		$tmp39 Color $const4 	%filename{"intern/cycles/kernel/shaders/node_color.h"} %line{36} %argrw{"wrr"}
	functioncall	$const19 84 	%argrw{"r"}
# intern/cycles/kernel/shaders/node_color.h:19
# 	if (c < 0.04045)
	lt		$tmp40 $tmp39 $const20 	%line{19} %argrw{"wrr"}
	if		$tmp40 79 84 	%argrw{"r"}
# intern/cycles/kernel/shaders/node_color.h:20
# 		return (c < 0.0) ? 0.0 : c * (1.0 / 12.92);
	lt		$tmp41 $tmp39 $const10 	%line{20} %argrw{"wrr"}
	if		$tmp41 76 78 	%argrw{"r"}
	assign		$tmp38 $const10 	%argrw{"wr"}
	div		$tmp42 $const12 $const21 	%argrw{"wrr"}
	mul		$tmp38 $tmp39 $tmp42 	%argrw{"wrr"}
	return
# intern/cycles/kernel/shaders/node_color.h:22
# 		return pow((c + 0.055) * (1.0 / 1.055), 2.4);
	add		$tmp43 $tmp39 $const22 	%line{22} %argrw{"wrr"}
	div		$tmp44 $const12 $const23 	%argrw{"wrr"}
	mul		$tmp45 $tmp43 $tmp44 	%argrw{"wrr"}
	pow		$tmp38 $tmp45 $const24 	%argrw{"wrr"}
	return
# intern/cycles/kernel/shaders/node_color.h:37
# 		color_srgb_to_scene_linear(c[1]),
	compref		$tmp47 Color $const3 	%line{37} %argrw{"wrr"}
	functioncall	$const19 99 	%argrw{"r"}
# intern/cycles/kernel/shaders/node_color.h:19
# 	if (c < 0.04045)
	lt		$tmp48 $tmp47 $const20 	%line{19} %argrw{"wrr"}
	if		$tmp48 94 99 	%argrw{"r"}
# intern/cycles/kernel/shaders/node_color.h:20
# 		return (c < 0.0) ? 0.0 : c * (1.0 / 12.92);
	lt		$tmp49 $tmp47 $const10 	%line{20} %argrw{"wrr"}
	if		$tmp49 91 93 	%argrw{"r"}
	assign		$tmp46 $const10 	%argrw{"wr"}
	div		$tmp50 $const12 $const21 	%argrw{"wrr"}
	mul		$tmp46 $tmp47 $tmp50 	%argrw{"wrr"}
	return
# intern/cycles/kernel/shaders/node_color.h:22
# 		return pow((c + 0.055) * (1.0 / 1.055), 2.4);
	add		$tmp51 $tmp47 $const22 	%line{22} %argrw{"wrr"}
	div		$tmp52 $const12 $const23 	%argrw{"wrr"}
	mul		$tmp53 $tmp51 $tmp52 	%argrw{"wrr"}
	pow		$tmp46 $tmp53 $const24 	%argrw{"wrr"}
	return
# intern/cycles/kernel/shaders/node_color.h:38
# 		color_srgb_to_scene_linear(c[2]));
	compref		$tmp55 Color $const8 	%line{38} %argrw{"wrr"}
	functioncall	$const19 114 	%argrw{"r"}
# intern/cycles/kernel/shaders/node_color.h:19
# 	if (c < 0.04045)
	lt		$tmp56 $tmp55 $const20 	%line{19} %argrw{"wrr"}
	if		$tmp56 109 114 	%argrw{"r"}
# intern/cycles/kernel/shaders/node_color.h:20
# 		return (c < 0.0) ? 0.0 : c * (1.0 / 12.92);
	lt		$tmp57 $tmp55 $const10 	%line{20} %argrw{"wrr"}
	if		$tmp57 106 108 	%argrw{"r"}
	assign		$tmp54 $const10 	%argrw{"wr"}
	div		$tmp58 $const12 $const21 	%argrw{"wrr"}
	mul		$tmp54 $tmp55 $tmp58 	%argrw{"wrr"}
	return
# intern/cycles/kernel/shaders/node_color.h:22
# 		return pow((c + 0.055) * (1.0 / 1.055), 2.4);
	add		$tmp59 $tmp55 $const22 	%line{22} %argrw{"wrr"}
	div		$tmp60 $const12 $const23 	%argrw{"wrr"}
	mul		$tmp61 $tmp59 $tmp60 	%argrw{"wrr"}
	pow		$tmp54 $tmp61 $const24 	%argrw{"wrr"}
	return
# intern/cycles/kernel/shaders/node_color.h:38
# 		color_srgb_to_scene_linear(c[2]));
	color		Color $tmp38 $tmp46 $tmp54 	%line{38} %argrw{"wrrr"}
	end
