Forums > Jitter

OpenGL Scissors and Glue


div
October 10, 2006 | 11:18 am

Hi all,

Am looking for a way to do the same thing as jit.scissors and jit.glue in openGL. I need to splice an image into three and process it using some slabs then join it back! sounds too easy eh?

Any ideas? I had a quick look and am looking into number (3) of render contexts… not sure.

Thanks in advance.

Tim


October 10, 2006 | 4:16 pm

Use texture coordinate offset in your slab processing to just work on
one section of the video. It’s a lot like using srcdim and dstdim for
jit.matrix. If the shader you want to use doesn’t have a parameter
for tex coord offsets, just add it.

wes

On 10/10/06, Timothy Devine wrote:
>
> Hi all,
>
> Am looking for a way to do the same thing as jit.scissors and jit.glue in openGL. I need to splice an image into three and process it using some slabs then join it back! sounds too easy eh?
>
> Any ideas? I had a quick look and am looking into number (3) of render contexts… not sure.
>
> Thanks in advance.
>
> Tim
>



div
October 10, 2006 | 10:49 pm

Thanks Wes! That sounds like it is exactly what I need to do!

Ok I started trying to cut and paste the text into a slab but i have no idea about GLSL so i made a patch with rota slabs into a fourway mix…

it is essentially what i want to do… although it doesn’t work… at the very least it is a visual map of how i think it should work…

Any suggestions?

