Forums > Jitter

move a videoplane with chromakey and why position argument on a slab?

August 12, 2007 | 3:00 am

Hi,

Hopefully someone can help me out with this – or give me a hint of
how best to do it…

I am trying to blue screen (chromakey) a video and place it on a
videoplane – and then "position" the videoplane over another. I can
do this easily with luminance/alpha but can’t figure out how to do it
with chroma – two examples are posted below.

Also, out of curiosity, why is there a "position" argument for a slab?
Is there a way to write a shader to take advantage of position? Just
sending a position message "pak position 0. 0. 0." didn’t have any
effect.

How I’d like to do it:

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 53 118 30 196617 read;
#P toggle 61 33 15 0;
#P newex 61 55 51 196617 qmetro 2;
#P message 447 257 17 196617 1.;
#P message 219 246 31 196617 0.18;
#P newex 219 217 48 196617 loadbang;
#P message 632 246 30 196617 read;
#P newex 632 269 105 196617 jit.qt.movie 320 240;
#P newex 62 78 61 196617 t b b erase;
#P newex 87 168 56 196617 qlim 2500;
#P newex 87 282 76 196617 unpack 0. 0. 0.;
#P window setfont "Fixedwidth Serif" 10.;
#P newex 87 261 92 1441802 vexpr $i1/255.;
#P window setfont "Sans Serif" 9.;
#P newex 87 141 105 196617 jit.qt.movie 320 240;
#P user suckah 87 197 80 61;
#P user jit.pwindow 86 196 82 62 0 0 0 0 1 0;
#P flonum 447 282 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 447 305 85 196617 param binary $1;
#P flonum 366 282 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 366 305 79 196617 param mode $1;
#P flonum 289 282 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 289 305 75 196617 param fade $1;
#P flonum 219 282 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 219 305 68 196617 param tol $1;
#P newex 87 305 130 196617 pak param color 0. 0. 1. 0.;
#P newex 70 419 206 196617 jit.gl.videoplane valente @scale 1.333 1. 1.;
#P newex 112 104 238 196617 jit.gl.render valente @erase_color 0.5 0.5 0.5 1.;
#P newex 70 371 198 196617 jit.gl.slab valente @file co.chromakey.jxs;
#P toggle 372 435 15 0;
#P message 372 453 70 196617 fullscreen $1;
#P newex 357 472 141 196617 jit.window valente @interp 1;
#P window linecount 3;
#P comment 278 366 100 196617 I’d like to move the foreground video
over the background;
#P fasten 23 0 4 1 637 353 263 353;
#P connect 22 1 18 0;
#P connect 22 1 23 0;
#P connect 24 0 23 0;
#P connect 15 0 14 0;
#P connect 27 0 15 0;
#P connect 25 0 26 0;
#P fasten 25 0 27 0 224 241 452 241;
#P connect 3 0 2 0;
#P connect 13 0 12 0;
#P fasten 2 0 1 0 377 470 362 470;
#P connect 11 0 10 0;
#P connect 26 0 9 0;
#P fasten 26 0 11 0 224 274 294 274;
#P fasten 14 0 4 1 452 332 263 332;
#P fasten 12 0 4 1 371 332 263 332;
#P fasten 10 0 4 1 294 332 263 332;
#P fasten 8 0 4 1 224 332 263 332;
#P fasten 7 0 4 1 92 332 263 332;
#P connect 9 0 8 0;
#P fasten 20 2 7 4 158 302 188 302;
#P fasten 20 1 7 3 125 302 164 302;
#P fasten 20 0 7 2 92 302 140 302;
#P fasten 22 0 5 0 67 99 117 99;
#P connect 22 2 5 0;
#P connect 19 0 20 0;
#P connect 17 0 19 0;
#P connect 21 0 16 0;
#P fasten 18 0 4 0 92 163 75 163;
#P connect 18 0 21 0;
#P connect 30 0 18 0;
#P connect 4 0 6 0;
#P connect 28 0 22 0;
#P connect 29 0 28 0;
#P window clipboard copycount 31;

This was a lame attempt:

