how to use jit.gl.multiple

Apr 27, 2009 at 10:28pm

how to use jit.gl.multiple

Hi

I’m trying to figure out how to use jit.gl.multiple, not the easiest since I can’t seem to find any great documentation of it but I’m working from the great patch here:

http://adsr.jp/2007/11/vibgyor_b_1.php

I’ve managed to replace the jit.gl.sketch in that with a jit.gl.videoplane and control movement along x, y and z axis. Now I’m a bit stuck on how to multiply the videoplane more than 3 times and how to put different textures on each of the videoplanes. I’ve seen a comment on another post which seems to suggest that @targetname is the solution to this second problem but I’m unsure how. Below is what I have so far – any help much appreciated.

a+
gar

max v2;
#N vpatcher 692 127 1307 570;
#P window setfont “Sans Serif” 9.;
#P newex 450 86 54 196617 s multiple;
#P flonum 406 41 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 368 41 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 328 41 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 328 63 85 196617 pak scale 1. 1. 1.;
#P flonum 528 41 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 490 41 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 450 41 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 450 63 95 196617 pak position 0. 0. 0.;
#P user ubumenu 436 120 35 196617 0 1 1 0;
#X add x;
#X add y;
#X add z;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P flonum 473 120 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 510 120 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 399 120 35 9 0 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#N vpatcher 237 438 1222 846;
#P origin 0 -313;
#P window setfont “Sans Serif” 9.;
#P flonum 656 83 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 881 49 41 196617 r draw;
#N vpatcher 37 491 571 673;
#P window setfont “Sans Serif” 9.;
#P window linecount 0;
#P newex 252 47 56 196617 r loadbang;
#P button 252 68 15 0;
#P window linecount 1;
#P newex 50 87 77 196617 jit.matrix rots;
#P newex 252 130 77 196617 jit.matrix rots;
#P newex 252 108 256 196617 jit.expr @expr “180*snorm[0]” “180*snorm[1]” “0″;
#P newex 252 87 130 196617 jit.matrix 3 float32 15 15;
#P newex 142 87 34 196617 / 50.;
#N counter 2 0 10000;
#X flags 0 0;
#P newobj 142 47 95 196617 counter 2 0 10000;
#P newex 50 110 102 196617 jit.op @op * @val 1.;
#P inlet 50 21 15 0;
#P inlet 166 67 15 0;
#P outlet 50 132 15 0;
#P connect 2 0 9 0;
#P connect 9 0 3 0;
#P connect 3 0 0 0;
#P fasten 2 0 4 0 55 43 147 43;
#P connect 4 0 5 0;
#P connect 5 0 3 1;
#P connect 1 0 5 1;
#P connect 11 0 10 0;
#P connect 10 0 6 0;
#P connect 6 0 7 0;
#P connect 7 0 8 0;
#P pop;
#P newobj 881 113 37 196617 p Spin;
#P flonum 908 91 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 905 76 47 196617 spin rate;
#P newex 36 267 54 196617 r multiple;
#P user jit.pwindow 723 314 66 66 0 1 0 0 1 0;
#P toggle 672 315 15 0;
#P window linecount 0;
#P newex 195 157 27 196617 + 1;
#P window linecount 1;
#P newex 195 178 40 196617 gate 3;
#P inlet 195 51 15 0;
#P window linecount 2;
#P newex 463 204 131 196617 jit.expr @expr “0″ “0″ “((cell[0]%3)-1)*in[0]“;
#P inlet 253 51 15 0;
#P flonum 253 83 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 225 128 29 196617 t 1 l;
#P window linecount 3;
#P newex 195 204 130 196617 jit.expr @expr “((cell[0]%3)-1)*in[0]” “0″ “0″;
#P window linecount 1;
#P newex 225 157 130 196617 jit.matrix 3 float32 15 15;
#N vpatcher 614 399 1262 709;
#P origin 137 34;
#P button 131 150 15 0;
#P inlet 15 50 15 0;
#P toggle 15 72 15 0;
#P window setfont “Sans Serif” 9.;
#P newex 15 92 29 196617 gate;
#P outlet 15 246 15 0;
#P newex 15 203 130 196617 jit.matrix 3 float32 20 20;
#P newex 15 224 244 196617 jit.expr @expr (in[0]*in[1]);
#P newex 15 181 220 196617 jit.gl.gridshape @matrixoutput 1 @shape torus;
#P newex 248 161 40 196617 / 300.;
#N counter 2 10000 50000;
#X flags 0 0;
#P newobj 248 140 119 196617 counter 2 10000 50000;
#P message 249 181 148 196617 bang , scale $1 $1 $1 , align $1;
#P newex 249 202 364 196617 jit.bfg 3 float32 20 20 @basis noise.simplex @scale 5. @weight 0.3 0.09 0.25;
#P newex 15 117 243 196617 t b b;
#P newex 34 71 41 196617 r draw;
#P connect 12 0 11 0;
#P connect 11 0 10 0;
#P connect 10 0 1 0;
#P connect 1 0 6 0;
#P connect 6 0 8 0;
#P connect 8 0 7 0;
#P connect 7 0 9 0;
#P connect 0 0 10 1;
#P connect 1 1 4 0;
#P connect 4 0 5 0;
#P connect 5 0 3 0;
#P connect 3 0 2 0;
#P connect 2 0 7 1;
#P pop;
#P newobj 672 336 50 196617 p moving;
#P inlet 656 51 15 0;
#P inlet 22 51 15 0;
#P newex 296 51 41 196617 r draw;
#P newex 195 260 184 196617 jit.slide @slide_up 15 @slide_down 15;
#P window linecount 3;
#P newex 329 204 130 196617 jit.expr @expr “0″ “((cell[0]%3)-1)*in[0]” “0″;
#P window linecount 4;
#P newex 22 178 134 196617 jit.expr @expr “in[0]*snorm[0]+1″ “in[0]*snorm[0]+1″ “in[0]*snorm[0]+1″;
#P window linecount 1;
#P newex 22 157 118 196617 jit.matrix 3 float32 9 9;
#P window linecount 3;
#P newex 630 180 143 196617 jit.expr @expr “in[0]*(snorm[0]+snorm[1])” “0″ “0″;
#P window linecount 1;
#P newex 630 226 184 196617 jit.slide @slide_up 15 @slide_down 15;
#P newex 630 157 130 196617 jit.matrix 3 float32 15 15;
#P newex 22 303 530 196617 jit.gl.multiple foo 4 @targetname me @glparams scale position rotate texture @depth_enable 1 @texture tex2 tex3;
#P message 827 202 80 196617 setall 0 1 , bang;
#P newex 827 178 96 196617 t b l;
#P newex 827 226 117 196617 jit.matrix 2 char 15 15;
#P message 22 83 56 196617 dim $1 $1;
#P newex 22 131 29 196617 t 0 l;
#P newex 630 128 27 196617 t b l;
#P connect 15 0 2 0;
#P connect 2 0 1 0;
#P connect 1 0 10 0;
#P connect 1 1 10 0;
#P connect 10 0 11 0;
#P connect 11 0 6 0;
#P fasten 29 0 6 0 41 290 27 290;
#P connect 24 0 26 0;
#P connect 26 0 25 0;
#P connect 25 0 19 0;
#P fasten 23 0 13 0 468 254 200 254;
#P fasten 12 0 13 0 334 250 200 250;
#P connect 19 0 13 0;
#P connect 13 0 6 1;
#P fasten 2 0 20 0 27 121 230 121;
#P fasten 21 0 18 0 258 150 230 150;
#P connect 20 0 18 0;
#P connect 20 1 18 0;
#P connect 18 0 25 1;
#P fasten 14 0 21 0 301 75 258 75;
#P connect 22 0 21 0;
#P fasten 25 1 12 0 215 200 334 200;
#P fasten 8 0 6 2 635 287 373 287;
#P fasten 25 2 23 0 230 198 468 198;
#P fasten 3 0 6 3 832 293 546 293;
#P fasten 2 0 0 0 27 108 635 108;
#P fasten 34 0 7 0 661 151 635 151;
#P connect 0 1 7 0;
#P connect 0 0 7 0;
#P connect 7 0 9 0;
#P connect 9 0 8 0;
#P fasten 14 0 34 0 301 75 661 75;
#P connect 16 0 34 0;
#P connect 27 0 17 0;
#P connect 17 0 28 0;
#P fasten 2 0 4 0 27 106 832 106;
#P connect 4 0 5 0;
#P connect 5 0 3 0;
#P fasten 4 1 3 0 918 221 832 221;
#P connect 33 0 32 0;
#P connect 31 0 32 1;
#P pop;
#P newobj 399 143 123 196617 p multiple;
#P objectname nurb2[1];
#P newex 178 144 213 196617 jit.gl.videoplane foo @name me @automatic 0;
#P newex 89 152 41 196617 s draw;
#P newex 252 120 56 196617 s loadbang;
#N vpatcher 61 274 740 874;
#P window setfont “Sans Serif” 9.;
#P window linecount 2;
#P comment 322 375 105 196617 enable hardware compression;
#P user ubumenu 405 375 100 196617 0 1 1 0;
#X add none;
#X add dxt1;
#X add dxt3;
#X add dxt5;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P window linecount 1;
#P newex 404 398 90 196617 prepend compress;
#P comment 237 529 148 196617 set texture name to tex2;
#P user ubumenu 196 425 100 196617 0 1 1 0;
#X add static;
#X add dynamic;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 203 450 70 196617 prepend mode;
#P user ubumenu 304 424 100 196617 0 1 1 0;
#X add none;
#X add nearest;
#X add linear;
#X add bilinear;
#X add trilinear;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 311 449 81 196617 prepend mipmap;
#P user ubumenu 414 423 100 196617 0 1 1 0;
#X add nicest;
#X add fastest;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 421 448 94 196617 prepend correction;
#P user ubumenu 319 473 100 196617 0 1 1 0;
#X add none;
#X add nearest;
#X add linear;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 326 498 71 196617 prepend filter;
#P user ubumenu 103 473 100 196617 0 1 1 0;
#X add auto;
#X add alpha;
#X add luminance;
#X add intensity;
#X add depth;
#X add lumalpha;
#X add rgb;
#X add argb;
#X add uyvy;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 110 498 93 196617 prepend colormode;
#P user ubumenu 211 473 100 196617 0 1 1 0;
#X add clamp;
#X add repeat;
#X add clampedge;
#X add clampborder;
#X add mirroredrepeat;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 218 498 70 196617 prepend wrap;
#P message 79 404 28 196617 read;
#P message 144 404 27 196617 stop;
#P message 110 404 31 196617 start;
#P toggle 16 383 15 0;
#P newex 16 404 55 196617 metro 20;
#P newex 16 436 103 196617 jit.qt.movie 256 256;
#P comment 32 385 149 196617 • read a movie and start metro.;
#P user ubumenu 431 473 100 196617 0 1 1 0;
#X add replace;
#X add decal;
#X add modulate;
#X add blend;
#X add combine;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 438 498 71 196617 prepend apply;
#P user jit.pwindow 15 481 66 66 0 1 0 0 1 0;
#P newex 86 526 144 196617 jit.gl.texture foo @name tex3;
#B color 5;
#N vpatcher 888 44 1242 523;
#P window setfont “Sans Serif” 9.;
#P hidden newex 90 429 104 196617 bgcolor 255 230 230;
#P comment 107 329 55 196617 rgb weight;
#P comment 168 329 100 196617 alpha weight;
#P flonum 170 346 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 127 346 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 92 367 81 196617 pak weight 0. 0.;
#P comment 63 25 221 196617 • multitexture pipeline for combine apply mode;
#P comment 63 46 100 196617 rgb function;
#P comment 168 46 100 196617 alpha function;
#P user ubumenu 168 65 100 196617 0 1 1 0;
#X add replace;
#X add modulate;
#X add add;
#X add addsigned;
#X add subtract;
#X add interpolate;
#X add dot3rgb;
#X add dot3rgba;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 63 65 100 196617 0 1 1 0;
#X add replace;
#X add modulate;
#X add add;
#X add addsigned;
#X add subtract;
#X add interpolate;
#X add dot3rgb;
#X add dot3rgba;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 41 86 79 196617 pak function a a;
#P comment 268 240 53 196617 operand 2;
#P comment 268 260 53 196617 operand 1;
#P user ubumenu 168 240 100 196617 0 1 1 0;
#X add color;
#X add oneminuscolor;
#X add alpha;
#X add oneminusalpha;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 168 260 100 196617 0 1 1 0;
#X add color;
#X add oneminuscolor;
#X add alpha;
#X add oneminusalpha;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 168 280 100 196617 0 1 1 0;
#X add color;
#X add oneminuscolor;
#X add alpha;
#X add oneminusalpha;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 63 240 100 196617 0 1 1 0;
#X add color;
#X add oneminuscolor;
#X add alpha;
#X add oneminusalpha;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 63 260 100 196617 0 1 1 0;
#X add color;
#X add oneminuscolor;
#X add alpha;
#X add oneminusalpha;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 63 280 100 196617 0 1 1 0;
#X add color;
#X add oneminuscolor;
#X add alpha;
#X add oneminusalpha;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 63 306 110 196617 pak operand a a a a a a;
#P comment 63 223 100 196617 rgb operands;
#P comment 168 223 100 196617 alpha operands;
#P comment 268 280 53 196617 operand 0;
#P comment 268 130 48 196617 source 2;
#P comment 268 150 48 196617 source 1;
#P user ubumenu 168 130 100 196617 0 1 1 0;
#X add texture;
#X add color;
#X add constant;
#X add previous;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 168 150 100 196617 0 1 1 0;
#X add texture;
#X add color;
#X add constant;
#X add previous;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 168 170 100 196617 0 1 1 0;
#X add texture;
#X add color;
#X add constant;
#X add previous;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 63 130 100 196617 0 1 1 0;
#X add texture;
#X add color;
#X add constant;
#X add previous;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 63 150 100 196617 0 1 1 0;
#X add texture;
#X add color;
#X add constant;
#X add previous;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 63 170 100 196617 0 1 1 0;
#X add texture;
#X add color;
#X add constant;
#X add previous;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 53 196 105 196617 pak source a a a a a a;
#P comment 63 114 100 196617 rgb sources;
#P comment 168 114 100 196617 alpha sources;
#P comment 268 170 48 196617 source 0;
#P outlet 41 442 15 0;
#P connect 31 0 0 0;
#P connect 16 0 0 0;
#P connect 4 0 0 0;
#P connect 25 0 0 0;
#P fasten 5 1 4 1 113 192 73 192;
#P fasten 26 1 25 1 113 83 80 83;
#P fasten 17 1 16 1 113 302 84 302;
#P fasten 8 1 4 2 218 192 88 192;
#P fasten 20 1 16 2 218 302 100 302;
#P fasten 6 1 4 3 113 192 103 192;
#P fasten 27 1 25 2 218 83 114 83;
#P fasten 18 1 16 3 113 302 116 302;
#P fasten 9 1 4 4 218 192 118 192;
#P fasten 21 1 16 4 218 302 132 302;
#P connect 32 0 31 1;
#P fasten 7 1 4 5 113 192 133 192;
#P fasten 10 1 4 6 218 192 148 192;
#P fasten 19 1 16 5 113 302 148 302;
#P fasten 22 1 16 6 218 302 164 302;
#P fasten 33 0 31 2 175 364 167 364;
#P pop;
#P newobj 517 499 115 196617 p multi-texture-details;
#P window linecount 2;
#P comment 327 181 105 196617 enable hardware compression;
#P user ubumenu 410 181 100 196617 0 1 1 0;
#X add none;
#X add dxt1;
#X add dxt3;
#X add dxt5;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P window linecount 1;
#P newex 409 204 90 196617 prepend compress;
#P comment 242 335 148 196617 set texture name to tex2;
#P user ubumenu 201 231 100 196617 0 1 1 0;
#X add static;
#X add dynamic;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 208 256 70 196617 prepend mode;
#P user ubumenu 309 230 100 196617 0 1 1 0;
#X add none;
#X add nearest;
#X add linear;
#X add bilinear;
#X add trilinear;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 316 255 81 196617 prepend mipmap;
#P user ubumenu 419 229 100 196617 0 1 1 0;
#X add nicest;
#X add fastest;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 426 254 94 196617 prepend correction;
#P user ubumenu 324 279 100 196617 0 1 1 0;
#X add none;
#X add nearest;
#X add linear;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 331 304 71 196617 prepend filter;
#P user ubumenu 108 279 100 196617 0 1 1 0;
#X add auto;
#X add alpha;
#X add luminance;
#X add intensity;
#X add depth;
#X add lumalpha;
#X add rgb;
#X add argb;
#X add uyvy;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 115 304 93 196617 prepend colormode;
#P user ubumenu 216 279 100 196617 0 1 1 0;
#X add clamp;
#X add repeat;
#X add clampedge;
#X add clampborder;
#X add mirroredrepeat;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 223 304 70 196617 prepend wrap;
#P message 84 210 28 196617 read;
#P message 149 210 27 196617 stop;
#P message 115 210 31 196617 start;
#P toggle 21 189 15 0;
#P newex 21 210 55 196617 metro 20;
#P newex 21 242 103 196617 jit.qt.movie 256 256;
#P comment 37 191 149 196617 • read a movie and start metro.;
#P user ubumenu 436 279 100 196617 0 1 1 0;
#X add replace;
#X add decal;
#X add modulate;
#X add blend;
#X add combine;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 443 304 71 196617 prepend apply;
#P user jit.pwindow 20 287 66 66 0 1 0 0 1 0;
#P newex 91 332 143 196617 jit.gl.texture foo @name tex2;
#B color 5;
#N vpatcher 888 44 1242 523;
#P window setfont “Sans Serif” 9.;
#P hidden newex 90 429 104 196617 bgcolor 255 230 230;
#P comment 107 329 55 196617 rgb weight;
#P comment 168 329 100 196617 alpha weight;
#P flonum 170 346 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 127 346 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 92 367 81 196617 pak weight 0. 0.;
#P comment 63 25 221 196617 • multitexture pipeline for combine apply mode;
#P comment 63 46 100 196617 rgb function;
#P comment 168 46 100 196617 alpha function;
#P user ubumenu 168 65 100 196617 0 1 1 0;
#X add replace;
#X add modulate;
#X add add;
#X add addsigned;
#X add subtract;
#X add interpolate;
#X add dot3rgb;
#X add dot3rgba;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 63 65 100 196617 0 1 1 0;
#X add replace;
#X add modulate;
#X add add;
#X add addsigned;
#X add subtract;
#X add interpolate;
#X add dot3rgb;
#X add dot3rgba;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 41 86 79 196617 pak function a a;
#P comment 268 240 53 196617 operand 2;
#P comment 268 260 53 196617 operand 1;
#P user ubumenu 168 240 100 196617 0 1 1 0;
#X add color;
#X add oneminuscolor;
#X add alpha;
#X add oneminusalpha;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 168 260 100 196617 0 1 1 0;
#X add color;
#X add oneminuscolor;
#X add alpha;
#X add oneminusalpha;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 168 280 100 196617 0 1 1 0;
#X add color;
#X add oneminuscolor;
#X add alpha;
#X add oneminusalpha;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 63 240 100 196617 0 1 1 0;
#X add color;
#X add oneminuscolor;
#X add alpha;
#X add oneminusalpha;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 63 260 100 196617 0 1 1 0;
#X add color;
#X add oneminuscolor;
#X add alpha;
#X add oneminusalpha;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 63 280 100 196617 0 1 1 0;
#X add color;
#X add oneminuscolor;
#X add alpha;
#X add oneminusalpha;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 63 306 110 196617 pak operand a a a a a a;
#P comment 63 223 100 196617 rgb operands;
#P comment 168 223 100 196617 alpha operands;
#P comment 268 280 53 196617 operand 0;
#P comment 268 130 48 196617 source 2;
#P comment 268 150 48 196617 source 1;
#P user ubumenu 168 130 100 196617 0 1 1 0;
#X add texture;
#X add color;
#X add constant;
#X add previous;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 168 150 100 196617 0 1 1 0;
#X add texture;
#X add color;
#X add constant;
#X add previous;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 168 170 100 196617 0 1 1 0;
#X add texture;
#X add color;
#X add constant;
#X add previous;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 63 130 100 196617 0 1 1 0;
#X add texture;
#X add color;
#X add constant;
#X add previous;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 63 150 100 196617 0 1 1 0;
#X add texture;
#X add color;
#X add constant;
#X add previous;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P user ubumenu 63 170 100 196617 0 1 1 0;
#X add texture;
#X add color;
#X add constant;
#X add previous;
#X prefix_set 0 0
0;
#X pattrmode 1;
#P newex 53 196 105 196617 pak source a a a a a a;
#P comment 63 114 100 196617 rgb sources;
#P comment 168 114 100 196617 alpha sources;
#P comment 268 170 48 196617 source 0;
#P outlet 41 442 15 0;
#P connect 25 0 0 0;
#P connect 4 0 0 0;
#P connect 16 0 0 0;
#P connect 31 0 0 0;
#P fasten 5 1 4 1 113 192 73 192;
#P fasten 26 1 25 1 113 83 80 83;
#P fasten 17 1 16 1 113 302 84 302;
#P fasten 8 1 4 2 218 192 88 192;
#P fasten 20 1 16 2 218 302 100 302;
#P fasten 6 1 4 3 113 192 103 192;
#P fasten 27 1 25 2 218 83 114 83;
#P fasten 18 1 16 3 113 302 116 302;
#P fasten 9 1 4 4 218 192 118 192;
#P fasten 21 1 16 4 218 302 132 302;
#P connect 32 0 31 1;
#P fasten 7 1 4 5 113 192 133 192;
#P fasten 10 1 4 6 218 192 148 192;
#P fasten 19 1 16 5 113 302 148 302;
#P fasten 22 1 16 6 218 302 164 302;
#P fasten 33 0 31 2 175 364 167 364;
#P pop;
#P newobj 522 305 115 196617 p multi-texture-details;
#P newex 286 72 130 196617 jit.matrix 4 float32 50 50;
#P newex 286 115 117 196617 jit.matrix 4 char 50 50;
#P newex 286 94 266 196617 jit.expr @expr “0.5″ “norm[0]” “norm[1]” “1-norm[0]“;
#P newex 286 136 233 196617 jit.gl.texture foo @name t4 @texgen environment;
#P button 50 50 15 0;
#P newex 50 72 109 196617 jit.noise 4 char 50 50;
#P newex 50 94 233 196617 jit.gl.texture foo @name t3 @texgen environment;
#P inlet 175 30 15 0;
#P connect 44 0 43 0;
#P fasten 43 0 42 0 21 430 21 430;
#P fasten 47 0 42 0 84 430 21 430;
#P fasten 46 0 42 0 149 430 21 430;
#P fasten 45 0 42 0 115 430 21 430;
#P connect 42 0 38 0;
#P connect 16 0 15 0;
#P fasten 17 0 14 0 120 236 26 236;
#P fasten 18 0 14 0 154 236 26 236;
#P fasten 19 0 14 0 89 236 26 236;
#P fasten 15 0 14 0 26 236 26 236;
#P connect 14 0 10 0;
#P connect 3 0 2 0;
#P connect 2 0 1 0;
#P fasten 42 0 37 0 21 459 91 459;
#P fasten 36 0 37 0 522 520 91 520;
#P fasten 39 0 37 0 443 518 91 518;
#P fasten 50 0 37 0 115 518 91 518;
#P fasten 48 0 37 0 223 518 91 518;
#P fasten 52 0 37 0 331 518 91 518;
#P fasten 56 0 37 0 316 518 91 518;
#P fasten 58 0 37 0 208 518 91 518;
#P fasten 54 0 37 0 426 518 91 518;
#P fasten 61 0 37 0 409 469 91 469;
#P fasten 14 0 9 0 26 265 96 265;
#P fasten 8 0 9 0 527 326 96 326;
#P fasten 11 0 9 0 448 324 96 324;
#P fasten 22 0 9 0 120 324 96 324;
#P fasten 20 0 9 0 228 324 96 324;
#P fasten 24 0 9 0 336 324 96 324;
#P fasten 28 0 9 0 321 324 96 324;
#P fasten 30 0 9 0 213 324 96 324;
#P fasten 26 0 9 0 431 324 96 324;
#P fasten 33 0 9 0 414 275 96 275;
#P fasten 51 1 50 0 153 493 115 493;
#P fasten 23 1 22 0 158 299 120 299;
#P fasten 59 1 58 0 246 445 208 445;
#P fasten 31 1 30 0 251 251 213 251;
#P fasten 49 1 48 0 261 493 223 493;
#P fasten 21 1 20 0 266 299 228 299;
#P fasten 3 0 7 0 55 68 291 68;
#P connect 7 0 5 0;
#P connect 5 0 6 0;
#P connect 6 0 4 0;
#P fasten 57 1 56 0 354 444 316 444;
#P fasten 29 1 28 0 359 250 321 250;
#P fasten 53 1 52 0 369 493 331 493;
#P fasten 25 1 24 0 374 299 336 299;
#P fasten 62 1 61 0 455 394 409 394;
#P fasten 34 1 33 0 460 200 414 200;
#P fasten 55 1 54 0 464 443 426 443;
#P fasten 27 1 26 0 469 249 431 249;
#P fasten 40 1 39 0 481 493 443 493;
#P fasten 12 1 11 0 486 299 448 299;
#P pop;
#P newobj 197 120 51 196617 p TexGen;
#P newex 178 91 48 196617 loadbang;
#P user jit.fpsgui 69 174 60 196617 0;
#P message 63 211 34 196617 reset;
#P newex 63 230 255 196617 jit.gl.handle foo @inherit_transform 1 @auto_rotate 1;
#P toggle 508 228 15 0;
#P message 508 246 55 196617 floating $1;
#P toggle 435 228 15 0;
#P newex 396 227 35 196617 sel 27;
#P message 435 246 68 196617 fullscreen $1;
#P newex 353 270 188 196617 jit.window foo @depthbuffer 1 @sync 0;
#P newex 351 227 40 196617 key;
#P number 86 70 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 45 70 15 0;
#P newex 45 92 51 196617 qmetro 2;
#P newex 45 114 58 196617 t b b erase;
#P newex 45 272 271 196617 jit.gl.render foo @erase_color 1. 1. 1. 1. @camera 0 0 -6;
#P button 178 119 15 0;
#P connect 4 0 3 0;
#P connect 3 0 2 0;
#P fasten 13 0 1 0 68 259 50 259;
#P fasten 2 2 1 0 98 139 50 139;
#P connect 2 0 1 0;
#P connect 14 0 13 0;
#P connect 2 1 15 0;
#P connect 5 0 3 1;
#P fasten 2 1 19 0 74 146 94 146;
#P connect 16 0 0 0;
#P connect 0 0 20 0;
#P fasten 16 0 17 0 183 114 202 114;
#P fasten 16 0 18 0 183 114 257 114;
#P fasten 31 0 30 1 333 59 358 59;
#P fasten 11 0 7 0 513 265 358 265;
#P fasten 8 0 7 0 440 265 358 265;
#P fasten 32 0 30 2 373 59 383 59;
#P fasten 6 0 9 0 356 246 393 246 393 225 401 225;
#P connect 22 0 21 0;
#P fasten 33 0 30 3 411 59 408 59;
#P fasten 9 0 10 0 401 245 432 245 432 225 440 225;
#P connect 10 0 8 0;
#P connect 25 0 21 1;
#P connect 26 0 34 0;
#P fasten 30 0 34 0 333 83 455 83;
#P connect 24 0 21 2;
#P fasten 27 0 26 1 455 59 483 59;
#P fasten 28 0 26 2 495 59 511 59;
#P connect 12 0 11 0;
#P connect 23 0 21 3;
#P fasten 29 0 26 3 533 59 539 59;
#P pop;

