OpenShadingLanguage 1.01
# Compiled by oslc 1.6.2
displacement sinknurl
param	float	freq	100		%read{62,62} %write{2147483647,-1} %derivs
param	float	depth	0.0049999999		%read{49,56} %write{2147483647,-1} %derivs
param	float	zmin	-1e+020		%read{33,51} %write{2147483647,-1} %derivs
param	float	zmax	1e+020		%read{36,53} %write{2147483647,-1} %derivs
param	float	dampzone	0		%read{40,52} %write{2147483647,-1} %derivs
param	point	maporigin	0 0 0		%read{7,7} %write{0,0} %derivs %initexpr
param	point	xaxis	1 0 0		%read{9,9} %write{1,1} %derivs %initexpr
param	point	yaxis	0 1 0		%read{11,11} %write{2,2} %derivs %initexpr
param	point	zaxis	0 0 1		%read{13,13} %write{3,3} %derivs %initexpr
global	point	P	%read{5,69} %write{68,68} %derivs
global	normal	N	%read{58,58} %write{69,69} %derivs
local	vector	___292_V	%read{16,25} %write{15,15} %derivs
local	vector	___292_Vn	%read{23,24} %write{16,16} %derivs
local	vector	___292_XX	%read{23,23} %write{18,18} %derivs
local	vector	___292_YY	%read{24,24} %write{20,20} %derivs
local	vector	___292_ZZ	%read{25,25} %write{22,22} %derivs
local	float	___292_xx	%read{26,26} %write{23,23} %derivs
local	float	___292_yy	%read{26,26} %write{24,24} %derivs
local	point	PP	%read{15,67} %write{5,5} %derivs
local	point	O	%read{15,21} %write{7,7} %derivs
local	point	X	%read{17,17} %write{9,9} %derivs
local	point	Y	%read{19,19} %write{11,11} %derivs
local	point	Z	%read{21,21} %write{13,13} %derivs
local	normal	sN	%read{60,60} %write{59,59} %derivs
local	float	uu	%read{30,63} %write{29,32} %derivs
local	float	vv	%read{33,53} %write{25,25} %derivs
local	float	magnitude	%read{60,60} %write{49,56} %derivs
const	string	$const1	"shader"		%read{0,68} %write{2147483647,-1}
const	int	$const2	0		%read{34,46} %write{2147483647,-1}
const	float	$const3	0		%read{0,31} %write{2147483647,-1}
const	float	$const5	1		%read{1,65} %write{2147483647,-1}
const	string	$const6	"transform"		%read{4,57} %write{2147483647,-1}
const	string	$const7	"common"		%read{5,68} %write{2147483647,-1}
const	string	$const8	"cylinmap"		%read{14,14} %write{2147483647,-1}
temp	vector	$tmp1	%read{18,18} %write{17,17} %derivs
temp	vector	$tmp2	%read{20,20} %write{19,19} %derivs
temp	vector	$tmp3	%read{22,22} %write{21,21} %derivs
temp	float	$tmp4	%read{29,29} %write{27,27} %derivs
temp	float	$tmp5	%read{27,27} %write{26,26} %derivs
const	float	$const10	3.1415927		%read{28,61} %write{2147483647,-1}
temp	float	$tmp6	%read{29,29} %write{28,28} %derivs
const	float	$const11	2		%read{28,61} %write{2147483647,-1}
temp	float	$tmp7	%read{32,32} %write{31,31} %derivs
temp	float	$tmp8	%read{31,31} %write{30,30} %derivs
temp	int	$tmp9	%read{34,34} %write{33,33}
temp	int	$tmp10	%read{35,39} %write{34,38}
temp	int	$tmp11	%read{37,37} %write{36,36}
temp	int	$tmp12	%read{38,38} %write{37,37}
temp	float	$tmp13	%read{41,41} %write{40,40}
temp	int	$tmp14	%read{42,42} %write{41,41}
temp	int	$tmp15	%read{43,48} %write{42,47}
temp	float	$tmp16	%read{45,45} %write{44,44}
temp	int	$tmp17	%read{46,46} %write{45,45}
temp	int	$tmp18	%read{47,47} %write{46,46}
temp	float	$tmp19	%read{56,56} %write{55,55} %derivs
temp	float	$tmp20	%read{55,55} %write{51,51} %derivs
temp	float	$tmp21	%read{51,51} %write{50,50} %derivs
temp	float	$tmp22	%read{54,54} %write{53,53} %derivs
temp	float	$tmp23	%read{53,53} %write{52,52} %derivs
temp	float	$tmp24	%read{55,55} %write{54,54} %derivs
temp	normal	$tmp25	%read{59,59} %write{58,58} %derivs
temp	normal	$tmp26	%read{66,66} %write{60,60} %derivs
temp	float	$tmp27	%read{65,65} %write{64,64} %derivs
temp	float	$tmp28	%read{62,62} %write{61,61} %derivs
temp	float	$tmp29	%read{63,63} %write{62,62} %derivs
temp	float	$tmp30	%read{64,64} %write{63,63} %derivs
temp	float	$tmp31	%read{66,66} %write{65,65} %derivs
temp	normal	$tmp32	%read{67,67} %write{66,66} %derivs
temp	point	$tmp33	%read{68,68} %write{67,67} %derivs
code maporigin
# D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl:22
# 	point xaxis=point ("shader",1,0,0), point yaxis=point ("shader",0,1,0),
	point		maporigin $const1 $const3 $const3 $const3 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl"} %line{22} %argrw{"wrrrr"}