#P window setfont "Sans Serif" 9.;
#P flonum 388 582 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 351 582 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 314 582 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 285 603 99 196617 pak position 0. 0. 0.;
#P message 470 438 21 196617 0.1;
#P message 425 438 21 196617 0.2;
#P newex 425 415 44 196617 loadbang;
#P newex 303 438 93 196617 unpack 0. 0. 0.;
#P newex 303 415 77 196617 vexpr $i1/255.;
#P message 178 478 41 196617 mode 2;
#P message 135 478 40 196617 mode 1;
#P message 90 478 40 196617 mode 0;
#P flonum 470 457 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 470 478 42 196617 fade $1;
#P flonum 425 458 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 425 478 35 196617 tol $1;
#P flonum 385 458 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 344 458 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 303 458 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 262 458 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 221 478 177 196617 pak color 0. 0. 0. 0.;
#P newex 68 508 116 196617 jit.chromakey @mode 1;
#B color 5;
#P newex 303 329 56 196617 qlim 2500;
#P user suckah 303 350 80 61;
#P user jit.pwindow 302 349 82 62 0 0 0 0 1 0;
#P user jit.fpsgui 28 184 60 196617 0;
#P newex 664 495 160 196617 jit.gl.texture blend @name mov2;
#P newex 720 541 47 196617 r draw2;
#P newex 664 567 249 196617 jit.gl.videoplane blend @blend_enable 1
@automatic 0;
#P newex 29 581 76 196617 append blender;
#P newex 29 558 157 196617 jit.gl.texture blend @name mov1;
#P newex 68 529 264 196617 jit.gl.texture blend @colormode lumalpha
@name blender;
#P newex 85 604 47 196617 r draw1;
#N vpatcher 20 74 179 252;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 48 85 30 196617 t b b;
#P window linecount 1;
#P newex 68 107 47 196617 s draw2;
#P newex 48 129 47 196617 s draw1;
#P newex 24 54 58 196617 t b b erase;
#P inlet 24 34 15 0;
#P outlet 24 85 15 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P fasten 2 2 0 0 77 78 29 78;
#P connect 2 1 5 0;
#P connect 5 0 3 0;
#P connect 5 1 4 0;
#P pop;
#P newobj 29 140 41 196617 p draw;
#P newex 29 630 249 196617 jit.gl.videoplane blend @blend_enable 1 @automatic 0;
#P flonum 860 424 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 860 445 42 196617 rate $1;
#P message 751 424 30 196617 read;
#P message 797 446 27 196617 stop;
#P message 763 446 31 196617 start;
#P flonum 706 425 35 9 0.5 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 664 425 15 0;
#P newex 664 445 52 196617 metro 30;
#P message 827 446 31 196617 clear;
#P newex 664 472 105 196617 jit.qt.movie 320 240;
#P flonum 230 231 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 230 252 42 196617 rate $1;
#P message 116 230 30 196617 read;
#P message 164 252 27 196617 stop;
#P message 130 252 31 196617 start;
#P flonum 71 231 35 9 0.5 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 29 231 15 0;
#P newex 29 251 52 196617 metro 30;
#P message 194 252 31 196617 clear;
#P newex 29 278 105 196617 jit.qt.movie 320 240;
#P toggle 82 100 15 0;
#P message 82 120 68 196617 fullscreen $1;
#N vpatcher 30 89 166 253;
#P window setfont "Sans Serif" 9.;
#P newex 50 71 35 196617 sel 27;
#P newex 50 50 40 196617 key;
#P outlet 50 93 15 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P pop;
#P newobj 82 80 33 196617 p Esc;
#P newex 82 138 84 196617 jit.window blend;
#P toggle 29 73 42 0;
#P newex 29 119 51 196617 qmetro 2;
#P newex 29 165 237 196617 jit.gl.render blend @inherit_transform 2 @ortho 2;
#P comment 777 541 62 196617 Base Image;
#P connect 27 0 26 0;
#P connect 22 0 20 1;
#P fasten 35 0 34 0 725 563 669 563;
#P connect 36 0 34 0;
#P connect 18 0 36 0;
#P fasten 20 0 18 0 669 470 669 470;
#P fasten 19 0 18 0 832 467 669 467;
#P fasten 23 0 18 0 768 467 669 467;
#P fasten 24 0 18 0 802 467 669 467;
#P fasten 25 0 18 0 756 467 669 467;
#P fasten 26 0 18 0 865 467 669 467;
#P connect 21 0 20 0;
#P connect 50 0 49 0;
#P connect 58 0 50 0;
#P connect 56 0 57 0;
#P connect 56 0 58 0;
#P connect 48 0 47 0;
#P connect 57 0 48 0;
#P connect 46 0 42 4;
#P connect 55 2 46 0;
#P connect 62 0 59 3;
#P connect 45 0 42 3;
#P connect 55 1 45 0;
#P connect 61 0 59 2;
#P connect 60 0 59 1;
#P connect 44 0 42 2;
#P connect 55 0 44 0;
#P connect 54 0 55 0;
#P connect 39 0 54 0;
#P connect 40 0 38 0;
#P connect 8 0 32 0;
#P fasten 8 0 41 0 34 468 73 468;
#P fasten 8 0 40 0 34 307 308 307;
#P connect 43 0 42 1;
#P connect 17 0 16 0;
#P connect 6 0 4 0;
#P connect 7 0 6 0;
#P connect 5 0 7 0;
#P connect 12 0 10 1;
#P connect 41 0 31 0;
#P fasten 52 0 41 0 140 498 73 498;
#P fasten 51 0 41 0 95 498 73 498;
#P fasten 49 0 41 0 475 500 73 500;
#P fasten 47 0 41 0 430 500 73 500;
#P fasten 53 0 41 0 183 498 132 498 73 498;
#P fasten 42 0 41 0 226 500 73 500;
#P fasten 59 0 28 0 290 626 34 626;
#P fasten 30 0 28 0 90 626 34 626;
#P connect 33 0 28 0;
#P connect 32 0 33 0;
#P fasten 16 0 8 0 235 273 34 273;
#P fasten 15 0 8 0 121 273 34 273;
#P fasten 14 0 8 0 169 273 34 273;
#P fasten 13 0 8 0 135 273 34 273;
#P fasten 9 0 8 0 199 273 34 273;
#P fasten 10 0 8 0 34 276 34 276;
#P connect 11 0 10 0;
#P connect 29 0 1 0;
#P connect 2 0 29 0;
#P connect 3 0 2 0;
#P connect 1 0 37 0;
#P window clipboard copycount 63;

Thanks,

Bart


