OpenShadingLanguage 1.01
# Compiled by oslc 1.6.2
surface paintedplastic	%meta{string,help,"Plastic material with simple color texture map"} 
param	float	Ka	1		%meta{string,help,"Ambient scaling"} %meta{float,min,0} %meta{float,max,1}  %read{16,16} %write{2147483647,-1}
param	float	Kd	0.5		%meta{string,help,"Diffuse scaling"} %meta{float,min,0} %meta{float,max,1}  %read{34,34} %write{2147483647,-1}
param	float	Ks	0.5		%meta{string,help,"Specular scaling"} %meta{float,min,0} %meta{float,max,1}  %read{37,37} %write{2147483647,-1}
param	float	roughness	0.1		%meta{string,help,"Surface roughness (specular highlight size)"} %meta{float,min,0} %meta{float,UImax,1}  %read{55,55} %write{2147483647,-1}
param	color	specularcolor	1 1 1		%meta{string,help,"Specular highlight color"}  %read{37,37} %write{2147483647,-1}
param	string	texturename	""		%meta{string,help,"Texture map name (empty for no texture)"}  %read{2,4} %write{2147483647,-1}
param	float	blur	0		%meta{string,help,"Texture map blur"} %meta{float,min,0} %meta{float,max,1}  %read{4,4} %write{2147483647,-1}
param	string	wrap	"default"		%meta{string,help,"Texture map wrap mode"}  %read{4,4} %write{2147483647,-1}
param	float	s	0		%meta{string,help,"s texture coordinate (defaults to u)"}  %read{4,4} %write{0,0} %derivs %initexpr
param	float	t	0		%meta{string,help,"t texture coordinate (defaults to v)"}  %read{4,4} %write{1,1} %derivs %initexpr
global	point	P	%read{20,44} %write{2147483647,-1} %derivs
global	vector	I	%read{9,38} %write{2147483647,-1}
global	normal	N	%read{6,6} %write{2147483647,-1}
global	normal	Ng	%read{9,9} %write{2147483647,-1}
global	float	u	%read{0,0} %write{2147483647,-1} %derivs
global	float	v	%read{1,1} %write{2147483647,-1} %derivs
global	color	C	%read{5,63} %write{5,63}
global	color	opacity	%read{63,63} %write{2147483647,-1}
global	vector	L	%read{27,49} %write{2147483647,-1}
global	color	Cl	%read{25,48} %write{2147483647,-1}
local	color	___278_C	%read{19,33} %write{18,32}
local	float	___279___nondiffuse	%read{19,32} %write{19,32}
local	vector	___280_H	%read{42,59} %write{42,59}
local	color	___281_C	%read{42,60} %write{41,59}
local	float	___282___nonspecular	%read{42,59} %write{42,59}
local	normal	Nf	%read{20,53} %write{12,13}
temp	int	$tmp1	%read{3,3} %write{2,2}
const	string	$const1	""		%read{2,2} %write{2147483647,-1}
temp	color	$tmp2	%read{5,5} %write{4,4}
const	string	$const2	"blur"		%read{4,4} %write{2147483647,-1}
const	string	$const3	"wrap"		%read{4,4} %write{2147483647,-1}
temp	normal	$tmp3	%read{12,13} %write{6,6}
const	string	$const4	"faceforward"		%read{7,8} %write{2147483647,-1}
temp	float	$tmp4	%read{10,10} %write{9,9}
const	int	$const5	0		%read{10,45} %write{2147483647,-1}
temp	int	$tmp5	%read{11,11} %write{10,10}
temp	color	$tmp6	%read{16,16} %write{15,15}
temp	color	$tmp7	%read{19,35} %write{16,32}
temp	color	$tmp8	%read{34,34} %write{33,33}
const	string	$const6	"diffuse"		%read{17,17} %write{2147483647,-1}
const	float	$const7	1.5707964		%read{20,44} %write{2147483647,-1}
temp	int	$tmp9	%read{19,32} %write{19,32}
temp	int	$tmp10	%read{2147483647,-1} %write{23,23}
const	string	$const8	"light"		%read{23,46} %write{2147483647,-1}
const	string	$const9	"__nondiffuse"		%read{23,23} %write{2147483647,-1}
temp	float	$tmp11	%read{25,25} %write{24,24}
const	float	$const11	1		%read{24,47} %write{2147483647,-1}
temp	color	$tmp12	%read{31,31} %write{25,25}
temp	color	$tmp13	%read{31,31} %write{30,30}
const	float	$const12	0		%read{26,54} %write{2147483647,-1}
temp	color	$tmp14	%read{30,30} %write{26,26}
temp	float	$tmp15	%read{29,29} %write{28,28}
temp	vector	$tmp16	%read{28,28} %write{27,27}
temp	color	$tmp17	%read{30,30} %write{29,29}
temp	color	$tmp18	%read{19,32} %write{19,32}
temp	color	$tmp19	%read{35,35} %write{34,34}
temp	color	$tmp20	%read{36,36} %write{35,35}
temp	color	$tmp21	%read{42,62} %write{36,59}
temp	color	$tmp22	%read{42,61} %write{37,59}
temp	color	$tmp23	%read{61,61} %write{60,60}
temp	vector	$tmp24	%read{39,39} %write{38,38}
temp	vector	$tmp25	%read{42,59} %write{39,59}
const	string	$const13	"specular"		%read{40,40} %write{2147483647,-1}
temp	int	$tmp26	%read{42,59} %write{42,59}
temp	int	$tmp27	%read{2147483647,-1} %write{46,46}
const	string	$const14	"__nonspecular"		%read{46,46} %write{2147483647,-1}
temp	float	$tmp28	%read{48,48} %write{47,47}
temp	color	$tmp29	%read{58,58} %write{48,48}
temp	color	$tmp30	%read{58,58} %write{57,57}
temp	vector	$tmp31	%read{51,51} %write{49,49}
const	string	$const15	"specularbrdf"		%read{50,50} %write{2147483647,-1}
temp	vector	$tmp32	%read{52,52} %write{51,51}
temp	float	$tmp33	%read{57,57} %write{56,56}
temp	float	$tmp34	%read{56,56} %write{54,54}
temp	float	$tmp35	%read{54,54} %write{53,53}
temp	float	$tmp36	%read{56,56} %write{55,55}
const	float	$const17	8		%read{55,55} %write{2147483647,-1}
temp	color	$tmp37	%read{42,59} %write{42,59}
temp	color	$tmp38	%read{62,62} %write{61,61}
code s
# D:\\xrt.git\\src\\osl\\shaders\\paintedplastic.osl:71
#     float t = v
	assign		s u 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\paintedplastic.osl"} %line{71} %argrw{"wr"}