max v2;
#N vpatcher 343 44 1783 896;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 760 347 76 196617 prepend param;
#P flonum 795 304 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 759 304 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 759 324 79 196617 pak offset 1. 1.;
#P newex 308 360 76 196617 prepend param;
#P flonum 343 317 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 307 317 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 307 337 79 196617 pak offset 1. 1.;
#P newex 517 356 76 196617 prepend param;
#P newex 158 260 150 196617 jit.gl.slab fa @file co.dodge.jxs;
#P newex 158 289 176 196617 jit.gl.slab fa @file cf.gaussian.2p.jxs;
#P flonum 1209 343 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 1173 343 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 1173 363 79 196617 pak offset 1. 1.;
#P newex 1113 389 143 196617 jit.gl.slab fa @file td.rota.jxs;
#P flonum 1303 467 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 1331 456 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 1295 456 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 1241 456 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 1205 456 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 1169 456 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 1274 478 94 196617 pak bias 0. 0. 0. 0.;
#P newex 1147 478 100 196617 pak scale 1. 1. 1. 1.;
#P newex 1147 509 76 196617 prepend param;
#P newex 1113 544 166 196617 jit.gl.slab fa @file cc.scalebias.jxs;
#P message 320 589 127 196617 read 43j-fourwaymix.jxs;
#P message 671 590 60 196617 param d $1;
#P message 605 590 60 196617 param c $1;
#P message 540 590 60 196617 param b $1;
#P message 477 589 60 196617 param a $1;
#P newex 158 694 112 196617 jit.gl.slab fa @inputs 4;
#P newex 757 390 143 196617 jit.gl.slab fa @file td.rota.jxs;
#P flonum 1011 457 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 975 457 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 939 457 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 885 457 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 849 457 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 813 457 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 918 479 94 196617 pak bias 0. 0. 0. 0.;
#P newex 791 479 100 196617 pak scale 1. 1. 1. 1.;
#P newex 791 510 76 196617 prepend param;
#P newex 757 545 166 196617 jit.gl.slab fa @file cc.scalebias.jxs;
#P flonum 552 313 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 516 313 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 516 333 79 196617 pak offset 1. 1.;
#P newex 455 391 143 196617 jit.gl.slab fa @file td.rota.jxs;
#P flonum 709 458 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 673 458 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 637 458 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 583 458 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 547 458 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 511 458 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 616 480 94 196617 pak bias 0. 0. 0. 0.;
#P newex 489 480 100 196617 pak scale 1. 1. 1. 1.;
#P newex 489 511 76 196617 prepend param;
#P newex 455 546 166 196617 jit.gl.slab fa @file cc.scalebias.jxs;
#P newex 158 391 143 196617 jit.gl.slab fa @file td.rota.jxs;
#P flonum 405 428 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 369 428 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 333 428 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 279 428 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 243 428 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 207 428 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 312 450 94 196617 pak bias 0. 0. 0. 0.;
#P newex 185 450 100 196617 pak scale 1. 1. 1. 1.;
#P newex 185 481 76 196617 prepend param;
#P newex 21 145 70 196617 jit.window fa;
#P newex 158 747 182 196617 jit.gl.videoplane fa @scale 1.333 1. 1.;
#P newex 21 123 121 196617 jit.gl.render fa @ortho 2;
#P newex 21 79 58 196617 t b b erase;
#P newex 158 546 166 196617 jit.gl.slab fa @file cc.scalebias.jxs;
#P message 274 75 27 196617 stop;
#P flonum 305 55 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 305 75 42 196617 rate $1;
#P message 242 75 28 196617 read;
#P flonum 62 37 35 9 0.5 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 21 37 15 0;
#P newex 21 58 51 196617 qmetro 2;
#P newex 158 127 144 196617 jit.qt.movie 320 240;
#P window linecount 4;
#P comment 498 218 100 196617 so basically i need to control what third the feedback is ocuring;
#P connect 3 0 2 0;
#P connect 2 0 10 0;
#P fasten 10 2 11 0 74 105 26 105;
#P connect 10 0 11 0;
#P connect 4 0 2 1;
#P fasten 10 1 1 0 50 117 163 117;
#P fasten 6 0 1 0 310 117 163 117;
#P fasten 8 0 1 0 279 117 163 117;
#P fasten 5 0 1 0 247 117 163 117;
#P connect 1 0 70 0;
#P connect 70 0 69 0;
#P connect 75 0 23 0;
#P connect 69 0 23 0;
#P connect 23 0 9 0;
#P connect 14 0 9 0;
#P connect 9 0 49 0;
#P fasten 51 0 49 0 545 611 163 611;
#P fasten 50 0 49 0 482 611 163 611;
#P fasten 52 0 49 0 610 611 163 611;
#P fasten 53 0 49 0 676 611 163 611;
#P fasten 54 0 49 0 325 611 163 611;
#P connect 49 0 12 0;
#P connect 15 0 14 0;
#P fasten 16 0 14 0 317 471 190 471;
#P connect 24 0 49 1;
#P connect 17 0 15 1;
#P connect 38 0 49 2;
#P connect 18 0 15 2;
#P connect 19 0 15 3;
#P connect 55 0 49 3;
#P fasten 49 0 70 1 163 725 143 725 143 241 303 241;
#P connect 7 0 6 0;
#P connect 72 0 75 0;
#P connect 20 0 16 1;
#P connect 73 0 72 1;
#P connect 21 0 16 2;
#P connect 74 0 72 2;
#P connect 22 0 16 3;
#P connect 71 0 34 0;
#P connect 69 0 34 0;
#P connect 25 0 24 0;
#P connect 34 0 24 0;
#P fasten 27 0 25 0 621 501 494 501;
#P connect 26 0 25 0;
#P connect 28 0 26 1;
#P connect 35 0 71 0;
#P connect 29 0 26 2;
#P connect 36 0 35 1;
#P connect 30 0 26 3;
#P connect 37 0 35 2;
#P connect 31 0 27 1;
#P connect 32 0 27 2;
#P connect 33 0 27 3;
#P connect 79 0 48 0;
#P connect 69 0 48 0;
#P connect 48 0 38 0;
#P connect 39 0 38 0;
#P connect 76 0 79 0;
#P connect 40 0 39 0;
#P fasten 41 0 39 0 923 500 796 500;
#P connect 77 0 76 1;
#P connect 42 0 40 1;
#P connect 78 0 76 2;
#P connect 43 0 40 2;
#P connect 44 0 40 3;
#P connect 45 0 41 1;
#P connect 46 0 41 2;
#P connect 47 0 41 3;
#P connect 69 0 65 0;
#P connect 66 0 65 0;
#P connect 56 0 55 0;
#P connect 65 0 55 0;
#P fasten 58 0 56 0 1279 499 1152 499;
#P connect 57 0 56 0;
#P connect 59 0 57 1;
#P connect 60 0 57 2;
#P connect 67 0 66 1;
#P connect 61 0 57 3;
#P connect 68 0 66 2;
#P connect 62 0 58 1;
#P connect 63 0 58 2;
#P connect 64 0 58 3;
#P pop;