August 12, 2007 | 3:15 am

Depending on how much flexibility of movement you want, there are 2 basic ways:

1) Do some image space manipulation using texture coordinate offsets
for the foregound video. For this, you would add an offset parameter
to the chromakey shader and send a message to the slab to move the
image around.

2) Output using mode 1 of the chromakey shader to get just the alpha
channel and use that as a mask for the video by sending both the
original texture and the chromakey generated alpha channel to a
videoplane. If @blend_enable 1 and @depth_enable 0 you can then layer
this on top of the other texture which is also on a videoplane and
move it around in 3D.

wes

On 8/11/07, bart woodstrup wrote:
> Hi,
>
> Hopefully someone can help me out with this – or give me a hint of
> how best to do it…
>
> I am trying to blue screen (chromakey) a video and place it on a
> videoplane – and then "position" the videoplane over another. I can
> do this easily with luminance/alpha but can’t figure out how to do it
> with chroma – two examples are posted below.
>
> Also, out of curiosity, why is there a "position" argument for a slab?
> Is there a way to write a shader to take advantage of position? Just
> sending a position message "pak position 0. 0. 0." didn’t have any
> effect.
>
> How I’d like to do it:
>
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P message 53 118 30 196617 read;
> #P toggle 61 33 15 0;
> #P newex 61 55 51 196617 qmetro 2;
> #P message 447 257 17 196617 1.;
> #P message 219 246 31 196617 0.18;
> #P newex 219 217 48 196617 loadbang;
> #P message 632 246 30 196617 read;
> #P newex 632 269 105 196617 jit.qt.movie 320 240;
> #P newex 62 78 61 196617 t b b erase;
> #P newex 87 168 56 196617 qlim 2500;
> #P newex 87 282 76 196617 unpack 0. 0. 0.;
> #P window setfont "Fixedwidth Serif" 10.;
> #P newex 87 261 92 1441802 vexpr $i1/255.;
> #P window setfont "Sans Serif" 9.;
> #P newex 87 141 105 196617 jit.qt.movie 320 240;
> #P user suckah 87 197 80 61;
> #P user jit.pwindow 86 196 82 62 0 0 0 0 1 0;
> #P flonum 447 282 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 447 305 85 196617 param binary $1;
> #P flonum 366 282 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 366 305 79 196617 param mode $1;
> #P flonum 289 282 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 289 305 75 196617 param fade $1;
> #P flonum 219 282 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 219 305 68 196617 param tol $1;
> #P newex 87 305 130 196617 pak param color 0. 0. 1. 0.;
> #P newex 70 419 206 196617 jit.gl.videoplane valente @scale 1.333 1. 1.;
> #P newex 112 104 238 196617 jit.gl.render valente @erase_color 0.5 0.5 0.5 1.;
> #P newex 70 371 198 196617 jit.gl.slab valente @file co.chromakey.jxs;
> #P toggle 372 435 15 0;
> #P message 372 453 70 196617 fullscreen $1;
> #P newex 357 472 141 196617 jit.window valente @interp 1;
> #P window linecount 3;
> #P comment 278 366 100 196617 I’d like to move the foreground video
> over the background;
> #P fasten 23 0 4 1 637 353 263 353;
> #P connect 22 1 18 0;
> #P connect 22 1 23 0;
> #P connect 24 0 23 0;
> #P connect 15 0 14 0;
> #P connect 27 0 15 0;
> #P connect 25 0 26 0;
> #P fasten 25 0 27 0 224 241 452 241;
> #P connect 3 0 2 0;
> #P connect 13 0 12 0;
> #P fasten 2 0 1 0 377 470 362 470;
> #P connect 11 0 10 0;
> #P connect 26 0 9 0;
> #P fasten 26 0 11 0 224 274 294 274;
> #P fasten 14 0 4 1 452 332 263 332;
> #P fasten 12 0 4 1 371 332 263 332;
> #P fasten 10 0 4 1 294 332 263 332;
> #P fasten 8 0 4 1 224 332 263 332;
> #P fasten 7 0 4 1 92 332 263 332;
> #P connect 9 0 8 0;
> #P fasten 20 2 7 4 158 302 188 302;
> #P fasten 20 1 7 3 125 302 164 302;
> #P fasten 20 0 7 2 92 302 140 302;
> #P fasten 22 0 5 0 67 99 117 99;
> #P connect 22 2 5 0;
> #P connect 19 0 20 0;
> #P connect 17 0 19 0;
> #P connect 21 0 16 0;
> #P fasten 18 0 4 0 92 163 75 163;
> #P connect 18 0 21 0;
> #P connect 30 0 18 0;
> #P connect 4 0 6 0;
> #P connect 28 0 22 0;
> #P connect 29 0 28 0;
> #P window clipboard copycount 31;
>
>
>
> This was a lame attempt:
>
>
>
>
> #P window setfont "Sans Serif" 9.;
> #P flonum 388 582 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 351 582 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 314 582 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P window linecount 1;
> #P newex 285 603 99 196617 pak position 0. 0. 0.;
> #P message 470 438 21 196617 0.1;
> #P message 425 438 21 196617 0.2;
> #P newex 425 415 44 196617 loadbang;
> #P newex 303 438 93 196617 unpack 0. 0. 0.;
> #P newex 303 415 77 196617 vexpr $i1/255.;
> #P message 178 478 41 196617 mode 2;
> #P message 135 478 40 196617 mode 1;
> #P message 90 478 40 196617 mode 0;
> #P flonum 470 457 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 470 478 42 196617 fade $1;
> #P flonum 425 458 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 425 478 35 196617 tol $1;
> #P flonum 385 458 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 344 458 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 303 458 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 262 458 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 221 478 177 196617 pak color 0. 0. 0. 0.;
> #P newex 68 508 116 196617 jit.chromakey @mode 1;
> #B color 5;
> #P newex 303 329 56 196617 qlim 2500;
> #P user suckah 303 350 80 61;
> #P user jit.pwindow 302 349 82 62 0 0 0 0 1 0;
> #P user jit.fpsgui 28 184 60 196617 0;
> #P newex 664 495 160 196617 jit.gl.texture blend @name mov2;
> #P newex 720 541 47 196617 r draw2;
> #P newex 664 567 249 196617 jit.gl.videoplane blend @blend_enable 1
> @automatic 0;
> #P newex 29 581 76 196617 append blender;
> #P newex 29 558 157 196617 jit.gl.texture blend @name mov1;
> #P newex 68 529 264 196617 jit.gl.texture blend @colormode lumalpha
> @name blender;
> #P newex 85 604 47 196617 r draw1;
> #N vpatcher 20 74 179 252;
> #P window setfont "Sans Serif" 9.;
> #P window linecount 0;
> #P newex 48 85 30 196617 t b b;
> #P window linecount 1;
> #P newex 68 107 47 196617 s draw2;
> #P newex 48 129 47 196617 s draw1;
> #P newex 24 54 58 196617 t b b erase;
> #P inlet 24 34 15 0;
> #P outlet 24 85 15 0;
> #P connect 1 0 2 0;
> #P connect 2 0 0 0;
> #P fasten 2 2 0 0 77 78 29 78;
> #P connect 2 1 5 0;
> #P connect 5 0 3 0;
> #P connect 5 1 4 0;
> #P pop;
> #P newobj 29 140 41 196617 p draw;
> #P newex 29 630 249 196617 jit.gl.videoplane blend @blend_enable 1 @automatic 0;
> #P flonum 860 424 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 860 445 42 196617 rate $1;
> #P message 751 424 30 196617 read;
> #P message 797 446 27 196617 stop;
> #P message 763 446 31 196617 start;
> #P flonum 706 425 35 9 0.5 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P toggle 664 425 15 0;
> #P newex 664 445 52 196617 metro 30;
> #P message 827 446 31 196617 clear;
> #P newex 664 472 105 196617 jit.qt.movie 320 240;
> #P flonum 230 231 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P message 230 252 42 196617 rate $1;
> #P message 116 230 30 196617 read;
> #P message 164 252 27 196617 stop;
> #P message 130 252 31 196617 start;
> #P flonum 71 231 35 9 0.5 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P toggle 29 231 15 0;
> #P newex 29 251 52 196617 metro 30;
> #P message 194 252 31 196617 clear;
> #P newex 29 278 105 196617 jit.qt.movie 320 240;
> #P toggle 82 100 15 0;
> #P message 82 120 68 196617 fullscreen $1;
> #N vpatcher 30 89 166 253;
> #P window setfont "Sans Serif" 9.;
> #P newex 50 71 35 196617 sel 27;
> #P newex 50 50 40 196617 key;
> #P outlet 50 93 15 0;
> #P connect 1 0 2 0;
> #P connect 2 0 0 0;
> #P pop;
> #P newobj 82 80 33 196617 p Esc;
> #P newex 82 138 84 196617 jit.window blend;
> #P toggle 29 73 42 0;
> #P newex 29 119 51 196617 qmetro 2;
> #P newex 29 165 237 196617 jit.gl.render blend @inherit_transform 2 @ortho 2;
> #P comment 777 541 62 196617 Base Image;
> #P connect 27 0 26 0;
> #P connect 22 0 20 1;
> #P fasten 35 0 34 0 725 563 669 563;
> #P connect 36 0 34 0;
> #P connect 18 0 36 0;
> #P fasten 20 0 18 0 669 470 669 470;
> #P fasten 19 0 18 0 832 467 669 467;
> #P fasten 23 0 18 0 768 467 669 467;
> #P fasten 24 0 18 0 802 467 669 467;
> #P fasten 25 0 18 0 756 467 669 467;
> #P fasten 26 0 18 0 865 467 669 467;
> #P connect 21 0 20 0;
> #P connect 50 0 49 0;
> #P connect 58 0 50 0;
> #P connect 56 0 57 0;
> #P connect 56 0 58 0;
> #P connect 48 0 47 0;
> #P connect 57 0 48 0;
> #P connect 46 0 42 4;
> #P connect 55 2 46 0;
> #P connect 62 0 59 3;
> #P connect 45 0 42 3;
> #P connect 55 1 45 0;
> #P connect 61 0 59 2;
> #P connect 60 0 59 1;
> #P connect 44 0 42 2;
> #P connect 55 0 44 0;
> #P connect 54 0 55 0;
> #P connect 39 0 54 0;
> #P connect 40 0 38 0;
> #P connect 8 0 32 0;
> #P fasten 8 0 41 0 34 468 73 468;
> #P fasten 8 0 40 0 34 307 308 307;
> #P connect 43 0 42 1;
> #P connect 17 0 16 0;
> #P connect 6 0 4 0;
> #P connect 7 0 6 0;
> #P connect 5 0 7 0;
> #P connect 12 0 10 1;
> #P connect 41 0 31 0;
> #P fasten 52 0 41 0 140 498 73 498;
> #P fasten 51 0 41 0 95 498 73 498;
> #P fasten 49 0 41 0 475 500 73 500;
> #P fasten 47 0 41 0 430 500 73 500;
> #P fasten 53 0 41 0 183 498 132 498 73 498;
> #P fasten 42 0 41 0 226 500 73 500;
> #P fasten 59 0 28 0 290 626 34 626;
> #P fasten 30 0 28 0 90 626 34 626;
> #P connect 33 0 28 0;
> #P connect 32 0 33 0;
> #P fasten 16 0 8 0 235 273 34 273;
> #P fasten 15 0 8 0 121 273 34 273;
> #P fasten 14 0 8 0 169 273 34 273;
> #P fasten 13 0 8 0 135 273 34 273;
> #P fasten 9 0 8 0 199 273 34 273;
> #P fasten 10 0 8 0 34 276 34 276;
> #P connect 11 0 10 0;
> #P connect 29 0 1 0;
> #P connect 2 0 29 0;
> #P connect 3 0 2 0;
> #P connect 1 0 37 0;
> #P window clipboard copycount 63;
>
>
>
> Thanks,
>
> Bart
>