code xaxis
# D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl:23
# 	point zaxis=point ("shader",0,0,1))
	point		xaxis $const1 $const5 $const3 $const3 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl"} %line{23} %argrw{"wrrrr"}
code yaxis
# D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl:23
# 	point zaxis=point ("shader",0,0,1))
	point		yaxis $const1 $const3 $const5 $const3 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl"} %line{23} %argrw{"wrrrr"}
code zaxis
# D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl:24
# {
	point		zaxis $const1 $const3 $const3 $const5 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl"} %line{24} %argrw{"wrrrr"}
code ___main___
# D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl:31
# 	O=transform("shader",maporigin);
	functioncall	$const6 6 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl"} %line{31} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:249
#         F = 0.5 * (1.0 + sqr(F));
	transform	PP $const7 $const1 P 	%filename{"D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h"} %line{249} %argrw{"wrrr"}
# D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl:32
# 	X=transform("shader",xaxis);
	functioncall	$const6 8 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl"} %line{32} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:249
#         float F = (c * (g+c) - 1.0) / (c * beta + 1.0);
	transform	O $const7 $const1 maporigin 	%filename{"D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h"} %line{249} %argrw{"wrrr"}
# D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl:33
# 	Y=transform("shader",yaxis);
	functioncall	$const6 10 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl"} %line{33} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:249
#         float beta = g - c;
	transform	X $const7 $const1 xaxis 	%filename{"D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h"} %line{249} %argrw{"wrrr"}
# D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl:34
# 	Z=transform("shader",zaxis);
	functioncall	$const6 12 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl"} %line{34} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:249
#         g = sqrt (g);
	transform	Y $const7 $const1 yaxis 	%filename{"D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h"} %line{249} %argrw{"wrrr"}
# D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl:35
# 	cylinmap(PP,uu,vv,O,X,Y,Z);
	functioncall	$const6 14 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl"} %line{35} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:249
#     if (g >= 0.0) {
	transform	Z $const7 $const1 zaxis 	%filename{"D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h"} %line{249} %argrw{"wrrr"}
# D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl:36
# 
	functioncall	$const8 33 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl"} %line{36} %argrw{"r"}
# D:/xrt.git\\src\\osl\\shaders\\maps.h:54
#  * x1,x2,x3,x4 - corners in texture space
	sub		___292_V PP O 	%filename{"D:/xrt.git\\src\\osl\\shaders\\maps.h"} %line{54} %argrw{"wrr"}
# D:/xrt.git\\src\\osl\\shaders\\maps.h:55
#  *
	normalize	___292_Vn ___292_V 	%line{55} %argrw{"wr"}
# D:/xrt.git\\src\\osl\\shaders\\maps.h:57
# 
	sub		$tmp1 X O 	%line{57} %argrw{"wrr"}
	normalize	___292_XX $tmp1 	%argrw{"wr"}
# D:/xrt.git\\src\\osl\\shaders\\maps.h:58
# float
	sub		$tmp2 Y O 	%line{58} %argrw{"wrr"}
	normalize	___292_YY $tmp2 	%argrw{"wr"}
# D:/xrt.git\\src\\osl\\shaders\\maps.h:59
# bilerp(float uu,float vv,float x1,float x2,float x3,float x4)
	sub		$tmp3 Z O 	%line{59} %argrw{"wrr"}
	normalize	___292_ZZ $tmp3 	%argrw{"wr"}
# D:/xrt.git\\src\\osl\\shaders\\maps.h:60
# {
	dot		___292_xx ___292_Vn ___292_XX 	%line{60} %argrw{"wrr"}
