Forums > Jitter

idiot gl blending question

April 16, 2006 | 6:31 am

So I’ve got two qt’s or tiffs with alpha channels. And I want to use the alpha channels as clipping maps for videoplanes.

So I have transparent areas of one video plane that show the the other videoplane or background playing behind it.

Simple. Yes?

I know I have to use the blend_mode attribute but I’m obviously missing something.

Can someone point out the obvious to me?

The patch is setup to accept two tiffs or qts with alpha channels.

#P window setfont "Sans Serif" 9.;
#P number 152 335 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P message 156 370 49 196617 ortho $1;
#P toggle 610 160 15 0;
#P message 615 189 68 196617 depth_enable;
#P newex 491 154 71 196617 prepend color;
#P newex 492 121 61 196617 pak 0 0 0 0;
#P flonum 608 82 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 569 82 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 530 82 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 491 82 35 9 0. 1. 3 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 692 55 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 652 92 43 196617 pak 0 0;
#P number 651 57 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 1051 148 38 196617 pos z;
#P flonum 1049 168 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 838 150 38 196617 pos z;
#P flonum 836 170 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 1093 151 38 196617 scale;
#P comment 1010 148 38 196617 pos y;
#P flonum 1092 171 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 1040 224 87 196617 pak scale 0. 0. 1.;
#P flonum 1008 168 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 968 168 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 940 224 95 196617 pak position 0. 0. 0.;
#P newex 954 65 43 196617 r movie;
#P message 1001 65 28 196617 read;
#P newex 954 100 105 196617 jit.qt.movie 768 768;
#B color 5;
#P newex 939 257 191 196617 jit.gl.videoplane booter @blend_enable 1;
#P comment 968 148 38 196617 pos x;
#P comment 56 28 37 196617 y;
#P newex 320 133 82 196617 jit.gl.videoplane;
#P comment 879 150 38 196617 scale;
#P comment 797 150 38 196617 pos y;
#P flonum 878 170 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 827 226 87 196617 pak scale 0. 0. 1.;
#P flonum 795 170 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 755 170 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 727 226 95 196617 pak position 0. 0. 0.;
#P newex 741 67 43 196617 r movie;
#P message 788 67 28 196617 read;
#P newex 741 102 105 196617 jit.qt.movie 768 768;
#B color 5;
#P newex 726 259 191 196617 jit.gl.videoplane booter @blend_enable 1;
#P comment 755 150 38 196617 pos x;
#P newex 19 431 141 196617 jit.gl.render booter @ortho 2;
#P newex 61 255 43 196617 s movie;
#P user jit.fpsgui 43 278 60 196617 0;
#P newex 7 199 43 196617 jit.qball;
#P number 52 150 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 7 150 15 0;
#P newex 7 176 55 196617 metro 20;
#P newex 7 230 64 196617 t b erase b b;
#P number 55 46 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 20 46 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 5 68 84 196617 pak pos 160 120;
#P newex 5 96 287 196617 jit.window booter @depthbuffer 1 @size 768 192 @floating 1;
#P comment 16 488 100 196617 black bg;
#P comment 93 47 100 196617 move window;
#P comment 18 28 37 196617 x;
#P message 649 124 77 196617 blend_mode $1;
#P connect 39 0 38 3;
#P connect 39 0 38 2;
#P connect 39 0 38 1;
#P connect 44 0 35 3;
#P hidden fasten 37 0 35 2 1013 219 1001 219;
#P connect 36 0 35 1;
#P hidden fasten 33 0 32 0 1006 91 959 91;
#P hidden connect 34 0 32 0;
#P connect 32 0 31 0;
#P hidden connect 35 0 31 0;
#P hidden fasten 38 0 31 0 1045 248 944 248;
#P connect 0 0 31 0;
#P connect 55 0 17 0;
#P connect 55 0 31 0;
#P connect 25 0 24 3;
#P connect 25 0 24 2;
#P connect 25 0 24 1;
#P connect 42 0 21 3;
#P hidden fasten 23 0 21 2 800 221 788 221;
#P connect 22 0 21 1;
#P hidden connect 20 0 18 0;
#P hidden fasten 19 0 18 0 793 93 746 93;
#P hidden fasten 24 0 17 0 832 250 731 250;
#P hidden connect 21 0 17 0;
#P connect 18 0 17 0;
#P connect 0 0 17 0;
#P connect 54 0 17 0;
#P connect 48 0 47 1;
#P connect 46 0 47 0;
#P connect 47 0 0 0;
#P connect 56 0 55 0;
#P connect 52 0 53 3;
#P connect 51 0 53 2;
#P connect 50 0 53 1;
#P connect 49 0 53 0;
#P connect 53 0 54 0;
#P connect 58 0 57 0;
#P fasten 7 0 5 2 60 64 84 64;
#P connect 8 3 14 0;
#P connect 11 0 9 1;
#P connect 8 2 13 0;
#P fasten 6 0 5 1 25 64 47 64;
#P connect 8 1 15 0;
#P connect 8 0 15 0;
#P connect 57 0 15 0;
#P connect 12 0 8 0;
#P connect 9 0 12 0;
#P connect 10 0 9 0;
#P connect 5 0 4 0;
#P window clipboard copycount 59;


April 16, 2006 | 3:03 pm

Your patch works for me with depth_enable 0. Note that we don’t want
to clip based on depth testing (as demonstrated in the
jit.gl.videoplane-xfade.pat example). Using depth testing (which is
on by default) will only render one video plane in your patch since
the video planes are both at the same distance from the camera.

The other thing worth noting is that right to left order is not
maintained necessarily with send recieve, so the other possibility
is that your left movie (which looks like the one you are assuming to
have alpha) renders first, and that the right movie renders second
(with no alpha, overlaying over the image). You will want to use
either two instances of send/receive (as demonstrated in
jit.gl.videoplane-example.pat) or use one receive with trigger to
force sequencing.

Lastly, you’ll want to turn automatic off as demonstrated in as
demonstrated in jit.gl.videoplane-example.pat.

-Joshua


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