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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
|
#N canvas 375 67 983 713 10;
#N canvas 1 89 450 300 fps 0;
#X obj 46 -61 gemhead;
#X obj 46 -21 realtime;
#X obj 46 -41 t b b;
#X obj 46 41 /;
#X msg 46 21 1000 \$1;
#X obj 46 106 outlet;
#X obj 46 63 + 0.5;
#X obj 46 85 i;
#X connect 0 0 2 0;
#X connect 1 0 4 0;
#X connect 2 0 1 0;
#X connect 2 1 1 1;
#X connect 3 0 6 0;
#X connect 4 0 3 0;
#X connect 6 0 7 0;
#X connect 7 0 5 0;
#X restore 806 149 pd fps;
#X floatatom 806 172 5 0 0 1 fps - -, f 5;
#N canvas 5 76 450 300 gemwin 0;
#X obj 132 246 gemwin;
#X obj 67 89 outlet;
#X obj 67 10 inlet;
#X obj 67 41 route create;
#X msg 67 70 set destroy;
#X msg 142 68 set create;
#X msg 198 142 destroy;
#X msg 132 142 create \, 1;
#X obj 245 38 loadbang;
#X msg 272 82 reset \, frame 100;
#X obj 245 58 t b b;
#X obj 132 117 t b b;
#X msg 376 135 \; pd dsp 1;
#X obj 349 114 t b b;
#X obj 349 181 del 100;
#X obj 349 201 s \$0-init100;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 3 0 11 0;
#X connect 3 1 5 0;
#X connect 3 1 6 0;
#X connect 4 0 1 0;
#X connect 5 0 1 0;
#X connect 6 0 0 0;
#X connect 7 0 0 0;
#X connect 8 0 10 0;
#X connect 9 0 0 0;
#X connect 10 0 5 0;
#X connect 10 1 9 0;
#X connect 11 0 7 0;
#X connect 11 1 13 0;
#X connect 13 0 14 0;
#X connect 13 1 12 0;
#X connect 14 0 15 0;
#X restore 577 115 pd gemwin;
#X msg 577 96 destroy;
#X text 573 75 Create window:;
#X msg 184 350 link \$1 \$2;
#X obj 154 264 glsl_vertex;
#X obj 154 307 glsl_fragment;
#X obj 168 150 loadbang;
#X obj 154 399 glsl_program;
#X obj 154 673 gemvertexbuffer;
#X obj 154 116 gemhead;
#X obj 36 403 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X msg 36 433 position_enable \$1;
#X msg 105 366 print;
#X msg 101 278 print;
#X msg 103 233 print;
#X obj 246 548 cnv 15 90 40 empty empty empty 20 12 0 14 -204786 -66577
0;
#X msg 255 559 program \$1;
#X obj 30 544 cnv 15 120 70 empty empty empty 20 12 0 14 -204786 -66577
0;
#X msg 39 583 print_attributes;
#X msg 38 556 reset_attributes;
#X obj 27 487 cnv 15 140 40 empty empty empty 20 12 0 14 -204786 -66577
0;
#X obj 36 465 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X msg 36 498 attribute_enable \$1;
#X msg 223 475 position \$1_position \, attribute LightPosition \$1_LightPosition
\, attribute BrickColor \$1_BrickColor \, attribute MortarColor \$1_MortarColor
\, attribute BrickSize \$1_BrickSize \, attribute BrickPct \$1_BrickPct
;
#X obj 224 612 loadbang;
#X msg 224 629 resize 16 \, draw quad;
#X text 378 629 4 quads;
#X obj 168 179 t b b;
#X obj 223 421 t b f;
#X text 406 232 syntax:;
#X text 339 559 <----- essential for lookup functions;
#X text 406 248 attribute <name> <array> <offset(optional)>;
#X obj 358 431 print linking;
#X obj 184 372 t a a;
#N canvas 359 182 450 300 tables 0;
#N canvas 816 49 460 613 load_tables 0;
#X obj 39 17 loadbang;
#X msg 39 106 0 1 1 1 1 1 1 1 1 1 1 1 1 1 0.5 0.5 1 0.5 0.5 1 0.5 0.5
1 0.5 0.5 0 0.5 0.6 0 0.5 0.6 0 0.5 0.6 0 0.5 0.6 1 1 1 1 1 1 1 1 1
1 1 1;
#X obj 39 149 s \$0_BrickColor;
#X msg 39 170 0 0.92 0.9 0.92 0.9 0.92 0.9 0.92 0.9 0.92 0.9 0.92 0.9
0.92 0.9 0.92 0.9 0.82 0.7 0.82 0.7 0.82 0.7 0.82 0.7 0.92 0.9 0.92
0.9 0.92 0.9 0.92 0.9;
#X obj 39 213 s \$0_BrickPct;
#X msg 39 266 0 0.32 0.2 0.32 0.2 0.32 0.2 0.32 0.2 0.32 0.2 0.32 0.2
0.32 0.2 0.32 0.2 0.92 0.45 0.92 0.45 0.92 0.45 0.92 0.45 0.62 0.2
0.62 0.2 0.62 0.2 0.62 0.2;
#X obj 39 309 s \$0_BrickSize;
#X msg 39 357 0 -3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2
-3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2 3.5 -6 -0.4 3.5 -6 -0.4 3.5 -6 -0.4
3.5 -6 -0.4 -3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2 -3 -1 -0.2;
#X obj 39 400 s \$0_LightPosition;
#X msg 39 505 0 -3.25 3.25 0 -0.75 3.25 0 -0.75 0.75 0 -3.25 0.75 0
0.75 3.25 0 3.25 3.25 0 3.25 0.75 0 0.75 0.75 0 0.75 -0.75 0 3.25 -0.75
0 3.25 -3.25 0 0.75 -3.25 0 -3.25 -0.75 0 -0.75 -0.75 0 -0.75 -3.25
0 -3.25 -3.25 0;
#X obj 39 561 s \$0_position;
#X msg 39 437 0 1 0.5 0.5 1 0.5 0.5 1 0.5 0.5 1 0.5 0.5 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0;
#X obj 39 467 s \$0_MortarColor;
#X obj 39 39 t b b b b b b;
#X msg 133 15 bang;
#X connect 0 0 13 0;
#X connect 1 0 2 0;
#X connect 3 0 4 0;
#X connect 5 0 6 0;
#X connect 7 0 8 0;
#X connect 9 0 10 0;
#X connect 11 0 12 0;
#X connect 13 0 1 0;
#X connect 13 1 3 0;
#X connect 13 2 5 0;
#X connect 13 3 7 0;
#X connect 13 4 11 0;
#X connect 13 5 9 0;
#X connect 14 0 13 0;
#X restore 129 244 pd load_tables;
#X obj 129 66 table \$0_position 48;
#X obj 129 87 table \$0_LightPosition 48;
#X obj 129 108 table \$0_BrickColor 48;
#X obj 129 128 table \$0_MortarColor 48;
#X obj 129 149 table \$0_BrickSize 32;
#X obj 128 169 table \$0_BrickPct 32;
#X restore 754 73 pd tables;
#X obj 223 443 list prepend \$0;
#X obj 396 298 cnv 15 90 40 empty empty empty 20 12 0 14 -204786 -66577
0;
#X obj 396 348 cnv 15 90 40 empty empty empty 20 12 0 14 -204786 -66577
0;
#X msg 408 310 attribute LightPosition \$1_LightPosition;
#N canvas 268 270 483 439 more 0;
#X text 66 43 syntax:;
#X text 67 95 adds an attribute to gemvertexbuffer;
#X text 67 127 if the attribute already exists in gemvertexbuffer \,
this message updates the attribute with the array data;
#X text 66 60 attribute <name> <array> <offset(optional)>;
#X text 66 281 attribute tables are interleaved only;
#X text 64 177 if the vert or frag files are changed \, the attributes
in gemvertexbuffer can be reset with a "reset_attributes" msg and re-added
;
#X text 65 236 there is no limit for the amount of attributes that
can be added;
#X text 66 321 in order to set 'uniform' type variables once per vertex
or geo \, they must be changed to attribute/varying type in the vert
and frag files;
#X restore 407 359 pd more;
#X obj 164 646 t a;
#X obj 301 663 print vb;
#X msg 246 176 bang;
#X msg 168 207 open ../data/brick.vert;
#X msg 195 234 open ../data/brick.frag;
#N canvas 1 51 450 300 modulelist 0;
#X obj 81 44 inlet;
#X obj 248 55 inlet;
#X obj 81 172 outlet;
#X obj 81 66 t b f;
#X obj 81 128 pack 0 0 0;
#X obj 81 150 route 0;
#X obj 81 98 del 0;
#X connect 0 0 3 0;
#X connect 1 0 4 2;
#X connect 3 0 6 0;
#X connect 3 1 4 1;
#X connect 4 0 5 0;
#X connect 5 0 2 0;
#X connect 6 0 4 0;
#X restore 184 330 pd modulelist;
#X msg 272 416 bang;
#X connect 0 0 1 0;
#X connect 2 0 3 0;
#X connect 3 0 2 0;
#X connect 5 0 35 0;
#X connect 6 0 7 0;
#X connect 6 1 47 1;
#X connect 7 0 9 0;
#X connect 7 1 47 0;
#X connect 8 0 29 0;
#X connect 9 0 10 0;
#X connect 9 1 30 0;
#X connect 11 0 6 0;
#X connect 12 0 13 0;
#X connect 13 0 42 0;
#X connect 14 0 9 0;
#X connect 15 0 7 0;
#X connect 16 0 6 0;
#X connect 18 0 42 0;
#X connect 20 0 42 0;
#X connect 21 0 42 0;
#X connect 23 0 24 0;
#X connect 24 0 42 0;
#X connect 25 0 42 0;
#X connect 26 0 27 0;
#X connect 27 0 42 0;
#X connect 29 0 45 0;
#X connect 29 1 46 0;
#X connect 30 0 37 0;
#X connect 30 1 18 0;
#X connect 35 0 9 0;
#X connect 35 1 34 0;
#X connect 37 0 25 0;
#X connect 42 0 10 0;
#X connect 42 0 43 0;
#X connect 44 0 29 0;
#X connect 45 0 6 0;
#X connect 46 0 7 0;
#X connect 47 0 5 0;
#X connect 48 0 37 0;
|