Multiple Particle Systems Emitting 3D Primitives

Apr 27, 2006 at 4:35am

Multiple Particle Systems Emitting 3D Primitives

Hi,

I dont understand why I can not get Multiple Particle Systems Emitting 3D Primitives working in Jitter. I can not find any information in the Help (html or otherwise) that states how to do it. See code below… If I only connect one particle system, lets say the right one, it renders correctly. If I connect the left one it(left one) does not render the primitive but the right one still works. With the left one connected, if I disconnect the right one I get nothing until I save, close the patch and open it again then the left works correctly.

Here is a test patch borrowed from other posts in the forums with me adding the primitive stuff…

max v2;
#N vpatcher 333 53 1000 670;
#P origin 336 103;
#P window setfont “Sans Serif” 9.;
#P newex 170 247 100 196617 jit.split @splitdim 1;
#P window linecount 2;
#P newex 302 460 350 196617 jit.gl.gridshape particles @shape sphere @depth_enable 1 @smooth_shading 1 @lighting_enable 1 @scale 0.07 0.07 0.07 @automatic 0 @displaylist 1;
#P window linecount 1;
#P message 459 431 90 196617 position $1 $2 $3;
#P message 302 431 111 196617 color 0. 0. $1 1. , bang;
#P newex 302 407 139 196617 expr 1. – ((65. – $f1) / 65.);
#P newex 302 380 167 196617 zl slice 1;
#P newex 302 353 41 196617 jit.iter;
#P newex 302 326 53 196617 jit.pack 4;
#P newex 288 291 80 196617 jit.unpack 5;
#P newex -253 256 100 196617 jit.split @splitdim 1;
#P window linecount 2;
#P newex -121 469 350 196617 jit.gl.gridshape particles @shape sphere @depth_enable 1 @smooth_shading 1 @lighting_enable 1 @scale 0.07 0.07 0.07 @automatic 0 @displaylist 1;
#P window linecount 1;
#P message 36 440 90 196617 position $1 $2 $3;
#P message -121 440 111 196617 color $1 0. 0. 1. , bang;
#P newex -121 416 139 196617 expr 1. – ((65. – $f1) / 65.);
#P newex -121 389 167 196617 zl slice 1;
#P newex -121 362 41 196617 jit.iter;
#P newex -121 335 53 196617 jit.pack 4;
#P newex -135 300 80 196617 jit.unpack 5;
#P newex -192 207 206 196617 jit.matrix 3 float32 1000 @planemap 2 3 4;
#P newex -192 228 354 196617 jit.gl.mesh particles @draw_mode points @color 1. 0.4 0.4 1. @point_size 5;
#P newex -168 178 80 196617 jit.matrix point;
#P newex 8 119 110 196617 pak force 0. 0. 0.;
#P newex 11 76 100 196617 pak pos 0. 0. 0.;
#P flonum 110 100 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 59 100 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 8 100 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 115 57 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 63 57 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 13 58 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex -190 149 172 196617 jit.p.vishnu @pitch 0.1 @yaw 0.1;
#P newex -190 108 155 196617 jit.p.shiva @life 20 @emit 10;
#P newex -190 86 149 196617 jit.matrix point 5 float32 25 2;
#P newex 249 169 85 196617 jit.matrix points;
#P newex -305 585 101 196617 jit.window particles;
#P newex 427 117 110 196617 pak force 0. 0. 0.;
#P newex 430 74 100 196617 pak pos 0. 0. 0.;
#P flonum 529 98 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 478 98 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 427 98 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 534 55 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 482 55 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 432 56 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 229 147 172 196617 jit.p.vishnu @pitch 0.1 @yaw 0.1;
#P newex 229 106 143 196617 jit.p.shiva @life 60 @emit 10;
#P newex -306 559 221 196617 jit.gl.render particles @erase_color 0. 0. 0. 1.;
#P newex -306 -8 66 196617 t erase b b b;
#P newex 229 192 206 196617 jit.matrix 3 float32 1000 @planemap 2 3 4;
#P newex 229 84 154 196617 jit.matrix points 5 float32 25 2;
#P newex -306 -35 75 196617 qmetro 30;
#P toggle -307 -77 40 0;
#P newex 229 213 354 196617 jit.gl.mesh particles @draw_mode points @color 0.4 1. 0.4 1. @point_size 5;
#P connect 1 0 2 0;
#P connect 2 0 5 0;
#P fasten 5 1 6 0 -283 142 -301 142;
#P connect 5 0 6 0;
#P connect 21 0 32 0;
#P connect 32 0 31 0;
#P fasten 5 2 19 0 -265 66 -185 66;
#P connect 19 0 20 0;
#P connect 28 0 21 0;
#P connect 20 0 21 0;
#P connect 29 0 21 0;
#P connect 21 0 30 0;
#P connect 41 0 33 0;
#P connect 33 1 34 0;
#P connect 34 0 35 0;
#P connect 35 0 36 0;
#P connect 36 0 37 0;
#P connect 37 0 38 0;
#P fasten 39 0 40 0 41 462 -116 462;
#P connect 38 0 40 0;
#P connect 33 2 34 1;
#P connect 33 3 34 2;
#P connect 33 4 34 3;
#P connect 36 1 39 0;
#P fasten 22 0 28 1 18 74 46 74;
#P fasten 25 0 29 1 13 117 46 117;
#P fasten 23 0 28 2 68 74 76 74;
#P fasten 26 0 29 2 64 117 79 117;
#P fasten 24 0 28 3 120 74 106 74;
#P fasten 27 0 29 3 115 117 112 117;
#P connect 8 0 50 0;
#P fasten 5 3 3 0 -247 34 234 34;
#P connect 3 0 7 0;
#P connect 16 0 8 0;
#P connect 15 0 8 0;
#P connect 7 0 8 0;
#P connect 8 0 4 0;
#P connect 4 0 0 0;
#P connect 8 0 18 0;
#P connect 50 0 42 0;
#P connect 42 1 43 0;
#P connect 43 0 44 0;
#P connect 44 0 45 0;
#P connect 45 0 46 0;
#P connect 46 0 47 0;
#P connect 47 0 49 0;
#P fasten 48 0 49 0 464 453 307 453;
#P connect 42 2 43 1;
#P connect 42 3 43 2;
#P connect 42 4 43 3;
#P connect 45 1 48 0;
#P fasten 9 0 15 1 437 72 465 72;
#P fasten 12 0 16 1 432 115 465 115;
#P fasten 10 0 15 2 487 72 495 72;
#P fasten 13 0 16 2 483 115 498 115;
#P fasten 11 0 15 3 539 72 525 72;
#P fasten 14 0 16 3 534 115 531 115;
#P pop;