#43566
Apr 28, 2009 at 12:20am

currently, for gl.multiple to function properly, the dimensions of all the input matrices for the glparams need to be the same. this will be changed in a future release.

therefore, you must set the dim attribute for all your input matrices to the same. you have them set differently in your patch.

#156325
Apr 28, 2009 at 4:44pm

hi

ok so I’ve changed the dimensions on all to jit.matrix 3 float32 15 15 apart from the texture matrix and that seems to allow as many as I need. I also had a play with using pak dim 0 0 to modify each dimension separately and I see what you mean about getting the jit.gl.multiple to function properly. What I didn’t understand was how the videoplanes were multipling accross by 3 and then appearing on each other but I’ve spotted that now as the 3 in the formula ((cell[0]%3)-1)*in[0]. Do you know where I can find some info on jit.gl.multiple? The help is pretty thin.

Also any idea how I get different textures onto those videoplanes now? Thanks.

a+
gar

#156326
Apr 30, 2009 at 9:31pm

here is a patch demoing multiple textures with gl.multiple.

– Pasted Max Patch, click to expand. –
#156327
Apr 30, 2009 at 10:47pm

Hi

Many thanks for the example but unfortunately I don’t have Max 5 so can’t view this.

a+
gar

#156328
Apr 30, 2009 at 11:30pm

