OpenShadingLanguage 1.01
# Compiled by oslc 1.6.2
surface velvet	%meta{string,description,"Velvet material"} 
param	float	Ka	1		%meta{string,description,"Ambient scaling"} %meta{float,UImin,0} %meta{float,UIsoftmax,1}  %read{10,10} %write{2147483647,-1}
param	float	Kd	0.5		%meta{string,description,"Diffuse scaling"} %meta{float,UImin,0} %meta{float,UIsoftmax,1}  %read{28,28} %write{2147483647,-1}
param	color	sheen	0.25 0.25 0.25		%meta{string,description,"color of the highlights"} %meta{float,UImin,0} %meta{float,UImax,1}  %read{54,54} %write{2147483647,-1}
param	float	backscatter	0.1		%meta{string,description,"Retroreflective highlight strength"} %meta{float,UImin,0} %meta{float,UImax,1}  %read{43,43} %write{2147483647,-1}
param	float	edginess	10		%meta{string,description,"How broad the horizon scattering is"} %meta{float,UImin,0} %meta{float,UImax,1}  %read{49,49} %write{2147483647,-1}
param	float	roughness	0.1		%meta{string,description,"How broad the retroreflective highlight is"} %meta{float,UImin,0} %meta{float,UImax,1}  %read{41,41} %write{2147483647,-1}
global	point	P	%read{14,37} %write{2147483647,-1} %derivs
global	vector	I	%read{3,31} %write{2147483647,-1}
global	normal	N	%read{0,0} %write{2147483647,-1}
global	normal	Ng	%read{3,3} %write{2147483647,-1}
global	color	C	%read{30,58} %write{57,58}
global	color	opacity	%read{58,58} %write{2147483647,-1}
global	vector	L	%read{21,38} %write{2147483647,-1}
global	color	Cl	%read{19,53} %write{2147483647,-1}
local	color	___278_C	%read{13,27} %write{12,26}
local	float	___279___nondiffuse	%read{13,26} %write{13,26}
local	color	___299_C	%read{35,56} %write{34,55}
local	vector	___300_Ln	%read{35,55} %write{35,55}
local	float	___300_retro	%read{35,55} %write{35,55}
local	float	___300_cosine	%read{35,55} %write{35,55}
local	float	___300_sine	%read{35,55} %write{35,55}
local	float	___300_horizon	%read{35,55} %write{35,55}
local	normal	Nf	%read{14,50} %write{6,7}
temp	normal	$tmp1	%read{6,7} %write{0,0}
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,34} %write{2147483647,-1}
temp	int	$tmp3	%read{5,5} %write{4,4}
temp	color	$tmp4	%read{10,10} %write{9,9}
temp	color	$tmp5	%read{13,29} %write{10,26}
temp	color	$tmp6	%read{28,28} %write{27,27}
const	string	$const3	"diffuse"		%read{11,11} %write{2147483647,-1}
const	float	$const4	1.5707964		%read{14,37} %write{2147483647,-1}
temp	int	$tmp7	%read{13,26} %write{13,26}
temp	int	$tmp8	%read{2147483647,-1} %write{17,17}
const	string	$const5	"light"		%read{17,17} %write{2147483647,-1}
const	string	$const6	"__nondiffuse"		%read{17,17} %write{2147483647,-1}
temp	float	$tmp9	%read{19,19} %write{18,18}
const	float	$const8	1		%read{18,47} %write{2147483647,-1}
temp	color	$tmp10	%read{25,25} %write{19,19}
temp	color	$tmp11	%read{25,25} %write{24,24}
const	float	$const9	0		%read{20,45} %write{2147483647,-1}
temp	color	$tmp12	%read{24,24} %write{20,20}
temp	float	$tmp13	%read{23,23} %write{22,22}
temp	vector	$tmp14	%read{22,22} %write{21,21}
temp	color	$tmp15	%read{24,24} %write{23,23}
temp	color	$tmp16	%read{13,26} %write{13,26}
temp	color	$tmp17	%read{29,29} %write{28,28}
temp	color	$tmp18	%read{30,30} %write{29,29}
temp	color	$tmp19	%read{35,57} %write{30,55}
temp	color	$tmp20	%read{57,57} %write{56,56}
temp	vector	$tmp21	%read{32,32} %write{31,31}
temp	vector	$tmp22	%read{35,55} %write{32,55}
const	string	$const10	"LocIllumVelvet"		%read{33,33} %write{2147483647,-1}
temp	int	$tmp23	%read{35,55} %write{35,55}
temp	float	$tmp24	%read{43,43} %write{42,42}
temp	float	$tmp25	%read{42,42} %write{40,40}
temp	float	$tmp26	%read{40,40} %write{39,39}
temp	float	$tmp27	%read{42,42} %write{41,41}
temp	float	$tmp28	%read{45,45} %write{44,44}
temp	float	$tmp29	%read{47,47} %write{46,46}
temp	float	$tmp30	%read{48,48} %write{47,47}
temp	float	$tmp31	%read{51,51} %write{49,49}
temp	float	$tmp32	%read{51,51} %write{50,50}
temp	float	$tmp33	%read{53,53} %write{52,52}
temp	color	$tmp34	%read{54,54} %write{53,53}
temp	color	$tmp35	%read{35,55} %write{35,55}
code ___main___
# D:\\xrt.git\\src\\osl\\shaders\\velvet.osl:74
# 
	normalize	$tmp1 N 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\velvet.osl"} %line{74} %argrw{"wr"}
	functioncall	$const1 9 	%argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:196
