Forums > Jitter

stuttering text on jit.gl.text3d

May 11, 2006 | 11:11 am

i have a problem with the rendering of scrolling text using jit.gl.text3d.
even in slow speed the text motion is not smooth and flickers, and depending
on cpu usage it has a slight stutter.
the rest of the patch runs very smoothly. i suspect the line object.
if you want to look into the patch you have to supply a foder with text
files in it.

#P window setfont "Sans Serif" 12.;
#P window linecount 1;
#P comment 114 111 75 9109516 esc to go FS;
#P window setfont "Sans Serif" 9.;
#P newex 436 415 116 9109513 jit.matrix foot 1 char 1555;
#P newex 436 391 109 9109513 jit.op @op max @val 32;
#P window setfont "Sans Serif" 12.;
#P comment 96 238 130 9109516 soft limit is 50000 long;
#P window setfont "Sans Serif" 9.;
#P comment 114 95 223 9109513 you may have to bang the loadbang if
copypasting;
#P window setfont "Sans Serif" 14.;
#P comment 114 56 196 9109518 throw a directory with text files;
#P window setfont "Sans Serif" 9.;
#P hidden newex 886 178 40 9109513 t b b b;
#P window setfont "Sans Serif" 14.;
#P comment 113 75 191 9109518 then start metro and bigbang;
#P window setfont "Sans Serif" 20.;
#P message 599 555 245 9109524 why the stutter and flicker?;
#P window setfont "Sans Serif" 12.;
#P comment 249 475 75 9109516 esc to go FS;
#P window setfont "Sans Serif" 20.;
#P message 599 526 358 9109524 the motion of text is not smooth enough;
#P window setfont "Sans Serif" 12.;
#P window linecount 2;
#P comment 735 238 124 9109516 rise value to make next line move slower;
#P comment 423 263 109 9109516 set size of dim based on txt length;
#P window linecount 3;
#P comment 96 189 130 9109516 bangs and count until all the letters are
passed into the Queue;
#P window setfont "Sans Serif" 20.;
#P window linecount 1;
#P comment 113 29 92 9109524 text scroll;
#P window setfont "Sans Serif" 12.;
#P comment 351 83 307 9109516 the texts are loaded at order from a folder
with text files;
#P window linecount 2;
#P comment 710 331 348 9109516 the second expr takes the length of matrix
dim ($i1) and calculates an approperate speed for the [line];
#P comment 659 294 348 9109516 the first expr takes the length of matrix dim
($i1) and calculates an approperate scroll length (offscreen to offscreen);
#P window linecount 1;
#P message 697 219 29 9109516 160;
#P number 698 246 35 12 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P newex 491 228 27 9109513 t b i;
#P newex 567 288 27 9109513 t i i;
#P newex 625 331 83 9109513 expr $i2*$i1 -1750;
#B color 5;
#N counter 50000;
#X flags 0 0;
#P newobj 231 220 67 9109513 counter 50000;
#P window setfont "Sans Serif" 12.;
#N vpatcher 15 55 615 455;
#N comlet maximum uzi count;
#P inlet 132 119 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 166 217 24 9109513 – 1;
#P newex 88 168 38 9109513 i 15000;
#P newex 179 145 40 9109513 t break;
#P newex 88 145 89 9109513 route bang;
#P inlet 88 121 15 0;
#P outlet 166 240 15 0;
#N comlet break operation on bang;
#P inlet 179 121 15 0;
#P newex 88 195 47 9109513 uzi 15000;
#P window setfont "Sans Serif" 12.;
#P comment 87 83 100 9109516 Stefan Tiedje;
#P connect 4 0 5 0;
#P connect 5 0 7 0;
#P fasten 6 0 1 0 184 190 93 190;
#P fasten 5 1 1 0 172 190 93 190;
#P connect 7 0 1 0;
#P connect 9 0 7 1;
#P connect 9 0 1 1;
#P connect 1 2 8 0;
#P connect 8 0 3 0;
#P connect 2 0 6 0;
#P pop;
#P newobj 232 198 41 9109516 p until;
#P window setfont "Sans Serif" 9.;
#P newex 584 407 57 9109513 prepend set;
#B color 5;
#P newex 566 385 27 9109513 t b l;
#B color 5;
#P message 570 432 159 9109513 19.129 , -19.129 134090;
#P newex 592 334 27 9109513 * -1.;
#P newex 566 360 87 9109513 pack 0. \, 0. 20000;
#B color 5;
#P newex 566 310 92 9109513 expr 0.021*$i1 + 1.3;
#B color 5;
#N counter;
#X flags 0 0;
#P newobj 401 156 66 9109513 counter;
#P newex 522 227 27 9109513 – 1;
#P newex 408 202 49 9109513 pak read l;
#P newex 523 204 72 9109513 route populate;
#P newex 478 157 74 9109513 prepend prefix;
#P button 354 131 15 0;
#P newex 355 109 60 9109513 prepend set;
#P user dropfile 424 108 694 127 0 fold;
#P newex 478 136 54 9109513 route text;
#P user textedit 424 108 694 127 0 139 9 E:/max/doron_in_max/;
#P user ubumenu 401 182 100 9109513 0 1 1 0;
#X add batch.js;
#X add "New Text Document.txt";
#X types TEXT;
#X prefix_set 0 1 E:/max/doron_in_max/ 0;
#X pattrmode 1;
#P newex 454 299 27 9109513 i;
#P newex 285 275 69 9109513 t b b b dump b;
#P message 454 343 36 9109513 dim $1;
#P newex 232 174 40 9109513 t b b b;
#P newex 537 456 40 9109513 line 0.;
#B color 5;
#P newex 506 481 104 9109513 pak position 0. -0.68 0.;
#P newex 174 307 68 9109513 mxj list.Queue;
#P button 237 137 30 0;
#P newex 232 274 51 9109513 sprintf %s;
#B color 5;
#P newex 232 250 40 9109513 filein;
#B color 5;
#P newex 376 302 42 9109513 t l clear;
#P newex 376 332 56 9109513 jit.fill foot 0;
#P message 441 504 339 9109513 font system , align 1 , tracking 1.32 ,
leadscale 2 , position 0. -0.68 , scale 0.1 0.1;
#P newex 436 363 116 9109513 jit.matrix foot 1 char 1555;
#P newex 886 145 45 9109513 loadbang;
#P newex 429 527 166 9109513 jit.gl.text3d screen1 @color 1. 1. 1. 1.;
#B color 5;
#P message 186 529 68 9109513 fullscreen $1;
#P toggle 169 529 15 0;
#P newex 211 504 33 9109513 sel 53;
#P newex 196 476 40 9109513 key;
#P window setfont "Sans Serif" 12.;
#P message 85 657 61 9109516 border $1;
#P toggle 83 639 15 0;
#P window setfont "Sans Serif" 9.;
#P newex 85 687 366 9109513 jit.window screen1 @depthbuffer 1 @border 0
@floating 1 @size 80 60 @pos 800 750;
#P newex 77 480 43 9109513 jit.qball;
#P toggle 77 412 34 0;
#P newex 77 457 45 9109513 metro 40;
#P newex 77 511 48 9109513 t b erase;
#P newex 92 601 90 9109513 jit.gl.render screen1;
#P window setfont "Sans Serif" 12.;
#P window linecount 3;
#P comment 173 339 117 9109516 used mxj.Queue as it isnt limited in length
like zl and coll;
#P user panel 59 400 74 55;
#X brgb 240 140 140;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 230 131 43 42;
#X brgb 240 140 140;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 421 105 281 25;
#X brgb 240 140 140;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 881 143 53 25;
#X brgb 240 140 140;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P connect 8 0 7 0;
#P connect 7 0 9 0;
#P connect 9 0 6 0;
#P connect 11 0 12 0;
#P fasten 16 0 10 0 191 683 90 683;
#P connect 12 0 10 0;
#P connect 6 1 5 0;
#P connect 6 0 5 0;
#P fasten 14 0 15 0 216 526 174 526;
#P fasten 31 3 26 0 332 302 179 302;
#P fasten 15 0 16 0 185 544 185 529;
#P connect 13 1 14 0;
#P connect 50 0 51 0;
#P connect 25 0 29 0;
#P connect 29 0 50 0;
#P connect 51 0 23 0;
#P fasten 41 0 23 0 413 246 237 246;
#P connect 23 0 24 0;
#P connect 24 0 26 2;
#P connect 28 1 25 0;
#P fasten 31 1 51 2 304 308 366 308 366 218 264 218;
#P fasten 31 2 50 2 318 299 361 299 361 196 267 196;
#P connect 23 1 31 0;
#P connect 37 0 38 0;
#P hidden connect 68 0 38 0;
#P fasten 36 0 37 0 429 130 417 130 417 105 360 105;
#P fasten 26 0 22 0 179 334 370 334 370 298 381 298;
#P connect 22 0 21 0;
#P connect 54 0 43 0;
#P fasten 29 2 43 0 269 194 314 194 314 153 406 153;
#P connect 43 0 33 0;
#P fasten 39 0 33 0 483 178 406 178;
#P fasten 37 0 34 0 360 130 417 130 417 105 429 105;
#P fasten 38 0 34 0 359 149 417 149 417 106 429 106;
#P fasten 73 0 17 0 441 480 434 480;
#P fasten 27 0 17 0 511 499 434 499;
#P fasten 20 0 17 0 446 524 434 524;
#P fasten 22 1 19 0 413 328 441 328;
#P connect 30 0 19 0;
#P fasten 21 0 19 0 381 357 441 357;
#P connect 19 0 72 0;
#P fasten 22 1 73 0 434 321 434 414 441 414;
#P connect 72 0 73 0;
#P connect 30 0 73 0;
#P hidden fasten 68 2 20 0 921 503 446 503;
#P connect 33 1 41 1;
#P fasten 31 4 32 0 459 294;
#P connect 32 0 30 0;
#P fasten 54 1 43 4 513 253 482 253 473 155 462 155;
#P fasten 51 0 32 1 236 242 476 242;
#P fasten 34 0 35 0 429 130 483 130;
#P connect 35 0 39 0;
#P connect 42 0 54 0;
#P connect 40 0 42 0;
#P fasten 33 2 40 0 496 201 528 201;
#P fasten 47 0 28 0 575 452 542 452;
#P connect 28 0 27 1;
#P connect 53 0 44 0;
#P connect 44 0 45 0;
#P connect 45 0 48 0;
#P fasten 32 0 53 0 558 318 558 282 572 282;
#P fasten 48 0 47 0 571 418 575 418;
#P fasten 49 0 47 0 589 429 575 429;
#P connect 48 1 49 0;
#P fasten 44 0 46 0 571 332 597 332;
#P connect 46 0 45 2;
#P connect 53 1 52 0;
#P connect 52 0 45 3;
#P hidden fasten 68 1 56 0 906 208 702 208;
#P connect 56 0 55 0;
#P connect 55 0 52 1;
#P hidden connect 18 0 68 0;
#P window clipboard copycount 75;


