OpenShadingLanguage 1.01
# Compiled by oslc 1.6.2
surface metal	%meta{string,help,"Metal, simple, with reflections"} 
param	float	Ka	1		%meta{string,help,"Ambient scaling"} %meta{float,min,0} %meta{float,max,1}  %read{27,27} %write{2147483647,-1}
param	float	Kd	0.1		%meta{string,help,"Diffuse scaling"} %meta{float,min,0} %meta{float,max,1}  %read{45,45} %write{2147483647,-1}
param	float	Ks	0.80000001		%meta{string,help,"Specular scaling"} %meta{float,min,0} %meta{float,max,1}  %read{69,69} %write{2147483647,-1}
param	float	roughness	0.2		%meta{string,help,"Surface roughness (specular highlight size)"} %meta{float,min,0} %meta{float,max,1}  %read{63,63} %write{2147483647,-1}
param	float	Kr	0.5		%meta{string,help,"Reflectivity / Environment scaling"} %meta{float,min,0} %meta{float,max,1}  %read{25,25} %write{2147483647,-1}
param	string	envname	""		%meta{string,help,"Map or geometry set name for reflections"}  %read{72,93} %write{2147483647,-1}
param	float	blur	0		%meta{string,help,"Environment blur"} %meta{float,min,0} %meta{float,max,1}  %read{84,93} %write{2147483647,-1}
param	string	envspace	"world"		%meta{string,help,"Coordinate system for environment map lookup"}  %read{78,90} %write{2147483647,-1}
param	float	samples	1		%meta{string,help,"Environment samples (for ray tracing)"} %meta{float,min,1} %meta{float,max,64}  %read{92,92} %write{2147483647,-1}
param	float	twosided	0		%meta{string,help,"Two-sided reflections"}  %read{16,16} %write{2147483647,-1}
global	point	P	%read{31,93} %write{2147483647,-1} %derivs
global	vector	I	%read{3,19} %write{2147483647,-1} %derivs
global	normal	N	%read{0,19} %write{2147483647,-1} %derivs
global	normal	Ng	%read{3,3} %write{2147483647,-1}
global	color	C	%read{98,100} %write{98,100}
global	color	opacity	%read{100,100} %write{2147483647,-1}
global	vector	L	%read{38,57} %write{2147483647,-1}
global	color	Cl	%read{36,56} %write{2147483647,-1}
local	color	___278_C	%read{30,44} %write{29,43}
local	float	___279___nondiffuse	%read{30,43} %write{30,43}
local	vector	___280_H	%read{50,67} %write{50,67}
local	color	___281_C	%read{50,68} %write{49,67}
local	float	___282___nonspecular	%read{50,67} %write{50,67}
local	int	___301_status	%read{87,87} %write{86,86}
local	color	___302_C	%read{95,95} %write{84,94}
local	point	___304_Pndc	%read{82,83} %write{81,81} %derivs
local	vector	___306_D	%read{2147483647,-1} %write{90,90}
local	vector	___315_IN	%read{12,47} %write{10,10} %derivs
local	vector	___315_R	%read{90,93} %write{15,15} %derivs
local	float	___315_kr	%read{74,96} %write{24,25}
local	normal	Nf	%read{12,61} %write{6,7} %derivs
temp	normal	$tmp1	%read{6,7} %write{0,0} %derivs
const	string	$const1	"faceforward"		%read{1,2} %write{2147483647,-1}
temp	float	$tmp2	%read{4,4} %write{3,3}
const	int	$const2	0		%read{4,94} %write{2147483647,-1}
temp	int	$tmp3	%read{5,5} %write{4,4}
const	string	$const3	"MaterialShinyMetal"		%read{9,9} %write{2147483647,-1}
const	string	$const4	"reflect"		%read{11,11} %write{2147483647,-1}
temp	float	$tmp4	%read{13,13} %write{12,12} %derivs
temp	float	$tmp5	%read{14,14} %write{13,13} %derivs
const	float	$const6	2		%read{13,13} %write{2147483647,-1}
temp	vector	$tmp6	%read{15,15} %write{14,14} %derivs
temp	int	$tmp7	%read{17,17} %write{16,16}
temp	int	$tmp8	%read{18,23} %write{17,22}
temp	float	$tmp9	%read{20,20} %write{19,19}
temp	int	$tmp10	%read{21,21} %write{20,20}
temp	int	$tmp11	%read{22,22} %write{21,21}
temp	color	$tmp12	%read{27,27} %write{26,26}
temp	color	$tmp13	%read{30,46} %write{27,43}
temp	color	$tmp14	%read{45,45} %write{44,44}
const	string	$const7	"diffuse"		%read{28,28} %write{2147483647,-1}
const	float	$const8	1.5707964		%read{31,52} %write{2147483647,-1}
temp	int	$tmp15	%read{30,43} %write{30,43}
temp	int	$tmp16	%read{2147483647,-1} %write{34,34}
const	string	$const9	"light"		%read{34,54} %write{2147483647,-1}
const	string	$const10	"__nondiffuse"		%read{34,34} %write{2147483647,-1}
const	int	$const11	1		%read{83,83} %write{2147483647,-1}
temp	float	$tmp17	%read{36,36} %write{35,35}
const	float	$const12	1		%read{35,55} %write{2147483647,-1}
temp	color	$tmp18	%read{42,42} %write{36,36}
temp	color	$tmp19	%read{42,42} %write{41,41}
const	float	$const13	0		%read{37,62} %write{2147483647,-1}
temp	color	$tmp20	%read{41,41} %write{37,37}
temp	float	$tmp21	%read{40,40} %write{39,39}
temp	vector	$tmp22	%read{39,39} %write{38,38}
temp	color	$tmp23	%read{41,41} %write{40,40}
temp	color	$tmp24	%read{30,43} %write{30,43}
temp	color	$tmp25	%read{46,46} %write{45,45}
temp	color	$tmp26	%read{50,70} %write{46,67}
temp	color	$tmp27	%read{69,69} %write{68,68}
temp	vector	$tmp28	%read{50,67} %write{47,67}
const	string	$const14	"specular"		%read{48,48} %write{2147483647,-1}
temp	int	$tmp29	%read{50,67} %write{50,67}
temp	int	$tmp30	%read{2147483647,-1} %write{54,54}
const	string	$const15	"__nonspecular"		%read{54,54} %write{2147483647,-1}
temp	float	$tmp31	%read{56,56} %write{55,55}
temp	color	$tmp32	%read{66,66} %write{56,56}
temp	color	$tmp33	%read{66,66} %write{65,65}
temp	vector	$tmp34	%read{59,59} %write{57,57}
const	string	$const16	"specularbrdf"		%read{58,58} %write{2147483647,-1}
temp	vector	$tmp35	%read{60,60} %write{59,59}
temp	float	$tmp36	%read{65,65} %write{64,64}
temp	float	$tmp37	%read{64,64} %write{62,62}
temp	float	$tmp38	%read{62,62} %write{61,61}
temp	float	$tmp39	%read{64,64} %write{63,63}
const	float	$const18	8		%read{63,63} %write{2147483647,-1}
temp	color	$tmp40	%read{50,67} %write{50,67}
temp	color	$tmp41	%read{70,70} %write{69,69}
temp	color	$tmp42	%read{97,97} %write{70,70}
temp	color	$tmp43	%read{96,96} %write{95,95}
const	string	$const19	"Environment"		%read{71,71} %write{2147483647,-1}
temp	int	$tmp44	%read{73,77} %write{72,76}
const	string	$const20	""		%read{72,72} %write{2147483647,-1}
temp	int	$tmp45	%read{75,75} %write{74,74}
temp	int	$tmp46	%read{76,76} %write{75,75}
const	string	$const21	"NDC"		%read{78,81} %write{2147483647,-1}
temp	int	$tmp47	%read{79,79} %write{78,78}
const	string	$const22	"transform"		%read{80,89} %write{2147483647,-1}
const	string	$const23	"common"		%read{81,90} %write{2147483647,-1}
temp	float	$tmp48	%read{84,84} %write{82,82} %derivs
temp	float	$tmp49	%read{84,84} %write{83,83} %derivs
const	string	$const24	"blur"		%read{84,93} %write{2147483647,-1}
temp	int	$tmp50	%read{88,88} %write{87,87}
const	string	$const25	"istexture"		%read{85,85} %write{2147483647,-1}
temp	int	$tmp51	%read{2147483647,-1} %write{86,86}
const	string	$const26	"exists"		%read{86,86} %write{2147483647,-1}
const	string	$const27	"samples"		%read{93,93} %write{2147483647,-1}
temp	int	$tmp52	%read{93,93} %write{92,92}
const	string	$const28	"traceset"		%read{93,93} %write{2147483647,-1}
temp	color	$tmp53	%read{97,97} %write{96,96}
temp	color	$tmp54	%read{98,98} %write{97,97}
code ___main___
# D:\\xrt.git\\src\\osl\\shaders\\metal.osl:86
#     C = MaterialShinyMetal (Nf, C, Ka, Kd, Ks, roughness, Kr, blur,
	normalize	$tmp1 N 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\metal.osl"} %line{86} %argrw{"wr"}
	functioncall	$const1 9 	%argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:196