# PERCOMP1 (round)
	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\\velvet.osl:77
#         LocIllumVelvet (Nf, -normalize(I), sheen, backscatter, edginess, roughness);
	ambient		$tmp4 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\velvet.osl"} %line{77} %argrw{"w"}
	mul		$tmp5 Ka $tmp4 	%argrw{"wrr"}
	functioncall	$const3 28 	%argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:501
# normal step (normal edge, normal x) BUILTIN;
	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 smoothstep (float edge0, float edge1, float x) BUILTIN;
	for		$tmp7 15 16 27 27 	%line{503} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:507
#     float width = fabs(dedge) + fabs(ds);
	lights_begin	P Nf $const4 	%line{507} %argrw{"rrr"}
	lights		$tmp7 P Nf $const4 	%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	$tmp8 $const5 $const6 ___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		$tmp9 $const8 ___279___nondiffuse 	%line{506} %argrw{"wrr"}
	mul		$tmp10 Cl $tmp9 	%argrw{"wrr"}
	assign		$tmp12 $const9 	%argrw{"wr"}
	normalize	$tmp14 L 	%argrw{"wr"}
	dot		$tmp13 Nf $tmp14 	%argrw{"wrr"}
	assign		$tmp15 $tmp13 	%argrw{"wr"}
	max		$tmp11 $tmp12 $tmp15 	%argrw{"wrr"}
	mul		$tmp16 $tmp10 $tmp11 	%argrw{"wrr"}
	add		___278_C ___278_C $tmp16 	%argrw{"wrr"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:508
# 	return C;
	assign		$tmp6 ___278_C 	%line{508} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\velvet.osl:77
#         LocIllumVelvet (Nf, -normalize(I), sheen, backscatter, edginess, roughness);
	mul		$tmp17 Kd $tmp6 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\velvet.osl"} %line{77} %argrw{"wrr"}
	add		$tmp18 $tmp5 $tmp17 	%argrw{"wrr"}
	mul		$tmp19 C $tmp18 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\velvet.osl:78
# 
	normalize	$tmp21 I 	%line{78} %argrw{"wr"}
	neg		$tmp22 $tmp21 	%argrw{"wr"}
	functioncall	$const10 57 	%argrw{"r"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:148
#     return basecolor * (Ka*ambient() + Kd*diffuse(Nf) +
	assign		___299_C $const2 	%filename{"D:/xrt.git\\src\\osl\\shaders\\material.h"} %line{148} %argrw{"wr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:149
#                         Ks*specular(Nf,-normalize(I),roughness));
	for		$tmp23 37 38 56 56 	%line{149} %argrw{"r"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:159
#                            float Ks, float roughness)
	lights_begin	P Nf $const4 	%line{159} %argrw{"rrr"}
	lights		$tmp23 P Nf $const4 	%argrw{"wrrr"} %argderivs{1}
# D:/xrt.git\\src\\osl\\shaders\\material.h:150
#         vector Ln = normalize (L);
	normalize	___300_Ln L 	%line{150} %argrw{"wr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:152
#         float retro = pow (max (dot(Ln,V), 0), 1/roughness) * backscatter;
	dot		$tmp26 ___300_Ln $tmp22 	%line{152} %argrw{"wrr"}
	max		$tmp25 $tmp26 $const9 	%argrw{"wrr"}
	div		$tmp27 $const8 roughness 	%argrw{"wrr"}
	pow		$tmp24 $tmp25 $tmp27 	%argrw{"wrr"}
	mul		___300_retro $tmp24 backscatter 	%argrw{"wrr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:154
#         float cosine = max (dot(N,V), 0);
	dot		$tmp28 Nf $tmp22 	%line{154} %argrw{"wrr"}
	max		___300_cosine $tmp28 $const9 	%argrw{"wrr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:155
#         float sine = sqrt (1 - cosine*cosine);
	mul		$tmp29 ___300_cosine ___300_cosine 	%line{155} %argrw{"wrr"}
	sub		$tmp30 $const8 $tmp29 	%argrw{"wrr"}
	sqrt		___300_sine $tmp30 	%argrw{"wr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:156
#         float horizon = pow (sine, edginess) * dot(Ln,N);
	pow		$tmp31 ___300_sine edginess 	%line{156} %argrw{"wrr"}
	dot		$tmp32 ___300_Ln Nf 	%argrw{"wrr"}
	mul		___300_horizon $tmp31 $tmp32 	%argrw{"wrr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:158
#         C += (retro + horizon) * Cl * sheen;
	add		$tmp33 ___300_retro ___300_horizon 	%line{158} %argrw{"wrr"}
	mul		$tmp34 $tmp33 Cl 	%argrw{"wrr"}
	mul		$tmp35 $tmp34 sheen 	%argrw{"wrr"}
	add		___299_C ___299_C $tmp35 	%argrw{"wrr"}
# D:/xrt.git\\src\\osl\\shaders\\material.h:160
#     return C;
	assign		$tmp20 ___299_C 	%line{160} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\velvet.osl:78
# 
	add		C $tmp19 $tmp20 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\velvet.osl"} %line{78} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\velvet.osl:81
# }
	mul		C C opacity 	%line{81} %argrw{"wrr"}
	end
