forked from s4900744/Renderman
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtopDisp.oso
117 lines (117 loc) · 4.86 KB
/
topDisp.oso
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
OpenShadingLanguage 1.00
# Compiled by oslc 1.7.4.pixar38bde12
# options:
shader topDisp
oparam float resultF 0 %read{2147483647,-1} %write{28,29}
global float u %read{1,22} %write{2147483647,-1}
global float v %read{2,26} %write{2147483647,-1}
local float cutout %read{28,28} %write{8,8}
local point centre %read{4,4} %write{0,0}
local point here %read{4,4} %write{3,3}
local float dist %read{6,6} %write{4,4}
local float cutoutRadius %read{6,6} %write{5,5}
local float face %read{8,8} %write{7,7}
local float s %read{17,17} %write{9,9}
local float t %read{18,18} %write{15,15}
local float discs %read{29,29} %write{25,25}
local point centre2 %read{21,21} %write{16,16}
local point here2 %read{21,21} %write{20,20}
local float dist2 %read{23,23} %write{21,21}
local float radius %read{23,23} %write{22,22}
local float inDisk %read{25,25} %write{24,24}
const point $const1 0 0 0 %read{0,0} %write{2147483647,-1}
const float $const2 0.5 %read{1,1} %write{2147483647,-1}
temp float $tmp1 %read{3,3} %write{1,1}
temp float $tmp2 %read{3,3} %write{2,2}
const float $const4 4 %read{2,2} %write{2147483647,-1}
const float $const6 0 %read{3,20} %write{2147483647,-1}
const float $const7 0.14 %read{5,5} %write{2147483647,-1}
temp float $tmp3 %read{7,7} %write{6,6}
const float $const9 1 %read{7,24} %write{2147483647,-1}
const float $const10 0.80000001 %read{8,22} %write{2147483647,-1}
const float $const12 2 %read{9,10} %write{2147483647,-1}
temp float $tmp4 %read{12,15} %write{10,10}
const float $const13 1.4 %read{12,14} %write{2147483647,-1}
const string $const14 "mod" %read{11,11} %write{2147483647,-1}
temp float $tmp5 %read{14,14} %write{13,13}
temp float $tmp6 %read{13,13} %write{12,12}
temp float $tmp7 %read{15,15} %write{14,14}
const point $const15 0.89999998 0.5 0 %read{16,16} %write{2147483647,-1}
const float $const16 0.050000001 %read{17,17} %write{2147483647,-1}
temp float $tmp8 %read{20,20} %write{17,17}
const float $const17 3.7 %read{18,18} %write{2147483647,-1}
temp float $tmp9 %read{19,19} %write{18,18}
const float $const18 0.60000002 %read{19,19} %write{2147483647,-1}
temp float $tmp10 %read{20,20} %write{19,19}
temp float $tmp11 %read{24,24} %write{23,23}
const float $const19 0.029999999 %read{25,25} %write{2147483647,-1}
const float $const20 0.1 %read{26,26} %write{2147483647,-1}
temp int $tmp12 %read{27,27} %write{26,26}
code ___main___
# topDisp.osl:6
# point centre = point (0,0,0);
assign centre $const1 %filename{"topDisp.osl"} %line{6} %argrw{"wr"}
# topDisp.osl:7
# point here = point (u-0.5,4*v,0);
sub $tmp1 u $const2 %line{7} %argrw{"wrr"}
mul $tmp2 $const4 v %argrw{"wrr"}
point here $tmp1 $tmp2 $const6 %argrw{"wrrr"}
# topDisp.osl:8
# float dist = distance(centre,here);
distance dist centre here %line{8} %argrw{"wrr"}
# topDisp.osl:9
# float cutoutRadius = 0.14;
assign cutoutRadius $const7 %line{9} %argrw{"wr"}
# topDisp.osl:10
# float face = smoothstep(cutoutRadius,cutoutRadius,dist) - 1;
smoothstep $tmp3 cutoutRadius cutoutRadius dist %line{10} %argrw{"wrrr"}
sub face $tmp3 $const9 %argrw{"wrr"}
# topDisp.osl:11
# cutout = face * 0.8;
mul cutout face $const10 %line{11} %argrw{"wrr"}
# topDisp.osl:14
# float s = 2*u;
mul s $const12 u %line{14} %argrw{"wrr"}
# topDisp.osl:15
# float t = mod(2*v,1.4); //foreground circle
mul $tmp4 $const12 v %line{15} %argrw{"wrr"}
functioncall $const14 16 %argrw{"r"}
# /Applications/Pixar/RenderManProServer-21.2/lib/osl/include/stdosl.h:135
# PERCOMP1 (floor)
div $tmp6 $tmp4 $const13 %filename{"/Applications/Pixar/RenderManProServer-21.2/lib/osl/include/stdosl.h"} %line{135} %argrw{"wrr"}
floor $tmp5 $tmp6 %argrw{"wr"}
mul $tmp7 $const13 $tmp5 %argrw{"wrr"}
sub t $tmp4 $tmp7 %argrw{"wrr"}
# topDisp.osl:17
# point centre2 = point (0.9,0.5,0);
assign centre2 $const15 %filename{"topDisp.osl"} %line{17} %argrw{"wr"}
# topDisp.osl:18
# point here2 = point (s+0.05,(3.7*t)-0.6,0); //positioning
add $tmp8 s $const16 %line{18} %argrw{"wrr"}
mul $tmp9 $const17 t %argrw{"wrr"}
sub $tmp10 $tmp9 $const18 %argrw{"wrr"}
point here2 $tmp8 $tmp10 $const6 %argrw{"wrrr"}
# topDisp.osl:19
# float dist2 = distance(centre2,here2);
distance dist2 centre2 here2 %line{19} %argrw{"wrr"}
# topDisp.osl:20
# float radius = u * 0.8;
mul radius u $const10 %line{20} %argrw{"wrr"}
# topDisp.osl:21
# float inDisk = smoothstep(radius,radius,dist2) - 1;
smoothstep $tmp11 radius radius dist2 %line{21} %argrw{"wrrr"}
sub inDisk $tmp11 $const9 %argrw{"wrr"}
# topDisp.osl:23
# discs = inDisk * 0.03;
mul discs inDisk $const19 %line{23} %argrw{"wrr"}
# topDisp.osl:25
# if(v < 0.1)
lt $tmp12 v $const20 %line{25} %argrw{"wrr"}
if $tmp12 29 30 %argrw{"r"}
# topDisp.osl:26
# resultF = cutout;
assign resultF cutout %line{26} %argrw{"wr"}
# topDisp.osl:28
# resultF = discs;
assign resultF discs %line{28} %argrw{"wr"}
end