OpenShadingLanguage 1.01
# Compiled by oslc 1.6.2
surface ambocclude	%meta{string,description,"Ambient occlusion"} %meta{string,opaqueparams,"transparency"} 
param	string	occlusionname	""		%meta{string,description,"Geometry set for occlusion"}  %read{0,15} %write{2147483647,-1}
param	string	sdbname	""		%meta{string,description,"Spatial database name for occlusion cache"}  %read{2147483647,-1} %write{2147483647,-1}
param	string	sdbmode	""		%meta{string,description,"File mode for occlusion cache spatial database"} %meta{string,UItype,"enum:,r,w,rw,ro,wo"}  %read{2147483647,-1} %write{2147483647,-1}
param	string	sdbfilespace	"world"		%meta{string,description,"Coordinate system for storing the sdb file"} %meta{string,UItype,"coordsys"}  %read{2147483647,-1} %write{2147483647,-1}
param	float	samples	64		%meta{string,description,"Number of hemispherical samples"} %meta{string,UItype,"int"} %meta{float,UImin,1}  %read{13,13} %write{2147483647,-1}
param	float	adaptive	1		%meta{string,description,"Use adaptive sampling of hemisphere"} %meta{string,UItype,"bool"}  %read{2147483647,-1} %write{2147483647,-1}
param	float	maxerror	-1		%meta{string,description,"Error metric (-1 for global default)"} %meta{float,UImax,1}  %read{15,15} %write{2147483647,-1}
param	float	maxpixeldist	-1		%meta{string,description,"Max pixel distance between occlusion samples (-1 for global default)"}  %read{15,15} %write{2147483647,-1}
param	float	bias	-1		%meta{string,description,"Bias - minimum distance for ray hits (-1 for global default)"} %meta{float,UImin,0}  %read{15,15} %write{2147483647,-1}
param	float	maxhitdist	1000000		%meta{string,description,"Max distance for ray hits"} %meta{float,UImin,0}  %read{15,15} %write{2147483647,-1}
param	float	falloff	0		%meta{string,description,"Falloff exponent of occlusion effect (0 = none)"}  %read{15,15} %write{2147483647,-1}
param	float	falloffmode	0		%meta{string,description,"Alternate falloff mode"} %meta{string,UItype,"bool"}  %read{14,14} %write{2147483647,-1}
param	float	gain	1		%meta{string,description,"Occlusion gain"}  %read{16,16} %write{2147483647,-1}
param	float	gamma	1		%meta{string,description,"Occlusion gamma"}  %read{21,21} %write{2147483647,-1}
param	float	twosided	1		%meta{string,description,"Two-sided (occlusion flips normal to face camera)"} %meta{string,UItype,"bool"}  %read{3,3} %write{2147483647,-1}
param	float	writeC	1		%meta{string,description,"Write occlusion to C if nonzero"} %meta{string,UItype,"bool"}  %read{27,27} %write{2147483647,-1}
param	color	transparency	0 0 0		%meta{string,description,"Transparency of surface"}  %read{25,25} %write{2147483647,-1}
param	float	use_transparency	0		%meta{string,description,"Use the transparency flag"}  %read{23,23} %write{2147483647,-1}
oparam	float	unocc	1		%meta{string,description,"Output: unoccluded portion of hemisphere"}  %read{19,22} %write{17,21}
oparam	color	ambocc	1 1 1		%meta{string,description,"Output: unoccluded portion of hemisphere"}  %read{26,29} %write{22,26}
oparam	normal	Nunocc	0 0 0		%meta{string,description,"Output: average unoccluded normal"}  %read{15,15} %write{2147483647,-1}
global	point	P	%read{15,15} %write{2147483647,-1} %derivs
global	vector	I	%read{7,7} %write{2147483647,-1}
global	normal	N	%read{2,2} %write{2147483647,-1} %derivs
global	normal	Ng	%read{7,7} %write{2147483647,-1}
global	color	C	%read{2147483647,-1} %write{29,29}
global	color	opacity	%read{26,26} %write{25,25}
local	normal	___291_Nf	%read{10,15} %write{2,11} %derivs
temp	int	$tmp1	%read{1,1} %write{0,0}
const	string	$const1	""		%read{0,0} %write{2147483647,-1}
const	int	$const2	0		%read{3,8} %write{2147483647,-1}
temp	int	$tmp2	%read{4,4} %write{3,3}
const	string	$const3	"faceforward"		%read{5,6} %write{2147483647,-1}
temp	float	$tmp3	%read{8,8} %write{7,7}
temp	int	$tmp4	%read{9,9} %write{8,8}
temp	float	$tmp5	%read{16,16} %write{15,15}
const	string	$const5	"traceset"		%read{15,15} %write{2147483647,-1}
const	string	$const6	"coneangle"		%read{15,15} %write{2147483647,-1}
const	float	$const7	1.5707964		%read{15,15} %write{2147483647,-1}
const	string	$const8	"environmentdir"		%read{15,15} %write{2147483647,-1}
const	string	$const9	"samples"		%read{15,15} %write{2147483647,-1}
temp	int	$tmp6	%read{15,15} %write{13,13}
const	string	$const10	"maxerror"		%read{15,15} %write{2147483647,-1}
const	string	$const11	"maxpixeldist"		%read{15,15} %write{2147483647,-1}
const	string	$const12	"maxdist"		%read{15,15} %write{2147483647,-1}
const	string	$const13	"mindist"		%read{15,15} %write{2147483647,-1}
const	string	$const14	"falloff"		%read{15,15} %write{2147483647,-1}
const	string	$const15	"falloffmode"		%read{15,15} %write{2147483647,-1}
temp	int	$tmp7	%read{15,15} %write{14,14}
temp	float	$tmp8	%read{17,17} %write{16,16}
const	float	$const16	1		%read{17,25} %write{2147483647,-1}
temp	float	$tmp9	%read{21,21} %write{20,20}
const	float	$const17	0		%read{20,27} %write{2147483647,-1}
const	string	$const18	"clamp"		%read{18,18} %write{2147483647,-1}
temp	float	$tmp10	%read{20,20} %write{19,19}
temp	int	$tmp11	%read{24,24} %write{23,23}
temp	int	$tmp12	%read{28,28} %write{27,27}
code ___main___
# D:\\xrt.git\\src\\osl\\shaders\\ambocclude.osl:158
#         normal Nf = normalize(N);
	neq		$tmp1 occlusionname $const1 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\ambocclude.osl"} %line{158} %argrw{"wrr"}
	if		$tmp1 23 23 	%argrw{"r"}