August 12, 2007 | 3:41 am

Also, jit.gl.slab inherits the position attribute (but not rotate and
scale etc.) from being an ob3d (i.e. jit.gl.* ) object. It really
doesn’t apply to a slab though so it has no effect.

wes


August 12, 2007 | 10:49 pm

thx Wes, I got it to work (sort of) using the patch pasted below.
However it only works after I move the jit.window from one computer
monitor to the other. I assume I am missing an attribute somewhere…
When it doesn’t work, the image appears to be just one flickering
pixel that covers the entire window.

intel-mac pro
3 gb ram
256 Nvidia

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 441 326 79 196617 param binary 1;
#P message 87 369 67 196617 getparamlist;
#P newex 258 414 32 196617 print;
#P newex 855 623 38 196617 sel 27;
#P newex 855 600 40 196617 key;
#P user jit.fpsgui 111 131 60 196617 0;
#P newex 87 507 190 196617 jit.gl.slab valente @file cc.alphaglue.jxs;
#P flonum 225 538 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 187 538 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 149 538 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 110 563 99 196617 pak position 0. 0. 0.;
#P newex 604 166 253 196617 jit.gl.videoplane valente @scale 1.333 1.
1. @layer 0;
#P message 53 118 30 196617 read;
#P toggle 61 33 15 0;
#P newex 61 55 51 196617 qmetro 2;
#P message 219 267 31 196617 0.18;
#P newex 219 238 48 196617 loadbang;
#P message 615 122 30 196617 read;
#P newex 604 144 105 196617 jit.qt.movie 320 240;
#P newex 61 78 61 196617 t b b erase;
#P newex 86 192 56 196617 qlim 2500;
#P newex 86 303 76 196617 unpack 0. 0. 0.;
#P window setfont "Fixedwidth Serif" 10.;
#P newex 86 282 92 1441802 vexpr $i1/255.;
#P window setfont "Sans Serif" 9.;
#P newex 86 163 105 196617 jit.qt.movie 320 240;
#P user suckah 86 218 80 61;
#P user jit.pwindow 85 217 82 62 0 0 0 0 1 0;
#P message 366 326 73 196617 param mode 1;
#P flonum 289 303 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 289 326 75 196617 param fade $1;
#P flonum 219 303 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 219 326 68 196617 param tol $1;
#P newex 86 326 130 196617 pak param color 0. 0. 1. 0.;
#P newex 87 587 405 196617 jit.gl.videoplane valente @scale 1.333 1.
1. @blend_enable 1 @depth_enable 0 @layer 1;
#P newex 111 111 101 196617 jit.gl.render valente;
#P newex 70 392 198 196617 jit.gl.slab valente @file co.chromakey.jxs;
#P toggle 855 650 15 0;
#P message 855 670 70 196617 fullscreen $1;
#P newex 855 689 94 196617 jit.window valente;
#P connect 1 0 0 0;
#P connect 2 0 1 0;
#P connect 34 0 2 0;
#P connect 33 0 34 0;
#P connect 19 0 26 0;
#P connect 18 1 14 0;
#P fasten 18 1 19 0 91 99 609 99;
#P connect 20 0 19 0;
#P connect 21 0 22 0;
#P fasten 21 0 11 0 224 262 371 262;
#P fasten 21 0 37 0 224 262 446 262;
#P connect 10 0 9 0;
#P connect 22 0 8 0;
#P fasten 22 0 10 0 224 295 294 295;
#P fasten 3 0 31 1 75 477 272 477;
#P connect 3 1 35 0;
#P fasten 6 0 3 1 91 353 263 353;
#P fasten 7 0 3 1 224 353 263 353;
#P fasten 9 0 3 1 294 353 263 353;
#P fasten 11 0 3 1 371 353 263 353;
#P fasten 37 0 3 1 446 353 263 353;
#P connect 8 0 7 0;
#P fasten 30 0 27 3 230 558 202 558;
#P fasten 16 2 6 4 157 323 187 323;
#P fasten 29 0 27 2 192 558 173 558;
#P fasten 16 1 6 3 124 323 163 323;
#P fasten 28 0 27 1 154 558 144 558;
#P fasten 16 0 6 2 91 323 139 323;
#P connect 4 0 32 0;
#P connect 18 2 4 0;
#P fasten 18 0 4 0 66 99 116 99;
#P fasten 27 0 5 0 115 583 92 583;
#P connect 31 0 5 0;
#P fasten 14 0 3 0 91 184 75 184;
#P connect 14 0 17 0;
#P fasten 14 0 31 0 91 186 46 186 46 497 92 497;
#P connect 15 0 16 0;
#P connect 13 0 15 0;
#P connect 17 0 12 0;
#P fasten 25 0 14 0 58 136 91 136;
#P connect 36 0 3 0;
#P connect 23 0 18 0;
#P connect 24 0 23 0;
#P window clipboard copycount 38;