October 10, 2006 | 11:44 pm

Hi Timothy,
Here’s a start. There seem to be some multitexuring slab issues that
I couldn’t figure out. I’ll look into them later. Anyway, here’s a
patch and a shader. To use the patch, load a video and start
rendering, then enable which video stream should go to the
concatentating shader with the router object. Notice how I don’t have
the 2nd texture hooked up. This is because for some reason it gets
linked to the 3rd one *unless* you start things up and get it rolling
and *then* hook it up. I have no idea why this is right now. Anyway,
here’s the patch and shader. THe shader is called td.glue.jxs. You
may want to modify it to suit your purposes.

wes

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 14 285 13 196617 3;
#P comment 14 268 13 196617 2;
#P comment 14 251 13 196617 1;
#P window linecount 3;
#P comment 54 214 13 196617 w e t;
#P user matrixctrl 33 252 34 51 MatrixDefaultCell.pct
MatrixDefaultBkgnd.pct 34 51 16 16 2 3 16 16 1 1 49 2 0 0;
#P window linecount 1;
#P newex 58 339 57 196617 router 2 3;
#P newex 145 184 81 196617 jit.gl.texture fa;
#P message 38 519 76 196617 file td.glue.jxs;
#P newex 574 407 76 196617 prepend param;
#P flonum 611 364 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 574 364 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 574 384 79 196617 pak offset 1. 1.;
#N vpatcher 30 89 398 451;
#P window setfont "Sans Serif" 9.;
#P newex 50 124 143 196617 jit.gl.slab fa @file td.rota.jxs;
#P flonum 297 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 261 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 225 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 171 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 135 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 99 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 204 183 94 196617 pak bias 0. 0. 0. 0.;
#P newex 77 183 100 196617 pak scale 1. 1. 1. 1.;
#P newex 77 214 76 196617 prepend param;
#P newex 50 279 166 196617 jit.gl.slab fa @file cc.scalebias.jxs;
#P inlet 50 104 15 0;
#P outlet 50 301 15 0;
#P connect 1 0 12 0;
#P connect 12 0 2 0;
#P connect 3 0 2 0;
#P connect 2 0 0 0;
#P connect 4 0 3 0;
#P fasten 5 0 3 0 209 204 82 204;
#P connect 6 0 4 1;
#P connect 7 0 4 2;
#P connect 8 0 4 3;
#P connect 9 0 5 1;
#P connect 10 0 5 2;
#P connect 11 0 5 3;
#P pop;
#P newobj 337 437 46 196617 p Offset;
#P newex 482 407 76 196617 prepend param;
#P flonum 519 364 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 482 364 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 482 384 79 196617 pak offset 1. 1.;
#N vpatcher 30 89 398 451;
#P window setfont "Sans Serif" 9.;
#P newex 50 124 143 196617 jit.gl.slab fa @file td.rota.jxs;
#P flonum 297 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 261 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 225 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 171 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 135 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 99 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 204 183 94 196617 pak bias 0. 0. 0. 0.;
#P newex 77 183 100 196617 pak scale 1. 1. 1. 1.;
#P newex 77 214 76 196617 prepend param;
#P newex 50 279 166 196617 jit.gl.slab fa @file cc.scalebias.jxs;
#P inlet 50 104 15 0;
#P outlet 50 301 15 0;
#P connect 1 0 12 0;
#P connect 3 0 2 0;
#P connect 12 0 2 0;
#P connect 2 0 0 0;
#P fasten 5 0 3 0 209 204 82 204;
#P connect 4 0 3 0;
#P connect 6 0 4 1;
#P connect 7 0 4 2;
#P connect 8 0 4 3;
#P connect 9 0 5 1;
#P connect 10 0 5 2;
#P connect 11 0 5 3;
#P pop;
#P newobj 245 437 46 196617 p Offset;
#P newex 382 407 76 196617 prepend param;
#P flonum 419 364 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 382 364 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 382 384 79 196617 pak offset 1. 1.;
#N vpatcher 30 89 398 451;
#P window setfont "Sans Serif" 9.;
#P newex 50 124 143 196617 jit.gl.slab fa @file td.rota.jxs;
#P flonum 297 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 261 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 225 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 171 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 135 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 99 161 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 204 183 94 196617 pak bias 0. 0. 0. 0.;
#P newex 77 183 100 196617 pak scale 1. 1. 1. 1.;
#P newex 77 214 76 196617 prepend param;
#P newex 50 279 166 196617 jit.gl.slab fa @file cc.scalebias.jxs;
#P inlet 50 104 15 0;
#P outlet 50 301 15 0;
#P connect 1 0 12 0;
#P connect 12 0 2 0;
#P connect 3 0 2 0;
#P connect 2 0 0 0;
#P connect 4 0 3 0;
#P fasten 5 0 3 0 209 204 82 204;
#P connect 6 0 4 1;
#P connect 7 0 4 2;
#P connect 8 0 4 3;
#P connect 9 0 5 1;
#P connect 10 0 5 2;
#P connect 11 0 5 3;
#P pop;
#P newobj 145 437 46 196617 p Offset;
#P newex 145 284 150 196617 jit.gl.slab fa @file co.dodge.jxs;
#P newex 145 313 176 196617 jit.gl.slab fa @file cf.gaussian.2p.jxs;
#P newex 145 549 189 196617 jit.gl.slab fa @file td.glue.jxs @inputs 3;
#P newex 8 169 70 196617 jit.window fa;
#P newex 145 590 182 196617 jit.gl.videoplane fa @scale 1.333 1. 1.;
#P newex 8 147 121 196617 jit.gl.render fa @ortho 2;
#P newex 8 103 58 196617 t b b erase;
#P message 261 99 27 196617 stop;
#P flonum 292 79 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 292 99 42 196617 rate $1;
#P message 183 55 80 196617 read dozer.mov;
#P flonum 49 61 35 9 0.5 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 8 61 15 0;
#P newex 8 82 51 196617 qmetro 2;
#P newex 145 151 144 196617 jit.qt.movie 320 240;
#P window linecount 4;
#P comment 334 282 100 196617 so basically i need to control what
third the feedback is ocuring;
#P window linecount 3;
#P comment 34 214 13 196617 d r y;
#P fasten 30 0 28 2 616 381 647 381;
#P fasten 29 0 28 1 579 381 613 381;
#P fasten 28 0 31 0 579 404 579 404;
#P fasten 25 0 23 2 524 381 555 381;
#P fasten 24 0 23 1 487 381 521 381;
#P fasten 23 0 26 0 487 404 487 404;
#P fasten 20 0 18 2 424 381 455 381;
#P fasten 19 0 18 1 387 381 421 381;
#P fasten 18 0 21 0 387 404 387 404;
#P fasten 31 0 27 0 579 433 342 433;
#P fasten 34 2 27 0 93 393 342 393;
#P connect 27 0 14 2;
#P connect 8 0 7 0;
#P connect 14 0 12 0;
#P fasten 14 0 16 1 150 574 130 574 130 265 290 265;
#P fasten 26 0 22 0 487 433 250 433;
#P fasten 34 1 22 0 78 406 250 406;
#P connect 32 0 14 0;
#P connect 17 0 14 0;
#P fasten 21 0 17 0 387 433 150 433;
#P fasten 34 0 17 0 63 417 150 417;
#P connect 16 0 15 0;
#P fasten 33 0 34 1 150 243 86 243;
#P connect 33 0 16 0;
#P connect 2 0 33 0;
#P fasten 6 0 2 0 188 141 150 141;
#P fasten 9 0 2 0 266 141 150 141;
#P fasten 7 0 2 0 297 141 150 141;
#P fasten 10 1 2 0 37 141 150 141;
#P fasten 15 0 34 2 150 334 109 334;
#P connect 35 0 34 0;
#P connect 5 0 3 1;
#P connect 10 0 11 0;
#P fasten 10 2 11 0 61 129 13 129;
#P connect 3 0 10 0;
#P connect 4 0 3 0;
#P window clipboard copycount 40;