#25670
Apr 27, 2006 at 8:51am

Hi Michael,

You problem is not with the particle systems, but with ogl depth settings.
Right now you don’t control the rendering order of the particle systems. Try
to set @depth_enable 0 for the primitives that are on top of each other. If
you do want to use depth, set @automatic 0 for all primitives and control
the drawing order manually.

best, Thijs

#75805
Apr 28, 2006 at 3:06am

Hi,

Thanks for the info. I still can’t seem to get it to work. I have looked at some examples of controlling the rendering order. All of the examples look like my latest version that still doesnt work.

Any help or examples would be very helpful.

Thanks,
m

=============================
max v2;
#N vpatcher 204 48 1013 757;
#P origin 28 19;
#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 478 331 100 196617 jit.split @splitdim 1;
#P window linecount 2;
#P newex 610 544 400 196617 jit.gl.gridshape particles @shape sphere @automatic 0 @depth_enable 0 @blend_enable 0 @smooth_shading 1 @lighting_enable 1 @scale 0.07 0.07 0.07 @displaylist 1;
#P window linecount 1;
#P message 767 515 90 196617 position $1 $2 $3;
#P message 610 515 111 196617 color 0. 0. $1 1. , bang;
#P newex 610 491 139 196617 expr 1. – ((65. – $f1) / 65.);
#P newex 610 464 167 196617 zl slice 1;
#P newex 610 437 41 196617 jit.iter;
#P newex 610 410 53 196617 jit.pack 4;
#P newex 596 375 80 196617 jit.unpack 5;
#P newex 55 340 100 196617 jit.split @splitdim 1;
#P window linecount 2;
#P newex 187 553 400 196617 jit.gl.gridshape particles @shape sphere @automatic 0 @depth_enable 0 @blend_enable 0 @smooth_shading 1 @lighting_enable 1 @scale 0.07 0.07 0.07 @displaylist 1;
#P window linecount 1;
#P message 344 524 90 196617 position $1 $2 $3;
#P message 187 524 111 196617 color $1 0. 0. 1. , bang;
#P newex 187 500 139 196617 expr 1. – ((65. – $f1) / 65.);
#P newex 187 473 167 196617 zl slice 1;
#P newex 187 446 41 196617 jit.iter;
#P newex 187 419 53 196617 jit.pack 4;
#P newex 173 384 80 196617 jit.unpack 5;
#P newex 140 262 80 196617 jit.matrix point;
#P newex 316 203 110 196617 pak force 0. 0. 0.;
#P newex 319 160 100 196617 pak pos 0. 0. 0.;
#P flonum 418 184 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 367 184 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 316 184 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 423 141 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 371 141 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 321 142 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 118 233 172 196617 jit.p.vishnu @pitch 0.1 @yaw 0.1;
#P newex 118 192 143 196617 jit.p.shiva @life 60 @emit 10;
#P newex 118 170 149 196617 jit.matrix point 5 float32 25 2;
#P newex 557 253 85 196617 jit.matrix points;
#P newex 3 669 173 196617 jit.window particles @depthbuffer 1;
#P newex 735 201 110 196617 pak force 0. 0. 0.;
#P newex 738 158 100 196617 pak pos 0. 0. 0.;
#P flonum 837 182 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 786 182 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 735 182 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 842 139 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 790 139 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 740 140 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 537 231 172 196617 jit.p.vishnu @pitch 0.1 @yaw 0.1;
#P newex 537 190 143 196617 jit.p.shiva @life 60 @emit 10;
#P newex 2 643 221 196617 jit.gl.render particles @erase_color 0. 0. 0. 1.;
#P newex 2 76 66 196617 t b b b erase;
#P newex 537 168 154 196617 jit.matrix points 5 float32 25 2;
#P newex 2 49 75 196617 qmetro 30;
#P toggle 1 7 40 0;
#P connect 0 0 1 0;
#P connect 1 0 3 0;
#P connect 3 0 4 0;
#P fasten 3 3 4 0 61 155 7 155;
#P connect 19 0 37 0;
#P connect 17 0 18 0;
#P connect 18 0 19 0;
#P connect 27 0 19 0;
#P connect 26 0 19 0;
#P connect 19 0 28 0;
#P connect 37 0 29 0;
#P connect 29 1 30 0;
#P connect 30 0 31 0;
#P connect 31 0 32 0;
#P connect 32 0 33 0;
#P connect 33 0 34 0;
#P connect 34 0 36 0;
#P fasten 35 0 36 0 349 546 192 546;
#P connect 29 2 30 1;
#P connect 29 3 30 2;
#P connect 29 4 30 3;
#P connect 32 1 35 0;
#P fasten 20 0 26 1 326 158 354 158;
#P fasten 23 0 27 1 321 201 354 201;
#P fasten 21 0 26 2 376 158 384 158;
#P fasten 24 0 27 2 372 201 387 201;
#P fasten 22 0 26 3 428 158 414 158;
#P fasten 25 0 27 3 423 201 420 201;
#P connect 6 0 46 0;
#P fasten 3 2 2 0 43 109 542 109;
#P connect 2 0 5 0;
#P connect 5 0 6 0;
#P connect 13 0 6 0;
#P connect 14 0 6 0;
#P connect 6 0 16 0;
#P connect 46 0 38 0;
#P connect 38 1 39 0;
#P connect 39 0 40 0;
#P connect 40 0 41 0;
#P connect 41 0 42 0;
#P connect 42 0 43 0;
#P fasten 44 0 45 0 772 537 615 537;
#P connect 43 0 45 0;
#P connect 38 2 39 1;
#P connect 38 3 39 2;
#P connect 38 4 39 3;
#P connect 41 1 44 0;
#P fasten 7 0 13 1 745 156 773 156;
#P fasten 10 0 14 1 740 199 773 199;
#P fasten 8 0 13 2 795 156 803 156;
#P fasten 11 0 14 2 791 199 806 199;
#P fasten 9 0 13 3 847 156 833 156;
#P fasten 12 0 14 3 842 199 839 199;
#P pop;