August 12, 2007 | 10:53 pm

My max window also tells me:

• error: jit.gl.texture: unable to create texture!
jit.gl.pbuffer: error binding texture: GL Error: Invalid operation

…but it’s fairly common for me to see this in the max window -
especially with the slab help/example patches.

Max/Msp 4.6.3
Jitter 1.6.3 rc1

bart


August 12, 2007 | 11:08 pm


August 12, 2007 | 11:34 pm

Ah – I thought I had the latest… it does seems to work okay now.

thx

bbw

On 8/12/07, Wesley Smith wrote:
> I might recommend upgrading to the latest Jitter. This works for me
> perfectly on the latest Jitter with a mac book pro, nvidia 8600 and
> the latest Jitter.Max.
>
> wes
>
> On 8/12/07, bart woodstrup wrote:
> > My max window also tells me:
> >
> > • error: jit.gl.texture: unable to create texture!
> > jit.gl.pbuffer: error binding texture: GL Error: Invalid operation
> >
> > …but it’s fairly common for me to see this in the max window -
> > especially with the slab help/example patches.
> >
> > Max/Msp 4.6.3
> > Jitter 1.6.3 rc1
> >
> >
> > bart
> >
> >
>
>


August 13, 2007 | 12:52 am

Wesley Smith wrote:
>
> 2) Output using mode 1 of the chromakey shader to get just the alpha
> channel and use that as a mask for the video by sending both the
> original texture and the chromakey generated alpha channel to a
> videoplane.