# PERCOMP1 (logb)
	functioncall	$const1 9 	%filename{"D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h"} %line{196} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:192
#     return (dot(I,Nref) > 0) ? -N : N;
	dot		$tmp2 I Ng 	%line{192} %argrw{"wrr"}
	gt		$tmp3 $tmp2 $const2 	%argrw{"wrr"}
	if		$tmp3 7 8 	%argrw{"r"}
	neg		Nf $tmp1 	%argrw{"wr"}
	assign		Nf $tmp1 	%argrw{"wr"}
	return
# D:\\xrt.git\\src\\osl\\shaders\\metal.osl:88
# 
	functioncall	$const3 100 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\metal.osl"} %line{88} %argrw{"r"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:282
# // envname must be an ordinary texture map that's an image made with
	normalize	___315_IN I 	%filename{"D:/xrt.git\\src\\osl\\shaders\\material.h"} %line{282} %argrw{"wr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:283
# // the camera on "the other side" of the flat mirror.
	functioncall	$const4 16 	%line{283} %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		$tmp4 Nf ___315_IN 	%filename{"D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h"} %line{198} %argrw{"wrr"}
	mul		$tmp5 $const6 $tmp4 	%argrw{"wrr"}
	mul		$tmp6 $tmp5 Nf 	%argrw{"wrr"}
	sub		___315_R ___315_IN $tmp6 	%argrw{"wrr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:286
# 
	eq		$tmp7 twosided $const2 	%filename{"D:/xrt.git\\src\\osl\\shaders\\material.h"} %line{286} %argrw{"wrr"}
	neq		$tmp8 $tmp7 $const2 	%argrw{"wrr"}
	if		$tmp8 23 23 	%argrw{"r"}
	dot		$tmp9 N I 	%argrw{"wrr"}
	gt		$tmp10 $tmp9 $const2 	%argrw{"wrr"}
	neq		$tmp11 $tmp10 $const2 	%argrw{"wrr"}
	assign		$tmp8 $tmp11 	%argrw{"wr"}
	if		$tmp8 25 26 	%argrw{"r"}
	assign		___315_kr $const2 	%argrw{"wr"}
	assign		___315_kr Kr 	%argrw{"wr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:287
# 
	ambient		$tmp12 	%line{287} %argrw{"w"}
	mul		$tmp13 Ka $tmp12 	%argrw{"wrr"}
	functioncall	$const7 45 	%argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:501
#     if (g >= 0.0) {
	assign		___278_C $const2 	%filename{"D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h"} %line{501} %argrw{"wr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:503
#         float beta = g - c;
	for		$tmp15 32 33 44 44 	%line{503} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:507
#         Kr = F;
	lights_begin	P Nf $const8 	%line{507} %argrw{"rrr"}
	lights		$tmp15 P Nf $const8 	%argrw{"wrrr"} %argderivs{1}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:504
# 		float __nondiffuse = 0;
	assign		___279___nondiffuse $const2 	%line{504} %argrw{"wr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:505
# 		getmessage ("light", "__nondiffuse", __nondiffuse);
	getmessage	$tmp16 $const9 $const10 ___279___nondiffuse 	%line{505} %argrw{"wrrw"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:506
# 		C += Cl * (1-__nondiffuse) * max (0, dot (N, normalize (L)));
	sub		$tmp17 $const12 ___279___nondiffuse 	%line{506} %argrw{"wrr"}
	mul		$tmp18 Cl $tmp17 	%argrw{"wrr"}
	assign		$tmp20 $const13 	%argrw{"wr"}
	normalize	$tmp22 L 	%argrw{"wr"}
	dot		$tmp21 Nf $tmp22 	%argrw{"wrr"}
	assign		$tmp23 $tmp21 	%argrw{"wr"}
	max		$tmp19 $tmp20 $tmp23 	%argrw{"wrr"}
	mul		$tmp24 $tmp18 $tmp19 	%argrw{"wrr"}
	add		___278_C ___278_C $tmp24 	%argrw{"wrr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:508
# 	return C;
	assign		$tmp14 ___278_C 	%line{508} %argrw{"wr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:287
#     return basecolor * (Ka*ambient() + Kd*diffuse(Nf) +
	mul		$tmp25 Kd $tmp14 	%filename{"D:/xrt.git\\src\\osl\\shaders\\material.h"} %line{287} %argrw{"wrr"}
	add		$tmp26 $tmp13 $tmp25 	%argrw{"wrr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:288
#                         Ks*specular(Nf,-IN,roughness) + 
	neg		$tmp28 ___315_IN 	%line{288} %argrw{"wr"}
	functioncall	$const14 69 	%argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:527
# 
	assign		___281_C $const2 	%filename{"D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h"} %line{527} %argrw{"wr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:529
# normal transform (matrix Mto, normal p) BUILTIN;
	for		$tmp29 52 53 68 68 	%line{529} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:533
# vector transform (string from, string to, vector p) BUILTIN;
	lights_begin	P Nf $const8 	%line{533} %argrw{"rrr"}
	lights		$tmp29 P Nf $const8 	%argrw{"wrrr"} %argderivs{1}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:530
# 		float __nonspecular = 0;
	assign		___282___nonspecular $const2 	%line{530} %argrw{"wr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:531
# 		getmessage ("light", "__nonspecular", __nonspecular);
	getmessage	$tmp30 $const9 $const15 ___282___nonspecular 	%line{531} %argrw{"wrrw"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:532
# 		C += Cl * (1-__nonspecular) * specularbrdf (normalize (L), N, V, roughness);
	sub		$tmp31 $const12 ___282___nonspecular 	%line{532} %argrw{"wrr"}
	mul		$tmp32 Cl $tmp31 	%argrw{"wrr"}
	normalize	$tmp34 L 	%argrw{"wr"}
	functioncall	$const16 66 	%argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:511
# 	vector H = normalize( L + V );
	add		$tmp35 $tmp34 $tmp28 	%line{511} %argrw{"wrr"}
	normalize	___280_H $tmp35 	%argrw{"wr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:512
# 	return pow (max (0, dot (N, H)), 8 / roughness);
	dot		$tmp38 Nf ___280_H 	%line{512} %argrw{"wrr"}
	max		$tmp37 $const13 $tmp38 	%argrw{"wrr"}
	div		$tmp39 $const18 roughness 	%argrw{"wrr"}
	pow		$tmp36 $tmp37 $tmp39 	%argrw{"wrr"}
	assign		$tmp33 $tmp36 	%argrw{"wr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:532
# 		C += Cl * (1-__nonspecular) * specularbrdf (normalize (L), N, V, roughness);
	mul		$tmp40 $tmp32 $tmp33 	%line{532} %argrw{"wrr"}
	add		___281_C ___281_C $tmp40 	%argrw{"wrr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:534
# 	return C;
	assign		$tmp27 ___281_C 	%line{534} %argrw{"wr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:288
#                         Ks*specular(Nf,-IN,roughness) + 
	mul		$tmp41 Ks $tmp27 	%filename{"D:/xrt.git\\src\\osl\\shaders\\material.h"} %line{288} %argrw{"wrr"}
	add		$tmp42 $tmp26 $tmp41 	%argrw{"wrr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:290
#                                         blur, samples, kr));
	functioncall	$const19 96 	%line{290} %argrw{"r"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:205
#     if (envname && Kr > 0) {
	neq		$tmp44 envname $const20 	%line{205} %argrw{"wrr"}
	if		$tmp44 77 77 	%argrw{"r"}
	gt		$tmp45 ___315_kr $const2 	%argrw{"wrr"}
	neq		$tmp46 $tmp45 $const2 	%argrw{"wrr"}
	assign		$tmp44 $tmp46 	%argrw{"wr"}
	if		$tmp44 94 95 	%argrw{"r"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:206
#         if (envspace == "NDC") {
	eq		$tmp47 envspace $const21 	%line{206} %argrw{"wrr"}
	if		$tmp47 85 94 	%argrw{"r"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:208
#             point Pndc = transform ("NDC", P);
	functioncall	$const22 82 	%line{208} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:249
# #define M_E        2.7182818284590452        /* e (Euler's number) */
	transform	___304_Pndc $const23 $const21 P 	%filename{"D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h"} %line{249} %argrw{"wrrr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:209
#             C = texture (envname, Pndc[0], Pndc[1], "blur", blur);
	compref		$tmp48 ___304_Pndc $const2 	%filename{"D:/xrt.git\\src\\osl\\shaders\\material.h"} %line{209} %argrw{"wrr"}
	compref		$tmp49 ___304_Pndc $const11 	%argrw{"wrr"}
	texture		___302_C envname $tmp48 $tmp49 $const24 blur 	%argrw{"wrrrrr"} %argderivs{2,3}
# D:/xrt.git\\src\\osl\\shaders\\material.h:211
# 			if (istexture (envname)) {
	functioncall	$const25 88 	%line{211} %argrw{"r"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:169
# 	gettextureinfo (envname, "exists", status);
	gettextureinfo	$tmp51 envname $const26 ___301_status 	%line{169} %argrw{"wrrw"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:170
# 	return status;
	assign		$tmp50 ___301_status 	%line{170} %argrw{"wr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:211
# 			if (istexture (envname)) {
	if		$tmp50 92 94 	%line{211} %argrw{"r"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:213
#                 vector D = transform (envspace, R);
	functioncall	$const22 91 	%line{213} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:248
# #define M_PI_2     1.5707963267948966        /* pi/2 */
	transformv	___306_D $const23 envspace ___315_R 	%filename{"D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h"} %line{248} %argrw{"wrrr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:214
#                 C = environment (envname, R, "blur", blur);
	environment	___302_C envname ___315_R $const24 blur 	%filename{"D:/xrt.git\\src\\osl\\shaders\\material.h"} %line{214} %argrw{"wrrrr"} %argderivs{2}
# D:/xrt.git\\src\\osl\\shaders\\material.h:217
#                 C = trace (P, R, "blur", blur, "samples", (int)samples,
	assign		$tmp52 samples 	%line{217} %argrw{"wr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:218
#                              "traceset", envname);
	trace		___302_C P ___315_R $const24 blur $const27 $tmp52 $const28 envname 	%line{218} %argrw{"wrrrrrrrr"} %argderivs{1,2}
# D:/xrt.git\\src\\osl\\shaders\\material.h:222
#     else C = 0;
	assign		___302_C $const2 	%line{222} %argrw{"wr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:223
#     return C;
	assign		$tmp43 ___302_C 	%line{223} %argrw{"wr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:290
#                                         blur, samples, kr));
	mul		$tmp53 ___315_kr $tmp43 	%line{290} %argrw{"wrr"}
	add		$tmp54 $tmp42 $tmp53 	%argrw{"wrr"}
	mul		C C $tmp54 	%argrw{"wrr"}
	return
# D:\\xrt.git\\src\\osl\\shaders\\metal.osl:91
# }
	mul		C C opacity 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\metal.osl"} %line{91} %argrw{"wrr"}
	end