#75806
Apr 28, 2006 at 9:51am

I discovered that if you only use 1 or no displaylists, it works fine. I’ve
never used them so I don’t know why this is. Maybe there is only 1
displaylist buffer on a GPU? I doubt if displaylists are useful in this case
anyway, because all particles are moving all the time, and displaylist are
only going to increase performance if a lot of the drawing commands stay the
same. Updating lots of commands in a displaylist can even decrease
performance afaik. Here’s the edited version.

-Thijs

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 478 331 100 9109513 jit.split @splitdim 1;
#P window linecount 2;
#P newex 610 544 400 9109513 jit.gl.gridshape particles @shape sphere
@automatic 0 @depth_enable 1 blend_enable 1 @smooth_shading 1
@lighting_enable 1 @scale 0.07 0.07 0.07 @displaylist 0;
#P window linecount 1;
#P message 767 515 90 9109513 position $1 $2 $3;
#P message 610 515 111 9109513 color 0. 0. $1 1. , bang;
#P newex 610 491 139 9109513 expr 1. – ((65. – $f1) / 65.);
#P newex 610 464 167 9109513 zl slice 1;
#P newex 610 437 41 9109513 jit.iter;
#P newex 610 410 53 9109513 jit.pack 4;
#P newex 596 375 80 9109513 jit.unpack 5;
#P newex 55 340 100 9109513 jit.split @splitdim 1;
#P window linecount 2;
#P newex 187 553 400 9109513 jit.gl.gridshape particles @shape plane
@automatic 0 @depth_enable 1 blend_enable 1 @smooth_shading 1
@lighting_enable 1 @scale 0.07 0.07 0.07 @displaylist 0;
#P window linecount 1;
#P message 344 524 90 9109513 position $1 $2 $3;
#P message 187 524 111 9109513 color $1 0. 0. 1. , bang;
#P newex 187 500 139 9109513 expr 1. – ((65. – $f1) / 65.);
#P newex 187 473 167 9109513 zl slice 1;
#P newex 187 446 41 9109513 jit.iter;
#P newex 187 419 53 9109513 jit.pack 4;
#P newex 173 384 80 9109513 jit.unpack 5;
#P newex 140 262 80 9109513 jit.matrix point;
#P newex 316 203 110 9109513 pak force 0. 0. 0.;
#P newex 319 160 100 9109513 pak pos 0. 0. 0.;
#P flonum 418 184 72 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 367 184 72 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 316 184 72 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 423 141 72 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 371 141 72 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 321 142 72 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 118 233 172 9109513 jit.p.vishnu @pitch 0.1 @yaw 0.1;
#P newex 118 192 143 9109513 jit.p.shiva @life 60 @emit 10;
#P newex 118 170 149 9109513 jit.matrix point 5 float32 25 2;
#P newex 589 288 85 9109513 jit.matrix points;
#P newex 3 669 173 9109513 jit.window particles @depthbuffer 1;
#P newex 735 201 110 9109513 pak force 0. 0. 0.;
#P newex 738 158 100 9109513 pak pos 0. 0. 0.;
#P flonum 837 182 72 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 786 182 72 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 735 182 72 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 842 139 72 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 790 139 72 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 740 140 72 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 537 231 172 9109513 jit.p.vishnu @pitch 0.1 @yaw 0.1;
#P newex 537 190 143 9109513 jit.p.shiva @life 60 @emit 10;
#P newex 2 643 300 9109513 jit.gl.render particles @erase_color 0. 0. 0. 1.
@automatic 0;
#P newex 2 76 66 9109513 t b b b erase;
#P newex 537 168 154 9109513 jit.matrix points 5 float32 25 2;
#P newex 2 49 75 9109513 qmetro 30;
#P toggle 1 7 40 0;
#P connect 43 0 45 0;
#P fasten 44 0 45 0 772 537 615 537;
#P connect 0 0 1 0;
#P connect 1 0 3 0;
#P fasten 3 3 4 0 61 155 7 155;
#P connect 3 0 4 0;
#P connect 19 0 37 0;
#P connect 3 1 17 0;
#P connect 17 0 18 0;
#P connect 18 0 19 0;
#P connect 27 0 19 0;
#P connect 26 0 19 0;
#P connect 19 0 28 0;
#P connect 37 0 29 0;
#P connect 29 1 30 0;
#P connect 30 0 31 0;
#P connect 31 0 32 0;
#P connect 32 0 33 0;
#P connect 33 0 34 0;
#P fasten 35 0 36 0 349 546 192 546;
#P connect 34 0 36 0;
#P connect 29 2 30 1;
#P connect 29 3 30 2;
#P connect 29 4 30 3;
#P connect 32 1 35 0;
#P fasten 20 0 26 1 326 158 354 158;
#P fasten 23 0 27 1 321 201 354 201;
#P fasten 21 0 26 2 376 158 384 158;
#P fasten 24 0 27 2 372 201 387 201;
#P fasten 22 0 26 3 428 158 414 158;
#P fasten 25 0 27 3 423 201 420 201;
#P connect 6 0 46 0;
#P fasten 3 2 2 0 43 109 542 109;
#P connect 2 0 5 0;
#P connect 5 0 6 0;
#P connect 13 0 6 0;
#P connect 14 0 6 0;
#P connect 6 0 16 0;
#P connect 46 0 38 0;
#P connect 38 1 39 0;
#P connect 39 0 40 0;
#P connect 40 0 41 0;
#P connect 41 0 42 0;
#P connect 42 0 43 0;
#P connect 38 2 39 1;
#P connect 38 3 39 2;
#P connect 38 4 39 3;
#P connect 41 1 44 0;
#P fasten 7 0 13 1 745 156 773 156;
#P fasten 10 0 14 1 740 199 773 199;
#P fasten 8 0 13 2 795 156 803 156;
#P fasten 11 0 14 2 791 199 806 199;
#P fasten 9 0 13 3 847 156 833 156;
#P fasten 12 0 14 3 842 199 839 199;
#P window clipboard copycount 47;