———————-shader———————–


Glue






< ![CDATA[

varying vec2 texcoord0;
//varying vec2 texcoord1;
//varying vec2 texcoord2;
varying vec2 texdim0;
//varying vec2 texdim1;
//varying vec2 texdim2;

void main()
{
// perform standard transform on vertex
gl_Position = ftransform();

// transform texcoords
texcoord0 = vec2(gl_TextureMatrix[0] * gl_MultiTexCoord0);
//texcoord1 = vec2(gl_TextureMatrix[1] * gl_MultiTexCoord1);
//texcoord2 = vec2(gl_TextureMatrix[2] * gl_MultiTexCoord2);

// extract the x and y scalars from the texture matrix to
determine dimensions
texdim0 = vec2 (abs(gl_TextureMatrix[0][0][0]),abs(gl_TextureMatrix[0][1][1]));
//texdim1 = vec2
(abs(gl_TextureMatrix[1][0][0]),abs(gl_TextureMatrix[1][1][1]));
//texdim2 = vec2
(abs(gl_TextureMatrix[2][0][0]),abs(gl_TextureMatrix[2][1][1]));
}

]]>

< ![CDATA[

uniform sampler2DRect tex0;
uniform sampler2DRect tex1;
uniform sampler2DRect tex2;

varying vec2 texcoord0;
//varying vec2 texcoord1;
//varying vec2 texcoord2;
varying vec2 texdim0;
//varying vec2 texdim1;
//varying vec2 texdim2;

uniform vec2 zoom;
uniform vec2 offset;

void main()
{

vec4 final;

if(texcoord0.s < texdim0.x*0.333)
final = texture2DRect(tex0, texcoord0);
else if(texcoord0.s < texdim0.x*0.666)
final = texture2DRect(tex1, texcoord0);
else
final = texture2DRect(tex2, texcoord0);

gl_FragColor = final;
}
]]>