# D:/xrt.git\\src\\osl\\shaders\\maps.h:61
#     float left, right;
	dot		___292_yy ___292_Vn ___292_YY 	%line{61} %argrw{"wrr"}
# D:/xrt.git\\src\\osl\\shaders\\maps.h:63
#     left = x1 + uu * (x2 - x1);
	dot		vv ___292_V ___292_ZZ 	%line{63} %argrw{"wrr"}
# D:/xrt.git\\src\\osl\\shaders\\maps.h:65
#     return(left + vv * (right - left));
	div		$tmp5 ___292_yy ___292_xx 	%line{65} %argrw{"wrr"}
	atan		$tmp4 $tmp5 	%argrw{"wr"}
	mul		$tmp6 $const11 $const10 	%argrw{"wrr"}
	div		uu $tmp4 $tmp6 	%argrw{"wrr"}
# D:/xrt.git\\src\\osl\\shaders\\maps.h:66
# }
	neg		$tmp8 uu 	%line{66} %argrw{"wr"}
	step		$tmp7 $const3 $tmp8 	%argrw{"wrr"}
	add		uu uu $tmp7 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl:39
#     /* calculate new surface point and normal */
	ge		$tmp9 vv zmin 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl"} %line{39} %argrw{"wrr"}
	neq		$tmp10 $tmp9 $const2 	%argrw{"wrr"}
	if		$tmp10 39 39 	%argrw{"r"}
	le		$tmp11 vv zmax 	%argrw{"wrr"}
	neq		$tmp12 $tmp11 $const2 	%argrw{"wrr"}
	assign		$tmp10 $tmp12 	%argrw{"wr"}
	if		$tmp10 70 70 	%argrw{"r"}
# D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl:41
# 		magnitude = depth;
	add		$tmp13 zmin dampzone 	%line{41} %argrw{"wrr"}
	ge		$tmp14 vv $tmp13 	%argrw{"wrr"}
	neq		$tmp15 $tmp14 $const2 	%argrw{"wrr"}
	if		$tmp15 48 48 	%argrw{"r"}
	sub		$tmp16 zmax dampzone 	%argrw{"wrr"}
	le		$tmp17 vv $tmp16 	%argrw{"wrr"}
	neq		$tmp18 $tmp17 $const2 	%argrw{"wrr"}
	assign		$tmp15 $tmp18 	%argrw{"wr"}
	if		$tmp15 50 57 	%argrw{"r"}
# D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl:42
# 	} else {
	assign		magnitude depth 	%line{42} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl:44
# 			1-smoothstep(zmax-dampzone,zmax,vv));
	add		$tmp21 zmin dampzone 	%line{44} %argrw{"wrr"}
	smoothstep	$tmp20 zmin $tmp21 vv 	%argrw{"wrrr"}
# D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl:45
# 	}
	sub		$tmp23 zmax dampzone 	%line{45} %argrw{"wrr"}
	smoothstep	$tmp22 $tmp23 zmax vv 	%argrw{"wrrr"}
	sub		$tmp24 $const5 $tmp22 	%argrw{"wrr"}
	min		$tmp19 $tmp20 $tmp24 	%argrw{"wrr"}
	mul		magnitude depth $tmp19 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl:48
# 	P = transform("shader","common",PP + sN *
	functioncall	$const6 59 	%line{48} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:247
# vector refract (vector I, vector N, float eta) {
	transformn	$tmp25 $const7 $const1 N 	%filename{"D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h"} %line{247} %argrw{"wrrr"}
# D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl:48
# 	P = transform("shader","common",PP + sN *
	normalize	sN $tmp25 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl"} %line{48} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl:50
# 	N = calculatenormal(P);
	mul		$tmp26 sN magnitude 	%line{50} %argrw{"wrr"}
	mul		$tmp28 $const11 $const10 	%argrw{"wrr"}
	mul		$tmp29 $tmp28 freq 	%argrw{"wrr"}
	mul		$tmp30 $tmp29 uu 	%argrw{"wrr"}
	sin		$tmp27 $tmp30 	%argrw{"wr"}
	sub		$tmp31 $tmp27 $const5 	%argrw{"wrr"}
	mul		$tmp32 $tmp26 $tmp31 	%argrw{"wrr"}
	add		$tmp33 PP $tmp32 	%argrw{"wrr"}
	transform	P $const1 $const7 $tmp33 	%argrw{"wrrr"}
# D:\\xrt.git\\src\\osl\\shaders\\sinknurl.osl:51
#     }
	calculatenormal	N P 	%line{51} %argrw{"wr"} %argderivs{1}
	end