code t
# D:\\xrt.git\\src\\osl\\shaders\\paintedplastic.osl:73
#   )
	assign		t v 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\paintedplastic.osl"} %line{73} %argrw{"wr"}
code ___main___
# D:\\xrt.git\\src\\osl\\shaders\\paintedplastic.osl:76
#         C *= texture (texturename, s, t, "blur", blur, "wrap", wrap);
	neq		$tmp1 texturename $const1 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\paintedplastic.osl"} %line{76} %argrw{"wrr"}
	if		$tmp1 6 6 	%argrw{"r"}
# D:\\xrt.git\\src\\osl\\shaders\\paintedplastic.osl:77
# 
	texture		$tmp2 texturename s t $const2 blur $const3 wrap 	%line{77} %argrw{"wrrrrrrr"} %argderivs{2,3}
	mul		C C $tmp2 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\paintedplastic.osl:80
#     C = C * (Ka*ambient() + Kd*diffuse(Nf)) +
	normalize	$tmp3 N 	%line{80} %argrw{"wr"}
	functioncall	$const4 15 	%argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:196
# int abs (int x) BUILTIN;
	functioncall	$const4 15 	%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		$tmp4 I Ng 	%line{192} %argrw{"wrr"}
	gt		$tmp5 $tmp4 $const5 	%argrw{"wrr"}
	if		$tmp5 13 14 	%argrw{"r"}
	neg		Nf $tmp3 	%argrw{"wr"}
	assign		Nf $tmp3 	%argrw{"wr"}
	return
# D:\\xrt.git\\src\\osl\\shaders\\paintedplastic.osl:81
# 	specularcolor * Ks*specular(Nf, -normalize(I), roughness);
	ambient		$tmp6 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\paintedplastic.osl"} %line{81} %argrw{"w"}
	mul		$tmp7 Ka $tmp6 	%argrw{"wrr"}
	functioncall	$const6 34 	%argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:501
# 
	assign		___278_C $const5 	%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