div
October 11, 2006 | 12:27 am

Hi wes,

Looks promising, cheers. Although i am having trouble with the shader.

I saved it as td.glue.jxs

and it didn’t work so i added a couple of lines, in a kind of hack stlye GLSL i guess… didn’t work… I have no idea about GLSL coding

Cheers,

Tim

——

//texcoord1 = vec2(gl_TextureMatrix[1] * gl_MultiTexCoord1);
//texcoord2 = vec2(gl_TextureMatrix[2] * gl_MultiTexCoord2);

// extract the x and y scalars from the texture matrix to
determine dimensions
texdim0 = vec2 (abs(gl_TextureMatrix[0][0][0]),abs(gl_TextureMatrix[0][1][1]));
//texdim1 = vec2
(abs(gl_TextureMatrix[1][0][0]),abs(gl_TextureMatrix[1][1][1]));
//texdim2 = vec2
(abs(gl_TextureMatrix[2][0][0]),abs(gl_TextureMatrix[2][1][1]));
}

]]>

——————

The error i get in the max window is

• error: jit_xml_document: error reading file at byte offset 492 / not well-formed (invalid token)
• error: line (27): >
• error: jit.gl.shader: error reading shader xml file ‘Gustav:/Applications/MaxMSP 4.6/Cycling ’74/jitter-shaders/texdisplace/td.glue.jxs’