Hi,
Do you mean it is possible to create the alpha channel for the video
directly on the videoplane, without using a solution like
jit.unpack/jit.pack to create the mask for the video?

This is a quick patch that shows what i used to do so far… is there a
better solution?

Thanks
Marco

———

#P window setfont Verdana 10.;
#P window linecount 2;
#N vpatcher 480 411 953 759;
#P window setfont Verdana 10.;
#P newex 125 79 51 13565962 b 2;
#P newex 125 43 62 13565962 loadbang;
#P newex 50 96 26 13565962 b 1;
#P message 166 106 173 13565962 brgb 0 0 0 , frgb 255 255 255;
#P newex 50 198 66 13565962 jit.unpack;
#P message 125 133 260 13565962 clear , paintrect 20 100 186 175 255
255 255;
#P newex 50 166 127 13565962 jit.lcd 4 char 320 240;
#P inlet 50 39 15 0;
#P outlet 64 259 15 0;
#P connect 1 0 6 0;
#P connect 6 0 2 0;
#P connect 5 0 2 0;
#P connect 3 0 2 0;
#P connect 2 0 4 0;
#P connect 4 1 0 0;
#P connect 7 0 8 0;
#P connect 8 0 3 0;
#P connect 8 1 5 0;
#P pop;
#P newobj 578 279 89 13565962 p p.create-alpha;
#P window linecount 1;
#P newex 578 242 286 13565962 jit.unpack;
#P flonum 876 159 35 10 0 0 0 207 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 827 159 35 10 0 0 0 207 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 778 159 35 10 0 0 0 207 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 729 182 157 13565962 pak position 0. 0. 0.1;
#P window linecount 2;
#P newex 578 368 268 13565962 jit.gl.videoplane mainout @scale 1.333 1.
1. @layer 1 @position 0. 0. 0.1 @blend_enable 1;
#P window linecount 1;
#P message 595 152 35 13565962 read;
#P newex 578 189 123 13565962 jit.qt.movie 320 240;
#P newex 154 155 82 13565962 t b erase b b;
#P toggle 154 103 15 0;
#P newex 154 127 68 13565962 qmetro 40;
#P message 311 148 35 13565962 read;
#P newex 287 189 123 13565962 jit.qt.movie 320 240;
#P newex 287 368 257 13565962 jit.gl.videoplane mainout @scale 1.333 1. 1.;
#P window linecount 2;
#P newex 154 273 117 13565962 jit.window mainout @depthbuffer 1;
#P window linecount 3;
#P newex 154 203 77 13565962 jit.gl.render mainout @ortho 2;
#P window linecount 1;
#P newex 578 324 219 13565962 jit.pack;
#P user panel 719 140 207 87;
#X brgb 255 240 157;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P fasten 16 0 13 3 881 177 881 177;
#P connect 15 0 13 2;
#P connect 17 3 1 3;
#P connect 14 0 13 1;
#P connect 17 2 1 2;
#P connect 17 1 1 1;
#P connect 13 0 12 0;
#P connect 1 0 12 0;
#P connect 18 0 1 0;
#P connect 17 0 18 0;
#P connect 10 0 17 0;
#P connect 11 0 10 0;
#P fasten 9 3 10 0 231 179 583 179;
#P connect 5 0 4 0;
#P connect 6 0 5 0;
#P fasten 9 2 5 0 207 184 292 184;
#P connect 9 0 2 0;
#P connect 9 1 2 0;
#P connect 7 0 9 0;
#P connect 8 0 7 0;
#P window clipboard copycount 19;


