[PD] GEM: Example blend_mode patch.

vade doktorp at mac.com
Mon Apr 4 21:27:08 CEST 2005


Hi.

I looked at the GEM example given and the help that cgc and IOhannes 
gave on the list and came up with this patch that demonstrates the 
different blend mode functions, and puts them in similar terms that 
jitter users might be used to. The patch is attached as a text file at 
the end of the message.

A few more questions to the gem developers:

GEM: Graphics Environment for Multimedia
GEM: ver: 0.90 release
GEM: compiled: May 25 2004

and PD 0.3.8-2.app from Millers site.

1) in the patch below, during rotation not all faces of the cube show 
properly as being transparent. Im aware that when dealing with separate 
geometry during rotation, one has to be aware of rendering order to 
deal with issues during rotation (things behind rendering after things 
upfront have, which looks odd), but should this happen with a single 
object that has an alpha between 1 and 0 ?

2), for certain blending mode combinations, the color object with its 
alpha param between 1 and 0 doesnt seem to take effect. Perhaps its the 
ordering of my gemchain (the GEMglBlendFunc being below the color and 
alpha objects)?

Please let me know, Im curious and I think people are too (At least at 
the workshop this came up from a few people interested in PD, but from 
jitter land).

Thanks again for the prompt replies.



------


#N canvas 502 26 646 579 10;
#X obj 13 40 gemwin;
#X msg 59 9 create;
#X obj 13 13 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
#X msg 111 9 destroy;
#X obj 31 84 gemhead;
#X obj 30 290 alpha;
#X obj 30 246 color;
#X obj 30 310 rotateXYZ;
#X obj 30 186 pix_texture;
#X msg 43 109 auto 1;
#X obj 113 166 t f;
#X obj 96 99 openpanel;
#X msg 96 118 open \$1;
#X obj 30 166 pix_filmYUV;
#X obj 96 83 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
-1;
#X obj 105 149 hsl 128 15 0 1000 0 0 empty empty empty -2 -6 0 8 -262144
-1 -1 0 1;
#X obj 30 519 GEMglBlendFunc;
#X obj 76 486 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10
-262144 -1 -1 1 256;
#X obj 154 486 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10
-262144 -1 -1 0 256;
#X obj 88 212 hsl 128 15 0 100 0 0 empty empty empty -2 -6 0 8 -262144
-1 -1 6100 1;
#X text 96 199 Alpha Vlaue;
#X obj 40 211 * 0.01;
#X obj 68 291 counter 0 360;
#X obj 68 256 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1 1
;
#X obj 68 272 metro 100;
#X text 89 256 Rotate on/off;
#X obj 158 461 GLdefine;
#X msg 233 356 GL_ONE_MINUS_SRC_ALPHA;
#X obj 29 541 cuboid 2 1.5 2;
#X msg 232 238 GL_ONE;
#X msg 231 220 GL_ZERO;
#X msg 234 297 GL_ONE_MINUS_DST_COLOR;
#X msg 234 316 GL_ONE_MINUS_SRC_COLOR;
#X msg 234 276 GL_DST_COLOR;
#X text 272 201 Jitter Mode Equiv;
#X text 305 222 0;
#X text 305 237 1;
#X text 330 258 2;
#X text 331 278 3;
#X text 396 300 4;
#X text 398 318 5;
#X msg 234 337 GL_SRC_ALPHA;
#X text 330 340 6;
#X text 398 357 7;
#X msg 235 378 GL_DST_ALPHA;
#X msg 235 399 GL_ONE_MINUS_DST_ALPHA;
#X text 332 380 8;
#X text 396 402 9;
#X msg 234 421 GL_SRC_ALPHA_SATURATE;
#X text 391 423 10;
#X obj 396 463 GLdefine;
#X msg 471 358 GL_ONE_MINUS_SRC_ALPHA;
#X msg 470 240 GL_ONE;
#X msg 471 258 GL_DST_COLOR;
#X msg 469 222 GL_ZERO;
#X msg 472 299 GL_ONE_MINUS_DST_COLOR;
#X msg 472 318 GL_ONE_MINUS_SRC_COLOR;
#X msg 472 278 GL_DST_COLOR;
#X text 510 203 Jitter Mode Equiv;
#X text 543 224 0;
#X text 543 239 1;
#X msg 472 339 GL_SRC_ALPHA;
#X msg 473 380 GL_DST_ALPHA;
#X msg 473 401 GL_ONE_MINUS_DST_ALPHA;
#X msg 472 423 GL_SRC_ALPHA_SATURATE;
#X obj 153 238 nbx 5 14 -1e+37 1e+37 0 0 empty empty empty 0 -6 0 10
-262144 -1 -1 0.480315 256;
#X msg 233 256 GL_SRC_COLOR;
#X obj 112 46 color;
#X obj 208 33 hsl 128 15 0 100 0 0 empty empty empty -2 -6 0 8 -262144
-1 -1 2800 1;
#X text 216 20 Alpha Vlaue;
#X obj 160 32 * 0.01;
#X msg 40 227 color 1 1 1 \$1;
#X msg 175 74 color 1 1 1 \$1;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X connect 4 0 13 0;
#X connect 5 0 7 0;
#X connect 6 0 5 0;
#X connect 7 0 16 0;
#X connect 8 0 6 0;
#X connect 9 0 13 0;
#X connect 10 0 13 1;
#X connect 11 0 12 0;
#X connect 12 0 13 0;
#X connect 13 0 8 0;
#X connect 13 2 10 0;
#X connect 14 0 11 0;
#X connect 15 0 13 1;
#X connect 16 0 28 0;
#X connect 17 0 16 1;
#X connect 18 0 16 2;
#X connect 19 0 21 0;
#X connect 21 0 71 0;
#X connect 21 0 65 0;
#X connect 22 0 7 2;
#X connect 23 0 24 0;
#X connect 24 0 22 0;
#X connect 26 0 17 0;
#X connect 27 0 26 0;
#X connect 29 0 26 0;
#X connect 30 0 26 0;
#X connect 31 0 26 0;
#X connect 32 0 26 0;
#X connect 33 0 26 0;
#X connect 41 0 26 0;
#X connect 44 0 26 0;
#X connect 45 0 26 0;
#X connect 48 0 26 0;
#X connect 50 0 18 0;
#X connect 51 0 50 0;
#X connect 52 0 50 0;
#X connect 53 0 50 0;
#X connect 54 0 50 0;
#X connect 55 0 50 0;
#X connect 56 0 50 0;
#X connect 57 0 50 0;
#X connect 61 0 50 0;
#X connect 62 0 50 0;
#X connect 63 0 50 0;
#X connect 64 0 50 0;
#X connect 66 0 26 0;
#X connect 67 0 0 0;
#X connect 68 0 70 0;
#X connect 70 0 72 0;
#X connect 71 0 6 0;
#X connect 72 0 67 0;





More information about the Pd-list mailing list