GL trails

May 18, 2006 at 3:34pm

GL trails

Hi, I’m having a problem with GL trails from a moving gridshape that can be created by reducing the gl render object’s erase. I can see the trails no problem when the erase is set to around .02 and when the gridshape is moving without a background, but when I move the gridshape in front of another gridshape the trails disappear.
I incorrectly assumed this was a simple blend_mode issue or something but was informed by c74 support that getting layered render trails to appear would “require some more advanced patching”. I’m not really sure what this patching would involve, so if anyone could point me in the right direction to layer moving gl gridshape trails over inert gl gridshapes I would greatly appreciate it.

Thanks

Phil

#26039
May 19, 2006 at 1:25pm

hi

try
color 1. 1. 1. $1

each
jit.gl.gridshape @blende_nable 1

a

#77354
May 19, 2006 at 6:18pm

Thanks for the response. Adjusting the gridshape’s opacity/blend attribute with the color message does not affect it’s ability to overlay trails over other gridshapes. Please see this example patch:

max v2;
#N vpatcher 150 337 854 823;
#P origin 60 22;
#P window setfont “Sans Serif” 9.;
#P flonum 535 159 35 9 0 0 0 3 0 0 0 102 102 204 222 222 222 0 0 0;
#P flonum 491 159 35 9 0 0 0 3 0 0 0 102 102 204 222 222 222 0 0 0;
#P newex 462 180 99 196617 pak position 0. 0. 0.;
#B color 12;
#P newex 199 69 42 196617 jit.glop;
#P newex 104 33 123 196617 jit.window fxing @fsaa 1;
#P window linecount 3;
#P newex 340 258 367 196617 jit.gl.gridshape fxing @shape plane @auto_material 1 @color 0.5 0.5 0.5 0.5 @scale 0.85 0.85 @texture paneltexture @rotatexyz 0. 0. 180. @depth_enable 1 @blend_enable 1 @blend_mode 6 7 @automatic 0 @position 1. 0. 0.;
#B color 13;
#P flonum 413 160 35 9 0 0 0 3 0 0 0 102 102 204 222 222 222 0 0 0;
#P flonum 369 160 35 9 0 0 0 3 0 0 0 102 102 204 222 222 222 0 0 0;
#P window linecount 1;
#P newex 340 181 99 196617 pak position 0. 0. 0.;
#B color 12;
#P window linecount 3;
#P newex 340 207 331 196617 jit.gl.gridshape fxing @shape sphere @lighting_enable 1 @smooth_shading 1 @color 1. 1. 1. 0.5 @scale 0.1 0.1 0.1 @antialias 1 @depth_enable 1 @blend_enable 1 @blend_mode 6 7 @automatic 0;
#B color 12;
#P window linecount 1;
#P newex 9 35 48 196617 loadbang;
#P newex 9 154 66 196617 t b b b erase;
#P newex 9 125 111 196617 jit.qt.movie 1024 768;
#P toggle 9 66 15 0;
#P newex 9 98 51 196617 qmetro 2;
#P user jit.fpsgui 9 316 60 196617 0;
#P window setfont “Fixedwidth Serif” 10.;
#P newex 9 289 286 1441802 jit.gl.render fxing @erase_color 0. 0. 0. 0.02;
#B color 5;
#P connect 6 0 3 0;
#P connect 3 0 2 0;
#P connect 2 0 4 0;
#P connect 4 0 5 0;
#P connect 5 3 0 0;
#P connect 5 0 0 0;
#P connect 0 0 1 0;
#P connect 8 0 7 0;
#P connect 5 1 7 0;
#P connect 14 0 11 0;
#P connect 5 2 11 0;
#P connect 9 0 8 1;
#P connect 10 0 8 2;
#P connect 15 0 14 1;
#P connect 16 0 14 2;
#P pop;

#77355
May 20, 2006 at 12:45pm

here’s a way to do it with several instances of an object in a jit.gl.sketch and a queue list of
the previous positions.

‘hope it inspires you.