October 11, 2006 | 2:05 am



div
October 11, 2006 | 2:23 am

Sorry Wes,

Hmm… Still not sure that it is right

• error: jit_xml_document: error reading file at byte offset 7 / syntax error
• error: line (6): Glue
• error: jit.gl.shader: error reading shader xml file ‘Gustav:/Applications/MaxMSP 4.6/Cycling ’74/jitter-shaders/texdisplace/td.glue.jxs’

This is what i get… in Firefox, Safari and Mail emails…


October 11, 2006 | 2:26 am



div
October 11, 2006 | 2:35 am

Ha! I didn’t get an attachment BUT I recovered it from the source… how strange… I had to find and delete all the
and it works…

Great!

Now…

I will have a play and see what i can do… Thanks! Wes

tim


October 11, 2006 | 2:41 am

Another way which might be faster depending on your hardware is to
render the 3 split textures to 3 aligned videoplanes and render those
to a texture which you then feedback into the slab.

wes

On 10/10/06, Timothy Devine wrote:
>
> Ha! I didn’t get an attachment BUT I recovered it from the source… how strange… I had to find and delete all the
and it works…
>
> Great!
>
> Now…
>
> I will have a play and see what i can do… Thanks! Wes
>
> tim
>



div
October 11, 2006 | 2:44 am

yeah I was thinking about that but have had trouble in the past having multiple videoplanes… I think hardware is not an issue…
I have an new iMac intel duo with 2gb ram and 128 graphics…

tim



div
October 11, 2006 | 3:47 am

yeah… hardware is an issue… three video planes slows it right down…

the td.glue.jxs is very close to what i need to do i think the only thing is that when I move each plane into their thirds they black eachother out… if only they were layered ontop of eachother (depth) 1, 2 and 3 then it might be possible to move them to a position where it might work…

thanks for all your help wes it has been much apprecieated, if you’re ever in melbourne i owe you a beer.


October 11, 2006 | 4:12 am

> thanks for all your help wes it has been much apprecieated, if you’re ever in melbourne i owe you a beer.

Cool. I’m still a little fizzy as to exactly what you’re trying to
do. Here’s what I think you’re trying to do:

-take a video image
-segment it into 3 parts
-feed 1 of the parts back on itself.

I noticed that when you offset the sections, they feed into each other
potentially making the thing blowup (i.e. turn all
white/black/whatever). You can get around this by setting the alpha
channel in the td.glue.jxs shader appropriately. For instance, if you
want to feedback the middle section and the left section is feeding
into it, you may want to do some kind of cross fade with the straight
video so that the feedback isn’t instantaneous. This will require
getting into GLSL a bit. Honestly though, it’s not very hard. Start
with one of the example co.*.jxs shaders. Those are pretty simple and
are pixel shaders (which is what you want to process video with). If
you need help, the GLSL Orange book is the default reference although
I’m personally not too keen on it. If you really want to understand
GLSL, this is the document you need:
http://mat.ucsb.edu/~whsmith/GLSLangSpec.Full.1.10.59.pdf .

Give it a whirl. Here’s a little example

//get the color of the pixel (fragment)
vec4 final = texture2DRect(tex0, texcoord0);

//set the alpha channel to pass if green (luma) is above a threshold
final.a = final.g*float(final.g > thresh);

This second line will look at the green value of the pixel and if it’s
above the ‘thresh’ value, it will pass it. This is exactly the same
as jit.op operation ‘>p’. I think you’ll find alot of flexibility
here and will be able to make your patches faster and more specific to
your needs. The shaders provided with Jitter are great and many, but
I almost never use them straight-up. They need little tweaks here and
there to be perfect. Give it a whirl, it should only take a day or so
of determined work to make decent headway into this stuff. Feel free
to ask any questions and good luck.

wes


Viewing 13 posts - 1 through 13 (of 13 total)