#75807
Apr 28, 2006 at 10:39am

Displaylists do seem to make a huge performance difference after all. Only I
don’t understand why my computer is having trouble with the patch running 1
system of 256 particles (displaylist on). I better start another thread on
this. Don’t want to hijack this one…

So I guess the question remains about using multiple displaylists…

-T

PS: a possible bug?: If I move the system away from position 0 0 0, I notice
flickering particles at position 0 0 0. (winxp, max 4.5.7, jitter1.5.2.)

#75808
Apr 28, 2006 at 2:08pm

Thanks a ton! I will continue to try to understand the jitter way for doing things. I wish the docs and tutorial had more details though.

thanks again,
m

#75809
Apr 28, 2006 at 4:05pm

Hi guys,
Try this one. It uses jit.gl.mesh to render the matrixoutput of
jit.gl.gridshape. jit.gl.mesh uses a more efficient strategy to store
vertices on the graphics card and as a result is way more efficient
for multiple draws than gridshape. I doubled the number of objects
each particle system is generating to 50 in the patch. With
jit.gl.mesh it runs at 30fps and with jit.gl.gridshape it runs at
17fps. (on my PB 1.67)

best,
wes

here’s the patch:

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 412 573 48 196617 loadbang;
#P user jit.fpsgui 20 166 60 196617 0;
#P window linecount 3;
#P newex 495 654 323 196617 jit.gl.gridshape particles @shape sphere
@automatic 0 @depth_enable 1 blend_enable 1 @smooth_shading 1
@lighting_enable 1 @scale 0.07 0.07 0.07 @displaylist 0 @matrixoutput
1;
#P button 353 575 15 0;
#P newex 353 595 316 196617 jit.gl.gridshape particles @shape plane
@automatic 0 @depth_enable 1 blend_enable 1 @smooth_shading 1
@lighting_enable 1 @scale 0.07 0.07 0.07 @displaylist 0 @matrixoutput
1;
#P window linecount 1;
#P newex 478 316 100 196617 jit.split @splitdim 1;
#P window linecount 2;
#P newex 610 529 277 196617 jit.gl.mesh particles @lighting_enable 1
@smooth_shading 1 @depth_enable 1 @blend_enable 1 @scale 0.07 0.07
0.07;
#P window linecount 1;
#P message 767 500 90 196617 position $1 $2 $3;
#P message 610 500 111 196617 color 0. 0. $1 1. , bang;
#P newex 610 476 139 196617 expr 1. – ((65. – $f1) / 65.);
#P newex 610 449 167 196617 zl slice 1;
#P newex 610 422 41 196617 jit.iter;
#P newex 610 395 53 196617 jit.pack 4;
#P newex 596 360 80 196617 jit.unpack 5;
#P newex 55 325 100 196617 jit.split @splitdim 1;
#P window linecount 2;
#P newex 187 538 277 196617 jit.gl.mesh particles @lighting_enable 1
@smooth_shading 1 @depth_enable 1 @blend_enable 1 @scale 0.07 0.07
0.07;
#P window linecount 1;
#P message 344 509 90 196617 position $1 $2 $3;
#P message 187 509 111 196617 color $1 0. 0. 1. , bang;
#P newex 187 485 139 196617 expr 1. – ((65. – $f1) / 65.);
#P newex 187 458 167 196617 zl slice 1;
#P newex 187 431 41 196617 jit.iter;
#P newex 187 404 53 196617 jit.pack 4;
#P newex 173 369 80 196617 jit.unpack 5;
#P newex 140 247 80 196617 jit.matrix point;
#P newex 316 188 110 196617 pak force 0. 0. 0.;
#P newex 319 145 100 196617 pak pos 0. 0. 0.;
#P flonum 418 169 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 367 169 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 316 169 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 423 126 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 371 126 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 321 127 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 118 218 172 196617 jit.p.vishnu @pitch 0.1 @yaw 0.1;
#P newex 118 177 143 196617 jit.p.shiva @life 60 @emit 10;
#P newex 118 155 149 196617 jit.matrix point 5 float32 50 2;
#P newex 589 273 85 196617 jit.matrix points;
#P newex 3 654 214 196617 jit.window particles @depthbuffer 1 @sync 0;
#P newex 735 186 110 196617 pak force 0. 0. 0.;
#P newex 738 143 100 196617 pak pos 0. 0. 0.;
#P flonum 837 167 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 786 167 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 735 167 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 842 124 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 790 124 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 740 125 72 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 537 216 172 196617 jit.p.vishnu @pitch 0.1 @yaw 0.1;
#P newex 537 175 143 196617 jit.p.shiva @life 60 @emit 10;
#P newex 2 628 300 196617 jit.gl.render particles @erase_color 0. 0.
0. 1. @automatic 0;
#P newex 2 61 66 196617 t b b b erase;
#P newex 537 153 154 196617 jit.matrix points 5 float32 50 2;
#P newex 2 34 51 196617 qmetro 2;
#P toggle 1 -8 40 0;
#P connect 3 0 4 0;
#P connect 3 0 50 0;
#P fasten 12 0 14 3 842 184 839 184;
#P fasten 9 0 13 3 847 141 833 141;
#P fasten 11 0 14 2 791 184 806 184;
#P fasten 8 0 13 2 795 141 803 141;
#P fasten 10 0 14 1 740 184 773 184;
#P fasten 7 0 13 1 745 141 773 141;
#P connect 41 1 44 0;
#P connect 38 4 39 3;
#P connect 38 3 39 2;
#P connect 38 2 39 1;
#P connect 49 0 45 0;
#P connect 43 0 45 0;
#P fasten 44 0 45 0 772 522 615 522;
#P connect 42 0 43 0;
#P connect 41 0 42 0;
#P connect 40 0 41 0;
#P connect 39 0 40 0;
#P connect 38 1 39 0;
#P connect 46 0 38 0;
#P connect 6 0 46 0;
#P connect 6 0 16 0;
#P connect 14 0 6 0;
#P connect 13 0 6 0;
#P connect 5 0 6 0;
#P connect 2 0 5 0;
#P fasten 3 2 2 0 43 94 542 94;
#P connect 48 0 47 0;
#P connect 48 0 49 0;
#P fasten 25 0 27 3 423 186 420 186;
#P fasten 22 0 26 3 428 143 414 143;
#P fasten 24 0 27 2 372 186 387 186;
#P fasten 21 0 26 2 376 143 384 143;
#P connect 51 0 48 0;
#P fasten 23 0 27 1 321 186 354 186;
#P fasten 20 0 26 1 326 143 354 143;
#P connect 32 1 35 0;
#P connect 29 4 30 3;
#P connect 29 3 30 2;
#P connect 29 2 30 1;
#P connect 47 0 36 0;
#P fasten 35 0 36 0 349 531 192 531;
#P connect 34 0 36 0;
#P connect 33 0 34 0;
#P connect 32 0 33 0;
#P connect 31 0 32 0;
#P connect 30 0 31 0;
#P connect 29 1 30 0;
#P connect 37 0 29 0;
#P connect 19 0 37 0;
#P connect 19 0 28 0;
#P connect 26 0 19 0;
#P connect 27 0 19 0;
#P connect 18 0 19 0;
#P connect 17 0 18 0;
#P connect 3 1 17 0;
#P fasten 3 3 4 0 61 140 7 140;
#P connect 1 0 3 0;
#P connect 0 0 1 0;
#P window clipboard copycount 52;