attached screenshot and the maxpat, which can be converted to m4 with the supercollider converter. best i can do.

#156329
May 1, 2009 at 7:24pm

ahh I see, beginning to make more sense now – for anyone trying to do this and failing with Max 4 I’ve included a version. Many thanks for your help

a+
gar

max v2;
#N vpatcher 426 98 1230 657;
#P window setfont “Sans Serif” 9.;
#P message 133 137 34 196617 reset;
#P window linecount 3;
#P newex 133 156 116 196617 jit.gl.handle foo @inherit_transform 1 @auto_rotate 0;
#P window linecount 1;
#P newex 323 201 54 196617 r multiple;
#P newex 603 98 54 196617 s multiple;
#P flonum 559 53 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 521 53 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 481 53 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 481 75 85 196617 pak scale 1. 1. 1.;
#P flonum 682 53 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 643 53 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 603 53 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 603 75 95 196617 pak position 0. 0. 0.;
#P newex 385 477 147 196617 jit.gl.texture foo @name three;
#P newex 385 453 105 196617 jit.qt.movie 320 240;
#P newex 218 477 140 196617 jit.gl.texture foo @name two;
#P newex 218 453 105 196617 jit.qt.movie 320 240;
#P newex 60 477 138 196617 jit.gl.texture foo @name one;
#P newex 60 453 105 196617 jit.qt.movie 320 240;
#P message 439 423 90 196617 read garbage.mov;
#P message 272 423 102 196617 read countdown.mov;
#P message 114 423 83 196617 read dishes.mov;
#P newex 218 423 52 196617 r thebang;
#P newex 385 423 52 196617 r thebang;
#P newex 60 423 52 196617 r thebang;
#P newex 114 374 48 196617 loadbang;
#P number 658 141 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P user multiSlider 595 239 142 75 -1. 1. 1 2681 15 0 0 2 0 0 0;
#M frgb 0 0 0;
#M brgb 255 255 255;
#M rgb2 127 127 127;
#M rgb3 0 0 0;
#M rgb4 37 52 91;
#M rgb5 74 105 182;
#M rgb6 112 158 18;
#M rgb7 149 211 110;
#M rgb8 187 9 201;
#M rgb9 224 62 37;
#M rgb10 7 114 128;
#P newex 657 163 81 196617 jit.fill texmat 0;
#P newex 582 189 140 196617 jit.matrix texmat 1 char 4 4;
#P message 582 164 71 196617 setall 0 , bang;
#P newex 302 288 236 196617 jit.gl.videoplane foo @automatic 0 @name drawme;
#P newex 418 189 160 196617 jit.expr @expr norm[0]*.25+.25;
#P newex 418 167 118 196617 jit.matrix 3 float32 4 4;
#P window linecount 2;
#P newex 301 244 245 196617 jit.gl.multiple foo 3 @glparams position scale texture @targetname drawme @texture one two three;
#P window linecount 1;
#P newex 301 127 193 196617 jit.expr @expr snorm[0]*2 snorm[1]*2;
#P newex 301 106 118 196617 jit.matrix 3 float32 4 4;
#P button 301 74 15 0;
#P newex 301 53 48 196617 loadbang;
#P toggle 94 257 15 0;
#P newex 56 255 35 196617 sel 27;
#P newex 56 235 40 196617 key;
#P message 56 277 70 196617 fullscreen $1;
#P newex 56 297 147 196617 jit.window foo @depthbuffer 1;
#P newex 55 206 153 196617 jit.gl.render foo @camera 0 0 7;
#P newex 73 146 52 196617 s thebang;
#P user jit.fpsgui 109 103 60 196617 0;
#P newex 56 58 57 196617 qmetro 20;
#P newex 55 80 66 196617 t b b erase b;
#P toggle 56 37 15 0;
#P connect 2 0 1 0;
#P fasten 1 2 5 0 96 123 60 123;
#P connect 1 0 5 0;
#P connect 47 0 5 0;
#P connect 0 0 2 0;
#P fasten 8 0 9 0 61 254 61 254;
#P lcolor 1;
#P connect 10 0 7 0;
#P connect 7 0 6 0;
#P connect 25 0 31 0;
#P connect 28 0 31 0;
#P connect 31 0 32 0;
#P connect 1 1 4 0;
#P connect 9 0 10 0;
#P connect 1 3 3 0;
#P connect 24 0 28 0;
#P connect 48 0 47 0;
#P connect 29 0 33 0;
#P connect 27 0 33 0;
#P connect 33 0 34 0;
#P fasten 24 0 29 0 119 403 277 403;
#P connect 11 0 12 0;
#P connect 12 0 13 0;
#P connect 13 0 14 0;
#P connect 14 0 15 0;
#P connect 46 0 15 0;
#P connect 30 0 35 0;
#P connect 26 0 35 0;
#P connect 35 0 36 0;
#P fasten 12 0 16 0 306 101 282 101 282 158 423 158;
#P connect 16 0 17 0;
#P connect 17 0 15 1;
#P fasten 24 0 30 0 119 399 444 399;
#P fasten 42 0 41 1 486 71 511 71;
#P fasten 43 0 41 2 526 71 536 71;
#P connect 20 0 15 2;
#P fasten 44 0 41 3 564 71 561 71;
#P fasten 12 0 19 0 306 101 587 101;
#P connect 21 0 20 0;
#P connect 19 0 20 0;
#P connect 37 0 45 0;
#P fasten 41 0 45 0 486 95 608 95;
#P fasten 38 0 37 1 608 71 636 71;
#P connect 23 0 21 0;
#P fasten 39 0 37 2 648 71 664 71;
#P fasten 40 0 37 3 687 72 692 72;
#P pop;

#156330
Apr 13, 2013 at 8:26pm

@Rob: Just wanted to say, I’ve been trying to understand jit.gl.multiple for some weeks now and the patch you posted made me understand in 10 minutes. You should really consider using this for the help file as the current one is really hard to understand…

Thanks for that patch !

#156331

You must be logged in to reply to this topic.