May 13, 2006 | 9:42 am

hello,

the flickering effect seems to be caused by hard edges. try turning on anitaliasing( fsaa 1 to jit.window), it smoothed things here, but then say bye bye to erase_color tricks that could help you with temporal smoothing(without fsaa, try lowering erase color alpha until scrolling text makes subtle trails).

for timing issues, try to use line~ and snapshot~ instead of line, and bang snapshot~ with metro driving gl.render. this can assure that your text will come from right to left in say 7 seconds, regardless of drawing speed; or, for opposite try using bline to make sure increments are synced to rendering metro, so that text would move from right to left for as long as it needs to draw things smoothly(i got a hunch that this and fsaa 1 will do what you need).

cheers,
nesa


May 15, 2006 | 6:21 pm

thanx nesa, i changed to bline but the biggest diffrence was uping the metro
rate.unfortunatly i am trying to push three diffrent opengl renders (with
two diffrent video cards) and even just [erase,bang] gets the cpu hot at 60%
with nothing else on..

the line~ snapshot~ thing didnt change the situation (if i am using it right
that is)

#P window setfont "Sans Serif" 12.;
#P window linecount 1;
#P comment 441 23 18 9109516 0.;
#P button 459 24 15 0;
#P comment 398 62 18 9109516 2.;
#P window setfont "Sans Serif" 9.;
#P flonum 164 319 35 9 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 50 342 123 9109513 pak erase_color 0. 0. 0. 0.1;
#P user ezdac~ 64 178 108 211 0;
#P newex 29 321 53 9109513 s bange;
#P window linecount 2;
#P newex 16 452 174 9109513 jit.window screen1 @border 0 @floating 1 @size
16 12 @pos 1000 750;
#P toggle 8 177 34 0;
#P window linecount 1;
#P newex 8 216 45 9109513 qmetro 3;
#P newex 8 287 53 9109513 t b b erase;
#P newex 8 369 204 9109513 jit.gl.render screen1 @erase_color 0. 0. 0. 0.47;
#P message 466 58 62 9109513 E:/max/text1;
#P newex 485 22 45 9109513 loadbang;
#P window setfont "Sans Serif" 12.;
#N vpatcher 5 40 605 440;
#P window setfont "Sans Serif" 9.;
#P message 56 120 68 9109513 fullscreen $1;
#P toggle 56 101 15 0;
#P newex 56 78 33 9109513 sel 97;
#P newex 50 50 40 9109513 key;
#P outlet 56 142 15 0;
#P connect 1 1 2 0;
#P fasten 2 0 3 0 61 98 61 98;
#P fasten 3 0 4 0 61 117 61 117;
#P connect 4 0 0 0;
#P pop;
#P newobj 16 424 28 9109516 p fs;
#P flonum 588 627 113 12 0 0 0 139 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P newex 592 572 39 9109513 r bange;
#P newex 564 571 27 9109513 line~;
#P newex 564 598 51 9109513 snapshot~;
#P message 642 400 18 9109513 11;
#P newex 437 655 45 9109513 loadbang;
#B color 4;
#P message 415 372 14 9109513 1;
#P newex 388 394 61 9109513 t 0 0 dump b;
#B color 5;
#P toggle 376 292 15 0;
#P newex 375 312 40 9109513 metro 1;
#N counter 50000;
#X flags 0 0;
#P newobj 374 341 67 9109513 counter 50000;
#P newex 450 506 27 9109513 i;
#P message 450 550 36 9109513 dim $1;
#P newex 493 658 104 9109513 pak position 0. -0.68 0.;
#P newex 371 460 68 9109513 mxj list.Queue;
#P button 421 60 30 0;
#P newex 373 422 51 9109513 sprintf %s;
#B color 5;
#P newex 373 369 40 9109513 filein;
#B color 5;
#P newex 372 509 42 9109513 t l clear;
#P newex 372 539 56 9109513 jit.fill foot 0;
#P newex 425 618 116 9109513 jit.matrix foot 1 char 1555;
#P newex 425 594 109 9109513 jit.op @op max @val 32;
#P message 437 685 60 9109513 font X_Haim;
#P newex 425 570 116 9109513 jit.matrix foot 1 char 1555;
#P window linecount 2;
#P newex 425 708 250 9109513 jit.gl.text3d screen1 @color 1. 1. 1. 1. @align
1 @tracking 1.32 @leadscale 2 @position -11. -0.68 @scale -0.1 0.1;
#B color 5;
#P window linecount 1;
#P newex 594 442 57 9109513 expr $i2*$i1;
#B color 5;
#P newex 531 398 27 9109513 t i i;
#P newex 558 494 57 9109513 prepend set;
#B color 5;
#P newex 528 495 27 9109513 t b l;
#B color 5;
#P message 544 520 144 9109513 -6.256001 0 6.256001 1947;
#P newex 530 444 27 9109513 * -1.;
#P newex 530 470 89 9109513 pack 0. 0 0. 20000;
#B color 5;
#P newex 530 420 92 9109513 expr 0.028*$i1 + 1.3;
#B color 5;
#P user panel 554 551 160 106;
#X brgb 239 239 239;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P window setfont "Sans Serif" 12.;
#P comment 57 219 18 9109516 1.;
#P newex 703 168 39 9109516 folder;
#P window setfont "Sans Serif" 9.;
#P newex 605 214 27 9109513 t b i;
#N counter;
#X flags 0 0;
#P newobj 512 143 66 9109513 counter;
#P newex 633 214 27 9109513 – 1;
#P newex 519 189 49 9109513 pak read l;
#P newex 634 191 72 9109513 route populate;
#P newex 589 144 74 9109513 prepend prefix;
#P button 464 120 15 0;
#P newex 466 96 60 9109513 prepend set;
#P newex 589 123 54 9109513 route text;
#P user ubumenu 512 169 100 9109513 0 1 1 0;
#X add "Copy of text1.txt";
#X add "Copy of text2.txt";
#X add text1.txt;
#X types TEXT;
#X prefix_set 0 1 E:/max/text1/ 0;
#X pattrmode 1;
#P window setfont "Sans Serif" 12.;
#P comment 532 58 164 9109516 change to folder with txt files;
#P window setfont "Sans Serif" 9.;
#P user textedit 536 95 806 114 0 139 9 E:/max/text1;
#P fasten 0 0 3 0 541 117 594 117;
#P fasten 5 0 0 0 469 136 528 136 528 93 541 93;
#P fasten 4 0 0 0 471 117 528 117 528 92 541 92;
#P connect 4 0 5 0;
#P connect 61 0 49 0;
#P connect 53 0 52 0;
#P fasten 58 0 51 0 55 365 13 365;
#P connect 52 0 51 0;
#P connect 52 2 51 0;
#P connect 48 0 55 0;
#P fasten 52 1 56 0 34 311 34 311;
#P connect 54 0 57 0;
#P connect 54 0 53 0;
#P fasten 59 0 58 4 169 338 167 338;
#P fasten 40 2 33 0 427 455 376 455;
#P fasten 33 0 29 0 376 494 377 494;
#P connect 29 0 28 0;
#P fasten 8 0 30 0 524 365 378 365;
#P connect 30 0 31 0;
#P connect 38 0 37 0;
#P connect 39 0 38 0;
#P fasten 40 1 39 0 405 418 359 418 359 291 381 291;
#P fasten 41 0 39 0 423 392 442 392 442 289 381 289;
#P connect 30 1 40 0;
#P fasten 40 0 37 2 393 420 364 420 364 339 407 339;
#P connect 30 2 41 0;
#P fasten 45 1 32 0 586 596 339 596 339 56 426 56;
#P connect 35 0 24 0;
#P connect 35 0 27 0;
#P fasten 28 0 24 0 377 564 430 564;
#P fasten 24 0 26 0 430 594 430 594;
#P connect 26 0 27 0;
#P fasten 29 1 27 0 430 528;
#P fasten 29 1 24 0 409 535 430 535;
#P fasten 25 0 23 0 442 705 430 705;
#P connect 27 0 23 0;
#P fasten 34 0 23 0 498 680 430 680;
#P fasten 31 0 33 2 378 450 434 450;
#P connect 42 0 25 0;
#P fasten 40 3 36 0 444 459 455 459;
#P connect 50 0 4 0;
#P fasten 37 0 36 1 379 362 472 362;
#P connect 37 0 30 0;
#P fasten 11 0 10 0 610 239 503 239 503 138 517 138;
#P fasten 32 0 10 0 426 140 517 140;
#P connect 10 0 2 0;
#P fasten 6 0 2 0 594 165 517 165;
#P connect 16 0 19 0;
#P connect 17 0 16 0;
#P fasten 36 0 21 0 455 535 516 535 516 389 536 389;
#P connect 36 0 35 0;
#P connect 19 0 18 0;
#P connect 20 0 18 0;
#P connect 2 1 8 1;
#P connect 19 1 20 0;
#P fasten 18 0 45 0 569 543;
#P connect 45 0 44 0;
#P fasten 46 0 44 0 597 596 569 596;
#P fasten 11 1 10 4 627 242 584 242 584 138 573 138;
#P fasten 15 0 16 2 535 442 587 442;
#P fasten 15 0 17 0 535 442 535 442;
#P connect 44 0 47 0;
#P connect 44 0 34 1;
#P connect 3 0 6 0;
#P fasten 21 0 22 0 599 417;
#P connect 21 0 15 0;
#P connect 9 0 11 0;
#P connect 22 0 16 3;
#P connect 7 0 9 0;
#P fasten 2 2 7 0 607 188 639 188;
#P connect 43 0 22 1;
#P fasten 49 0 43 0 490 51 798 51 798 388 647 388;
#P connect 49 0 50 0;
#P window clipboard copycount 63;


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