silhouette alpha

Mar 28, 2010 at 10:01am

silhouette alpha

Hi.
Little problem:
i'd like to display jit.gl.text2D behind a silhouette (from jit.qt.grab).
So i make a alpha mask wich i want to control with my silhouette (jit.alphablend).

But the layer is still black………

Here's my png mask, and my patch:

max v2;
#N vpatcher 0 44 1680 1046;
#P window setfont “Sans Serif” 9.;
#P comment 911 461 76 196617 My alpha mask;
#P user jit.pwindow 434 572 82 62 0 1 0 0 1 0;
#P message 582 690 53 196617 enable $1;
#P newex 439 550 64 196617 jit.rgb2luma;
#B color 5;
#P message 764 511 30 196617 read;
#P newex 1166 732 249 196617 jit.gl.text2d test @color 1 0 0 1 @position -1.2 0. 0.;
#P newex 1397 354 53 196617 sel 32 27;
#P objectname [8];
#P message 912 476 103 196617 read calque_noir.png;
#P newex 758 574 66 196617 jit.unpack 4;
#P objectname
[6];
#P newex 758 552 63 196617 jit.qt.movie;
#P objectname
[5];
#P newex 642 624 126 196617 jit.pack 4;
#P objectname
[4];
#P newex 679 660 70 196617 jit.alphablend;
#P objectname
[3];
#P newex 660 98 300 196617 t b b b b b b b b b b b b b b b b b b b b b b erase;
#P objectname
[2];
#P newex 713 408 89 196617 jit.op @op absdiff;
#P objectname
[1];
#P newex 761 373 36 196617 zl reg;
#P newex 589 314 56 196617 jit.qt.grab;
#P newex 661 71 57 196617 qmetro 33;
#P message 567 290 30 196617 open;
#P toggle 623 63 15 0;
#P newex 692 705 384 196617 jit.gl.videoplane test @blend_enable 1 @color 1. 1. 1. 1. @depth_enable 0 @layer 1;
#P newex 659 123 86 196617 jit.gl.render test;
#P newex 1297 495 268 196617 jit.window test @floating 1 @fsmenubar 0 @pos 200 600;
#P newex 1397 335 40 196617 key;
#P message 1166 711 376 196617 text “Maitre corbeau sur son arbre perché tenez en son bec un fromage” , size 50;
#P toggle 577 674 15 0;
#P newex 1166 686 48 196617 loadbang;
#P comment 1372 314 192 196617 press space bar to substract background;
#P toggle 1435 442 15 0;
#P message 1433 463 70 196617 fullscreen $1;
#P objectname
;
#P connect 25 0 27 0;
#P connect 15 0 25 0;
#P connect 4 0 26 0;
#P connect 16 21 13 0;
#P connect 11 0 13 0;
#P connect 25 0 18 0;
#P connect 16 0 8 0;
#P connect 16 22 8 0;
#P connect 12 0 16 0;
#P connect 10 0 12 0;
#P connect 18 0 17 0;
#P connect 20 1 18 1;
#P connect 17 0 9 0;
#P connect 26 0 9 0;
#P connect 13 0 15 0;
#P connect 20 2 18 2;
#P connect 20 3 18 3;
#P connect 24 0 19 0;
#P connect 16 2 19 0;
#P connect 21 0 19 0;
#P connect 19 0 20 0;
#P connect 22 0 14 0;
#P connect 13 0 14 1;
#P connect 14 0 15 1;
#P connect 3 0 5 0;
#P connect 5 0 23 0;
#P connect 0 0 7 0;
#P connect 6 0 22 0;
#P connect 1 0 0 0;
#P connect 22 1 1 0;
#P pop;

[attachment=128361,288]

Attachments:
  1. calque_noir.png
#49384
Mar 28, 2010 at 10:01am

Thx in advance.
Ad.

#177438
Mar 29, 2010 at 5:21pm

nobody knows about that ?

#177439
Mar 29, 2010 at 6:25pm

i think you need to use @blend_mode 6 1 on your videoplane, although i’m not entirely sure why the default mode of 6 7 is not working.

#177440
Mar 29, 2010 at 7:44pm

I’ve made several tests and still the same problem:

The alpha channel from png is not reconize with jit.alphablend !!

10.5 Max 4.6 and Max 5.
mac book pro.

Ad.

#177441
Mar 31, 2010 at 6:51pm

I don’t think jit.alphablend does what you think it does. It’s purpose is to blend 2 inputs together based on an alpha channel, and will essentially strip off any alpha information on output. Try removing it from the patch and connecting directly from the jit.pack to jit.gl.videoplane.

#177442

You must be logged in to reply to this topic.