# D:\\xrt.git\\src\\osl\\shaders\\ambocclude.osl:159
#         if (twosided != 0)
	normalize	___291_Nf N 	%line{159} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\ambocclude.osl:160
#             Nf = faceforward (Nf, I);
	neq		$tmp2 twosided $const2 	%line{160} %argrw{"wrr"}
	if		$tmp2 13 13 	%argrw{"r"}
# D:\\xrt.git\\src\\osl\\shaders\\ambocclude.osl:161
#         unocc = 1 - gain * occlusion (P, Nf,
	functioncall	$const3 13 	%line{161} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:196
# #define M_PI_2     1.5707963267948966        /* pi/2 */
	functioncall	$const3 13 	%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		$tmp3 I Ng 	%line{192} %argrw{"wrr"}
	gt		$tmp4 $tmp3 $const2 	%argrw{"wrr"}
	if		$tmp4 11 12 	%argrw{"r"}
	neg		___291_Nf ___291_Nf 	%argrw{"wr"}
	assign		___291_Nf ___291_Nf 	%argrw{"wr"}
	return
# D:\\xrt.git\\src\\osl\\shaders\\ambocclude.osl:165
#                                "maxpixeldist", maxpixeldist,
	assign		$tmp6 samples 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\ambocclude.osl"} %line{165} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\ambocclude.osl:169
#                                "filename", sdbname, "filemode", sdbmode,
	assign		$tmp7 falloffmode 	%line{169} %argrw{"wr"}
	occlusion	$tmp5 P ___291_Nf $const5 occlusionname $const6 $const7 $const8 Nunocc $const9 $tmp6 $const10 maxerror $const11 maxpixeldist $const12 maxhitdist $const13 bias $const14 falloff $const15 $tmp7 	%argrw{"wrrrrrrrrrrrrrrrrrrrrrr"} %argderivs{1,2}
	mul		$tmp8 gain $tmp5 	%argrw{"wrr"}
	sub		unocc $const16 $tmp8 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\ambocclude.osl:170
#                                "filespace", sdbfilespace*/);
	functioncall	$const18 21 	%line{170} %argrw{"r"}
# D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h:144
# float  clamp (float x, float minval, float maxval) { return max(min(x,maxval),minval); }
	min		$tmp10 unocc $const16 	%filename{"D:/xrt.git\\build\\vc10\\Win32\\Release\\shaders\\stdosl.h"} %line{144} %argrw{"wrr"}
	max		$tmp9 $tmp10 $const17 	%argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\ambocclude.osl:170
# //      occlusion spatial database, as set by appropriate attribs.
	pow		unocc $tmp9 gamma 	%filename{"D:\\xrt.git\\src\\osl\\shaders\\ambocclude.osl"} %line{170} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\ambocclude.osl:171
# //   sdbfilespace - the coordinate system in which to save the sdb disk file.
	assign		ambocc unocc 	%line{171} %argrw{"wr"}
# D:\\xrt.git\\src\\osl\\shaders\\ambocclude.osl:173
# //   adaptive - if zero, always use full samples.  If nonzero, use adaptive
	neq		$tmp11 use_transparency $const17 	%line{173} %argrw{"wrr"}
	if		$tmp11 26 26 	%argrw{"r"}
# D:\\xrt.git\\src\\osl\\shaders\\ambocclude.osl:174
# //      sampling.  Default is 1, higher is more aggressively adaptive,
	sub		opacity $const16 transparency 	%line{174} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\ambocclude.osl:175
# //      lower tends to use full sampling more frequently.
	mul		ambocc ambocc opacity 	%line{175} %argrw{"wrr"}
# D:\\xrt.git\\src\\osl\\shaders\\ambocclude.osl:176
# //   maxerror - allowable error for interpolation (versus more expensive
	neq		$tmp12 writeC $const17 	%line{176} %argrw{"wrr"}
	if		$tmp12 30 30 	%argrw{"r"}
# D:\\xrt.git\\src\\osl\\shaders\\ambocclude.osl:177
# //      resampling of the hemisphere).  If <0, uses the value of
	assign		C ambocc 	%line{177} %argrw{"wr"}
	end