August 13, 2007 | 1:05 am

Yes, here’s an example:

wes

#P window setfont Verdana 10.;
#P window linecount 1;
#P newex 633 437 43 472055818 zl join;
#P newex 639 404 115 472055818 route jit_gl_texture;
#P newex 501 380 128 472055818 jit.gl.texture mainout;
#P newex 638 379 256 472055818 jit.gl.texture mainout @colormode lumalpha;
#P window linecount 2;
#N vpatcher 480 411 953 759;
#P window setfont "Sans Serif" 9.;
#P newex 50 192 129 196617 jit.matrix 2 char 320 240;
#P window setfont Verdana 10.;
#P newex 125 79 51 472055818 b 2;
#P newex 125 43 62 472055818 loadbang;
#P newex 50 96 26 472055818 b 1;
#P message 166 106 173 472055818 brgb 0 0 0 , frgb 255 255 255;
#P message 125 133 260 472055818 clear , paintrect 20 100 186 175 255 255 255;
#P newex 50 166 127 472055818 jit.lcd 4 char 320 240;
#P inlet 50 39 15 0;
#P outlet 50 218 15 0;
#P connect 1 0 5 0;
#P connect 3 0 2 0;
#P connect 4 0 2 0;
#P connect 5 0 2 0;
#P connect 2 0 8 0;
#P connect 8 0 0 0;
#P connect 6 0 7 0;
#P connect 7 0 3 0;
#P connect 7 1 4 0;
#P pop;
#P newobj 638 339 89 472055818 p p.create-alpha;
#P flonum 936 219 35 10 0 0 0 7203 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 887 219 35 10 0 0 0 7203 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 838 219 35 10 0 0 0 7203 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P newex 789 242 157 472055818 pak position 0. 0. 0.1;
#P window linecount 2;
#P newex 632 464 268 472055818 jit.gl.videoplane mainout @scale 1.333
1. 1. @layer 1 @position 0. 0. 0.1 @blend_enable 1;
#P window linecount 1;
#P message 655 212 35 472055818 read;
#P newex 638 249 123 472055818 jit.qt.movie 320 240;
#P newex 214 215 82 472055818 t b erase b b;
#P toggle 214 163 15 0;
#P newex 214 187 68 472055818 qmetro 40;
#P message 371 208 35 472055818 read;
#P newex 347 249 123 472055818 jit.qt.movie 320 240;
#P newex 347 428 257 472055818 jit.gl.videoplane mainout @scale 1.333 1. 1.;
#P window linecount 2;
#P newex 214 333 117 472055818 jit.window mainout @depthbuffer 1;
#P window linecount 3;
#P newex 214 263 77 472055818 jit.gl.render mainout @ortho 2;
#P user panel 779 200 207 87;
#X brgb 255 240 157;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 16 0 17 0;
#P connect 17 0 19 0;
#P connect 12 0 11 0;
#P connect 20 0 11 0;
#P connect 19 0 20 1;
#P connect 18 0 20 0;
#P connect 9 0 18 0;
#P connect 9 0 16 0;
#P connect 7 0 6 0;
#P connect 6 0 8 0;
#P connect 8 1 1 0;
#P connect 8 0 1 0;
#P fasten 8 2 4 0 267 244 352 244;
#P connect 5 0 4 0;
#P connect 4 0 3 0;
#P fasten 8 3 9 0 291 239 643 239;
#P connect 10 0 9 0;
#P connect 13 0 12 1;
#P connect 14 0 12 2;
#P fasten 15 0 12 3 941 237 941 237;
#P window clipboard copycount 21;


August 13, 2007 | 2:15 am

Hi,

Do you suggest to use zl join to send a message like "jit_gl_texture
[name] [name]" to the videoplane?

I tried your patch, but I’m not sure I can make it working the right
way: i get a video in the background (the first videoplane) and a second
videoplane with a black square (the alpha channel that is created with
the subpatch p.create.alpha)… so, why the "zl join"?

M.