# point step (point edge, point x) BUILTIN;
	for		$tmp9 21 22 33 33 	%line{503} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:507
# float smoothstep (float edge0, float edge1, float x) BUILTIN;
	lights_begin	P Nf $const7 	%line{507} %argrw{"rrr"}
	lights		$tmp9 P Nf $const7 	%argrw{"wrrr"} %argderivs{1}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:504
# 		float __nondiffuse = 0;
	assign		___279___nondiffuse $const5 	%line{504} %argrw{"wr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:505
# 		getmessage ("light", "__nondiffuse", __nondiffuse);
	getmessage	$tmp10 $const8 $const9 ___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		$tmp11 $const11 ___279___nondiffuse 	%line{506} %argrw{"wrr"}
	mul		$tmp12 Cl $tmp11 	%argrw{"wrr"}
	assign		$tmp14 $const12 	%argrw{"wr"}
	normalize	$tmp16 L 	%argrw{"wr"}
	dot		$tmp15 Nf $tmp16 	%argrw{"wrr"}
	assign		$tmp17 $tmp15 	%argrw{"wr"}
	max		$tmp13 $tmp14 $tmp17 	%argrw{"wrr"}
	mul		$tmp18 $tmp12 $tmp13 	%argrw{"wrr"}
	add		___278_C ___278_C $tmp18 	%argrw{"wrr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:508
# 	return C;
	assign		$tmp8 ___278_C 	%line{508} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\paintedplastic.osl:81
# 	specularcolor * Ks*specular(Nf, -normalize(I), roughness);
	mul		$tmp19 Kd $tmp8 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\paintedplastic.osl"} %line{81} %argrw{"wrr"}
	add		$tmp20 $tmp7 $tmp19 	%argrw{"wrr"}
	mul		$tmp21 C $tmp20 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\paintedplastic.osl:82
# 
	mul		$tmp22 specularcolor Ks 	%line{82} %argrw{"wrr"}
	normalize	$tmp24 I 	%argrw{"wr"}
	neg		$tmp25 $tmp24 	%argrw{"wr"}
	functioncall	$const13 61 	%argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:527
# 
	assign		___281_C $const5 	%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
# 
	for		$tmp26 44 45 60 60 	%line{529} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:533
#     vector Nresid = dir - normalize(calculatenormal (P));
	lights_begin	P Nf $const7 	%line{533} %argrw{"rrr"}
	lights		$tmp26 P Nf $const7 	%argrw{"wrrr"} %argderivs{1}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:530
# 		float __nonspecular = 0;
	assign		___282___nonspecular $const5 	%line{530} %argrw{"wr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:531
# 		getmessage ("light", "__nonspecular", __nonspecular);
	getmessage	$tmp27 $const8 $const14 ___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		$tmp28 $const11 ___282___nonspecular 	%line{532} %argrw{"wrr"}
	mul		$tmp29 Cl $tmp28 	%argrw{"wrr"}
	normalize	$tmp31 L 	%argrw{"wr"}
	functioncall	$const15 58 	%argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:511
# 	vector H = normalize( L + V );
	add		$tmp32 $tmp31 $tmp25 	%line{511} %argrw{"wrr"}
	normalize	___280_H $tmp32 	%argrw{"wr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:512
# 	return pow (max (0, dot (N, H)), 8 / roughness);
	dot		$tmp35 Nf ___280_H 	%line{512} %argrw{"wrr"}
	max		$tmp34 $const12 $tmp35 	%argrw{"wrr"}
	div		$tmp36 $const17 roughness 	%argrw{"wrr"}
	pow		$tmp33 $tmp34 $tmp36 	%argrw{"wrr"}
	assign		$tmp30 $tmp33 	%argrw{"wr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:532
# 		C += Cl * (1-__nonspecular) * specularbrdf (normalize (L), N, V, roughness);
	mul		$tmp37 $tmp29 $tmp30 	%line{532} %argrw{"wrr"}
	add		___281_C ___281_C $tmp37 	%argrw{"wrr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:534
# 	return C;
	assign		$tmp23 ___281_C 	%line{534} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\paintedplastic.osl:82
# 
	mul		$tmp38 $tmp22 $tmp23 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\paintedplastic.osl"} %line{82} %argrw{"wrr"}
	add		C $tmp21 $tmp38 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\paintedplastic.osl:85
# }
	mul		C C opacity 	%line{85} %argrw{"wrr"}
	end