//yac

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P comment 563 518 198 196617 blend value is calulated with this counter;
#P message 599 466 545 196617 -0.086614 -0.606299 -0.023622 -0.590551 0.007874 -0.606299 0.055118
-0.590551 0.086614 -0.590551;
#P newex 598 445 62 196617 prepend set;
#B color 12;
#P number 76 80 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 618 361 187 196617 change trail size (1 means no trail);
#P newex 452 466 27 196617 / 2;
#B color 12;
#P newex 452 445 34 196617 zl len;
#B color 12;
#P number 579 360 35 9 1 0 1 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 579 385 27 196617 * 2;
#P newex 419 104 29 196617 gate;
#B color 12;
#P toggle 419 66 15 0;
#P newex 419 153 67 196617 slide 15. 15.;
#B color 12;
#P newex 419 130 71 196617 drunk 127 20;
#B color 12;
#P newex 493 152 67 196617 slide 15. 15.;
#B color 12;
#P newex 493 129 71 196617 drunk 127 20;
#B color 12;
#P message 521 497 14 196617 1;
#P newex 519 281 89 196617 scale 0 127 -1 1.;
#B color 12;
#P newex 429 281 89 196617 scale 0 127 -1 1.;
#B color 12;
#P user pictslider 429 176 100 100 4 4 4 4 SliderDefaultKnob.pct 0 SliderDefaultBkgnd.pct 0 2163 0
8323072 127 1. 1.;
#P newex 467 539 27 196617 / 5.;
#B color 12;
#P newex 400 564 54 196617 pack f f f;
#B color 12;
#P newex 400 470 47 196617 zl iter 2;
#B color 12;
#P message 400 506 37 196617 $2 $1;
#P newex 400 444 37 196617 zl rev;
#B color 12;
#N counter;
#X flags 0 0;
#P newobj 492 517 66 196617 counter;
#B color 12;
#P newex 492 495 22 196617 b 1;
#B color 12;
#P message 383 644 371 196617 reset , glpushmatrix , gltranslate 0 0 -1 , glcolor 1 0.5 1 1 ,
plane 1 , glpopmatrix;
#P newex 400 542 47 196617 zl iter 2;
#B color 12;
#P message 400 348 153 196617 -0.086614 -0.606299;
#P newex 400 369 38 196617 zl join;
#B color 12;
#P newex 400 416 57 196617 zl slice 10;
#B color 12;
#P number 162 405 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 119 425 70 196617 fullscreen $1;
#P toggle 101 425 15 0;
#P newex 101 406 38 196617 sel 27;
#P newex 101 387 40 196617 key;
#P window linecount 2;
#P message 400 584 351 196617 glpushmatrix , gltranslate $1 $2 0 , glcolor 1 1 1 $3 , sphere
0.1 , glpopmatrix;
#P window linecount 1;
#P newex 101 442 177 196617 jit.window boom @fsaa 1 @floating 1;
#P newex 400 323 66 196617 pak set 0. 0.;
#B color 12;
#P window linecount 2;
#P newex 400 672 326 196617 jit.gl.sketch boom @lighting_enable 1 @smooth_shading 1 @color 1. 1.
1. 1 @antialias 1 @depth_enable 1 @blend_enable 1 @blend_mode 6 7;
#B color 12;
#P window linecount 1;
#P newex 29 18 48 196617 loadbang;
#P newex 29 133 66 196617 t b b b erase;
#P toggle 29 80 15 0;
#P newex 29 100 57 196617 qmetro 20;
#P user jit.fpsgui 29 565 60 196617 0;
#P window linecount 2;
#P newex 29 527 232 196617 jit.gl.render boom @erase_color 0. 0. 0. 1. @doublebuffer 1
@depth_enable 1;
#P window linecount 1;
#P comment 449 64 100 196617 auto_move;
#P connect 5 2 20 0;
#P connect 5 2 37 1;
#P connect 5 2 31 0;
#P connect 16 0 23 0;
#P connect 16 0 17 1;
#P connect 16 0 40 0;
#P connect 16 0 44 0;
#P connect 29 0 8 1;
#P connect 30 0 8 2;
#P connect 11 0 12 0;
#P connect 11 0 15 0;
#P connect 6 0 4 0;
#P connect 6 0 36 0;
#P connect 44 0 45 0;
#P connect 39 0 38 0;
#P connect 31 0 22 2;
#P connect 28 1 30 0;
#P connect 33 0 28 1;
#P connect 22 0 27 0;
#P connect 32 0 33 0;
#P connect 37 0 34 0;
#P connect 37 0 32 0;
#P connect 21 0 22 0;
#P connect 25 0 24 0;
#P connect 25 0 21 0;
#P connect 41 0 27 1;
#P connect 27 0 26 2;
#P connect 40 0 41 0;
#P connect 38 0 16 1;
#P connect 28 0 29 0;
#P connect 35 0 28 0;
#P connect 34 0 35 0;
#P connect 36 0 37 0;
#P connect 10 0 7 0;
#P connect 20 0 7 0;
#P connect 26 0 10 0;
#P connect 19 0 26 0;
#P connect 24 0 19 0;
#P connect 23 0 25 0;
#P connect 17 0 16 0;
#P connect 18 0 17 0;
#P connect 5 1 18 0;
#P connect 8 0 18 0;
#P connect 13 0 14 0;
#P connect 14 0 9 0;
#P connect 12 0 13 0;
#P connect 43 0 3 1;
#P connect 3 0 5 0;
#P connect 4 0 3 0;
#P connect 1 0 2 0;
#P connect 5 0 1 0;
#P connect 5 3 1 0;
#P window clipboard copycount 47;

#77356

You must be logged in to reply to this topic.