Wesley Smith wrote:
> Yes, here’s an example:
>
> wes
>
>
> #P window setfont Verdana 10.;
> #P window linecount 1;
> #P newex 633 437 43 472055818 zl join;
> #P newex 639 404 115 472055818 route jit_gl_texture;
> #P newex 501 380 128 472055818 jit.gl.texture mainout;
> #P newex 638 379 256 472055818 jit.gl.texture mainout @colormode lumalpha;
> #P window linecount 2;
> #N vpatcher 480 411 953 759;
> #P window setfont "Sans Serif" 9.;
> #P newex 50 192 129 196617 jit.matrix 2 char 320 240;
> #P window setfont Verdana 10.;
> #P newex 125 79 51 472055818 b 2;
> #P newex 125 43 62 472055818 loadbang;
> #P newex 50 96 26 472055818 b 1;
> #P message 166 106 173 472055818 brgb 0 0 0 , frgb 255 255 255;
> #P message 125 133 260 472055818 clear , paintrect 20 100 186 175 255 255 255;
> #P newex 50 166 127 472055818 jit.lcd 4 char 320 240;
> #P inlet 50 39 15 0;
> #P outlet 50 218 15 0;
> #P connect 1 0 5 0;
> #P connect 3 0 2 0;
> #P connect 4 0 2 0;
> #P connect 5 0 2 0;
> #P connect 2 0 8 0;
> #P connect 8 0 0 0;
> #P connect 6 0 7 0;
> #P connect 7 0 3 0;
> #P connect 7 1 4 0;
> #P pop;
> #P newobj 638 339 89 472055818 p p.create-alpha;
> #P flonum 936 219 35 10 0 0 0 7203 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 887 219 35 10 0 0 0 7203 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 838 219 35 10 0 0 0 7203 0 0 0 221 221 221 222 222 222 0 0 0;
> #P window linecount 1;
> #P newex 789 242 157 472055818 pak position 0. 0. 0.1;
> #P window linecount 2;
> #P newex 632 464 268 472055818 jit.gl.videoplane mainout @scale 1.333
> 1. 1. @layer 1 @position 0. 0. 0.1 @blend_enable 1;
> #P window linecount 1;
> #P message 655 212 35 472055818 read;
> #P newex 638 249 123 472055818 jit.qt.movie 320 240;
> #P newex 214 215 82 472055818 t b erase b b;
> #P toggle 214 163 15 0;
> #P newex 214 187 68 472055818 qmetro 40;
> #P message 371 208 35 472055818 read;
> #P newex 347 249 123 472055818 jit.qt.movie 320 240;
> #P newex 347 428 257 472055818 jit.gl.videoplane mainout @scale 1.333 1. 1.;
> #P window linecount 2;
> #P newex 214 333 117 472055818 jit.window mainout @depthbuffer 1;
> #P window linecount 3;
> #P newex 214 263 77 472055818 jit.gl.render mainout @ortho 2;
> #P user panel 779 200 207 87;
> #X brgb 255 240 157;
> #X frgb 0 0 0;
> #X border 1;
> #X rounded 0;
> #X shadow 0;
> #X done;
> #P connect 16 0 17 0;
> #P connect 17 0 19 0;
> #P connect 12 0 11 0;
> #P connect 20 0 11 0;
> #P connect 19 0 20 1;
> #P connect 18 0 20 0;
> #P connect 9 0 18 0;
> #P connect 9 0 16 0;
> #P connect 7 0 6 0;
> #P connect 6 0 8 0;
> #P connect 8 1 1 0;
> #P connect 8 0 1 0;
> #P fasten 8 2 4 0 267 244 352 244;
> #P connect 5 0 4 0;
> #P connect 4 0 3 0;
> #P fasten 8 3 9 0 291 239 643 239;
> #P connect 10 0 9 0;
> #P connect 13 0 12 1;
> #P connect 14 0 12 2;
> #P fasten 15 0 12 3 941 237 941 237;
> #P window clipboard copycount 21;
>
>


August 13, 2007 | 2:23 am

On 8/12/07, marco lorenzin wrote:
> Hi,
>
> Do you suggest to use zl join to send a message like "jit_gl_texture
> [name] [name]" to the videoplane?
>

Do it however you feel is convenient.

> I tried your patch, but I’m not sure I can make it working the right
> way: i get a video in the background (the first videoplane) and a second
> videoplane with a black square (the alpha channel that is created with
> the subpatch p.create.alpha)… so, why the "zl join"?
>

Because it was easy to do. When I do it, I see a video in the
background and a subregion of a video in the foreground made from the
alpha mask.

wes


August 13, 2007 | 4:03 am

Wesley Smith wrote:
>When I do it, I see a video in the
> background and a subregion of a video in the foreground made from the
> alpha mask.

Sorry, it didn’t work with my Windows XP, jitter 1.6.2 version. I’ve
tried your patch with a mac, latest jitter, and it works great!
To justify myself, i can only say that multi-texturing is still an
obscure and mysterious place for me!

Wes, thanks a lot for your suggestion.

M.


August 13, 2007 | 4:10 am

There’s one (or two) assumption(s) I was making that might cause problems.

1) In creating the alpha channel, I blindly send the jit.lcd output to
a 2 plane jitter matrix hoping it convert it properly. What you need
is a 2 plane matrix with the image in both planes. The alpha channel,
which is probably all white, could be getting through on windows but
not on the mac.

2) I let the deafult multitexturing stuff do its thing with the
videoplane. For more precise and protable results, use a shader or
slab to blend the 2 images together.

wes

On 8/12/07, marco lorenzin wrote:
> Wesley Smith wrote:
> >When I do it, I see a video in the
> > background and a subregion of a video in the foreground made from the
> > alpha mask.
>
> Sorry, it didn’t work with my Windows XP, jitter 1.6.2 version. I’ve
> tried your patch with a mac, latest jitter, and it works great!
> To justify myself, i can only say that multi-texturing is still an
> obscure and mysterious place for me!
>
> Wes, thanks a lot for your suggestion.
>
> M.
>
>


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