Forums > Jitter

Using a displacement shader?

October 10, 2006 | 6:06 pm

Hey list,

I’m just beginning to look into adapting shaders for use in Jitter. I’m
trying to get a "warp" effect – I’m thinking that using some sort of
displacement shader would be more efficient than the method I’ve pasted
below. Is there a way to produce the same effect in OpenGL? – especially
one that is significantly less expensive?

Any advice or pointings in the right direction is appreciated.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 98 515 30 196617 read;
#P message 436 63 34 196617 2000;
#P newex 436 41 48 196617 loadbang;
#P user uslider 515 234 41 33 40 1 0 0;
#P user uslider 442 235 41 33 256 1 -127 0;
#P user uslider 371 236 41 33 256 1 -127 0;
#P message 529 506 14 196617 4;
#P newex 530 487 48 196617 loadbang;
#P number 437 81 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 584 211 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 513 213 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 442 214 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 371 213 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Fixedwidth Serif" 10.;
#P newex 330 140 38 1441802 sel 0;
#P message 330 161 32 1441802 stop;
#P newex 584 186 62 1441802 line 0 50;
#P newex 513 186 62 1441802 line 0 50;
#P newex 371 115 38 1441802 metro;
#P newex 584 140 68 1441802 random 240;
#P newex 584 161 47 1441802 pack;
#P newex 513 140 64 1441802 random 40;
#P newex 513 161 47 1441802 pack;
#P newex 442 140 70 1441802 random 256;
#P newex 442 161 47 1441802 pack;
#P newex 371 140 70 1441802 random 256;
#P newex 371 161 47 1441802 pack;
#P newex 442 186 62 1441802 line 0 50;
#P newex 371 186 62 1441802 line 0 50;
#P window setfont "Sans Serif" 9.;
#P newex 86 543 167 196617 jit.qt.movie 320 240 @autostart 1;
#B color 5;
#P number 458 527 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 458 545 71 196617 boundmode $1;
#P number 392 527 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 328 527 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 392 545 62 196617 offset_y $1;
#P message 328 545 62 196617 offset_x $1;
#P newex 86 567 228 196617 jit.repos 4 char 320 240 @mode 1 @interpbits 8;
#P toggle 168 594 15 0;
#P message 168 612 68 196617 fullscreen $1;
#P newex 86 636 94 196617 jit.window warper;
#P number 122 55 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P toggle 86 27 15 0;
#P newex 86 74 46 196617 metro 2;
#P hidden newex 477 404 20 196617 t b;
#P comment 544 378 116 196617 spatial low pass filter;
#P newex 304 482 204 196617 jit.scanslide @out_name scrap @dimmode 1;
#P message 571 405 73 196617 slide_down $1;
#P flonum 508 377 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 508 405 60 196617 slide_up $1;
#P newex 304 436 200 196617 jit.matrix scrap 2 long 320 240 @interp 1;
#P newex 304 458 145 196617 jit.scanslide @out_name scrap;
#P newex 304 399 109 196617 jit.op @op * @val 256;
#P number 418 313 44 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P number 371 314 44 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 304 378 101 196617 jit.matrix 2 long 3 3;
#P newex 281 344 20 196617 t b;
#P newex 304 344 133 196617 pak setcell 1 1 val 159 119;
#P fasten 47 0 38 1 442 103 404 103;
#P connect 47 0 30 1;
#P connect 47 0 32 1;
#P connect 47 0 34 1;
#P connect 47 0 36 1;
#P connect 40 0 46 0;
#P connect 36 0 40 0;
#P fasten 41 0 28 0 335 182 376 182;
#P fasten 41 0 29 0 335 182 447 182;
#P fasten 41 0 39 0 335 182 518 182;
#P fasten 41 0 40 0 335 182 589 182;
#P connect 37 0 36 0;
#P connect 38 0 31 0;
#P fasten 38 0 33 0 376 136 447 136;
#P fasten 38 0 35 0 376 136 518 136;
#P fasten 38 0 37 0 376 136 589 136;
#P hidden fasten 9 0 13 0 513 401 482 401;
#P connect 9 0 8 0;
#P fasten 9 0 10 0 513 401 576 401;
#P connect 48 0 49 0;
#P connect 45 0 52 0;
#P connect 39 0 45 0;
#P connect 34 0 39 0;
#P connect 35 0 34 0;
#P fasten 52 0 9 0 520 330 513 330;
#P connect 26 0 25 0;
#P connect 49 0 26 0;
#P connect 44 0 51 0;
#P connect 29 0 44 0;
#P connect 32 0 29 0;
#P connect 33 0 32 0;
#P connect 54 0 47 0;
#P connect 53 0 54 0;
#P fasten 4 0 1 0 423 336 286 336;
#P fasten 4 0 0 5 423 336 429 336;
#P fasten 51 0 4 0 447 298 423 298;
#P fasten 3 0 1 0 376 336 286 336;
#P fasten 3 0 0 4 376 336 405 336;
#P connect 24 0 22 0;
#P connect 50 0 3 0;
#P connect 43 0 50 0;
#P connect 28 0 43 0;
#P connect 30 0 28 0;
#P connect 31 0 30 0;
#P connect 15 0 14 0;
#P fasten 15 0 42 0 91 48 335 48;
#P fasten 15 0 38 0 91 48 376 48;
#P connect 42 0 41 0;
#P connect 23 0 21 0;
#P fasten 11 0 20 1 309 513 309 513;
#P connect 6 0 11 0;
#P fasten 8 0 6 0 513 456 309 456;
#P fasten 8 0 11 0 513 477 309 477;
#P fasten 10 0 11 0 576 477 309 477;
#P connect 7 0 6 0;
#P fasten 10 0 6 0 576 456 309 456;
#P connect 5 0 7 0;
#P connect 2 0 5 0;
#P connect 0 0 2 0;
#P fasten 1 0 2 0 286 366 309 366;
#P hidden fasten 13 0 2 0 482 430 425 430 425 366 309 366;
#P connect 19 0 18 0;
#P connect 16 0 14 1;
#P fasten 18 0 17 0 173 631 91 631;
#P connect 20 0 17 0;
#P connect 27 0 20 0;
#P fasten 21 0 20 0 333 564 91 564;
#P fasten 22 0 20 0 397 564 91 564;
#P fasten 25 0 20 0 463 564 91 564;
#P fasten 55 0 27 0 103 535 91 535;
#P connect 14 0 27 0;
#P window clipboard copycount 56;


October 10, 2006 | 7:14 pm

Hi Bart,
Check out td.repos.jxs as well as the other texture-displace shaders.
You could probably use it as is, but you could also use it as a starting
point for further experimentation.

Another (non-shader)technique would be to use the surface geometry to do
your distortion. Check out Jitter Recipe #18 for an example:

http://www.cycling74.com/story/2006/2/14/161736/108

Cheers,
Andrew B.


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