#75810
Apr 28, 2006 at 5:30pm

thanks wes! that’s really good to know.

but are you guys experiencing the same error? Moving a system to 0 0 -3 for
example and watch the center for flickering non-transformed black-colored
particles.

also the “emit” message doesn’t work on my computer. it can only turn off
the particles at some negative value, but there’s no difference between 0
and 200.

although it’s faster, I still have the feeling that a dedicated jitter
object can be far more efficient. I just watched a fireworks animation by a
friend who used just opengl in a little C app. It was capable of rendering
way more particles on his computer which doesn’t even have a really fast
gpu.

I read chapter 13.6 (particle systems) from the orange book, but I guess
that’s going to be tricky to implement in a jitter external no? It sounds
perfect though, to have a shader based particle system. Maybe something for
a future release? Or do I just have to study a little harder? ;-)

-Thijs

#75811
Apr 28, 2006 at 6:03pm

We hope to offer a more efficient solution in a future version of
Jitter. The bottleneck at the moment is the use of jit.iter to break
the matrix up into max messages.

With a little hard work and ingenuity, you could probably generate a
shader-based particle system, but it will take a bit of work as shader
programs have no memory and no buit-in RNG. For generating lots of
particles, it may be more efficient to do all of this in Javascript,
using jit.op/jit.expr to do the physics math. You may also buy some
performance by using jit.gl.sketch to do the transform/render of your
particles.

Regarding displaylists – they will give you a performance boost if you
are rendering the same geometry multiple times, so they are ideal for
use in this instance. Since you can’t change individual aspects of a
displaylist, it would decrease performance with geometry that changes
often, as a new displaylist will be generated for each change.
Please look at the OpenGL red book for a more detailed discussion of the
pros and cons of displaylists.

Andrew B.

#75812

You must be logged in to reply to this topic.