Forums > Jitter

OpenGL feedback

March 17, 2008 | 1:38 pm

Hey all,
I don’t know if any of you have checked out the "cycledelic" example bundled with jitter, but it’s pretty amazing. It seems to me that the secret to this feedback patch is the combination of rota, scalebias, and op-average. If I were to mimic this patch using openGl shaders, how would I do it? Is it possible to create a feedback loop with GL and place slabs inside of the loop? (not pre or post) I tried modifying Andrew Benson’s Glfeedback recipe, but couldn’t figure out where to insert the slabs to put them inside of the feedback circuit. Any Ideas?…


March 17, 2008 | 3:28 pm

this may or may not be what you are looking for.
andrew so crazy…

#P window setfont "Sans Serif" 9.;
#P window linecount 4;
#P comment 541 335 371 196617 This patch demonstrates a technique for doing matrix-style processing on an openGL scene without reading back to the CPU. This allows you to add a variety of processing effects to your live OpenGL patch without encountering much loss of frame rate. Another incentive to look at those shaders…;
#P window linecount 1;
#P comment 951 348 169 196617 andrewb@cycling74.com;
#P comment 789 279 80 196617 scale_bias filter;
#P comment 609 179 132 196617 dodge composite (feedback);
#P comment 702 233 64 196617 gaussian blur;
#P comment 601 79 201 196617 this is our render destination for the nurbs;
#P user jit.fpsgui 34 351 60 196617 0;
#P flonum 624 113 42 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 624 133 88 196617 param amount $1;
#P newex 120 116 56 196617 qlim 1000;
#P newex 120 137 124 196617 jit.matrix 3 float32 10 5;
#P message 1053 155 43 196617 $1 400;
#P newex 1053 174 40 196617 line 0.;
#P newex 1053 136 41 196617 * 0.03;
#P newex 1053 116 64 196617 random 100;
#P message 988 155 43 196617 $1 400;
#P newex 988 174 40 196617 line 0.;
#P newex 988 136 41 196617 * 0.03;
#P newex 988 116 64 196617 random 100;
#P message 923 155 43 196617 $1 400;
#P newex 923 174 40 196617 line 0.;
#P newex 923 136 41 196617 * 0.03;
#P newex 923 116 64 196617 random 100;
#P message 814 154 43 196617 $1 400;
#P newex 814 172 40 196617 line 0.;
#P newex 833 69 50 196617 qlim 500;
#P hidden newex 491 15 48 196617 loadbang;
#P hidden message 491 35 14 196617 0;
#P toggle 541 14 47 0;
#P newex 541 107 27 196617 + 1;
#P newex 541 135 38 196617 gate 2;
#P flonum 1005 210 38 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 966 210 38 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 923 210 42 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 922 231 135 196617 pak param scale 1. 1. 1.;
#P newex 569 260 300 196617 jit.gl.slab cracks @file cc.scalebias.jxs @dim 320 240 @adapt 0;
#P newex 569 160 171 196617 jit.gl.slab cracks @file co.dodge.jxs;
#P newex 814 94 29 196617 gate;
#P number 63 237 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 63 257 56 196617 dim $1 $1;
#P newex 120 198 177 196617 jit.matrix 3 float32 20 20 @interp 1;
#P newex 120 217 184 196617 jit.slide @slide_up 50 @slide_down 50;
#P newex 814 135 103 196617 expr $i1*0.02-0.01;
#P newex 814 115 64 196617 random 200;
#P message 813 195 81 196617 param width $1;
#P newex 569 288 203 196617 jit.gl.videoplane cracks @scale 1.333 1. 1.;
#P newex 569 214 197 196617 jit.gl.slab cracks @file cf.gaussian.2p.jxs;
#P newex 569 92 233 196617 jit.gl.texture cracks @name super @dim 640 480;
#P newex 236 256 271 196617 jit.gl.handle cracks @inherit_transform 1 @auto_rotate 1;
#P message 236 237 34 196617 reset;
#P newex 120 237 115 196617 jit.dimmap @invert 1 1;
#P newex 120 257 91 196617 prepend ctlmatrix;
#P window linecount 2;
#P newex 120 284 311 196617 jit.gl.nurbs cracks @color 0.8 0.7 0.3 0.6 @capture super @rotate 20. 60. 0. 0. @blend_enable 1 @poly_mode 1 0 @lighting_enable 1;
#P window linecount 1;
#P newex 34 45 74 196617 t erase b b b b;
#P newex 34 330 229 196617 jit.gl.render cracks @erase_color 0.2 0.1 0.1 1.;
#P window linecount 2;
#P newex 120 159 226 196617 jit.expr @expr "jit.noise()*0.5-0.5+snorm[0]" "jit.noise()*4.-2." "snorm[1]" @cache 0;
#P window linecount 1;
#P newex 86 25 162 196617 jit.window cracks @size 640 480;
#P toggle 4 25 29 0;
#P newex 34 25 51 196617 qmetro 5;
#P window linecount 3;
#P comment 589 19 57 196617 turn on/off slab processing;
#P window setfont "Sans Serif" 24.;
#P window linecount 1;
#P comment 950 320 169 196632 SceneProcess;
#P connect 49 0 48 0;
#P connect 47 0 49 0;
#P connect 46 0 47 0;
#P connect 23 0 17 0;
#P fasten 23 0 38 0 819 112 928 112;
#P fasten 23 0 42 0 822 112 993 112;
#P fasten 23 0 46 0 820 112 1058 112;
#P fasten 29 0 26 4 1010 227 1051 227;
#P fasten 28 0 26 3 971 227 1020 227;
#P connect 48 0 29 0;
#P connect 45 0 44 0;
#P connect 43 0 45 0;
#P connect 42 0 43 0;
#P fasten 27 0 26 2 928 227 989 227;
#P connect 44 0 28 0;
#P connect 40 0 27 0;
#P connect 41 0 40 0;
#P connect 39 0 41 0;
#P connect 38 0 39 0;
#P connect 35 0 23 1;
#P hidden fasten 7 4 35 0 103 65 838 65;
#P connect 37 0 36 0;
#P connect 18 0 37 0;
#P connect 17 0 18 0;
#P connect 32 0 31 0;
#P fasten 32 0 23 0 546 65 819 65;
#P connect 36 0 16 0;
#P connect 25 0 15 0;
#P fasten 25 0 24 1 574 281 561 281 561 155 735 155;
#P connect 53 0 52 0;
#P fasten 30 0 15 0 546 281 574 281;
#P fasten 26 0 25 0 927 255 574 255;
#P connect 14 0 25 0;
#P connect 24 0 14 0;
#P fasten 16 0 14 0 818 210 574 210;
#P fasten 52 0 24 0 629 155 574 155;
#P connect 30 1 24 0;
#P connect 13 0 30 1;
#P fasten 7 3 13 0 87 81 574 81;
#P connect 31 0 30 0;
#P hidden fasten 33 0 31 0 496 104 546 104;
#P hidden connect 34 0 33 0;
#P connect 11 0 12 0;
#P fasten 12 0 8 0 241 277 125 277;
#P connect 9 0 8 0;
#P fasten 21 0 8 0 68 277 125 277;
#P connect 10 0 9 0;
#P connect 19 0 10 0;
#P connect 20 0 19 0;
#P fasten 7 2 51 0 71 111 125 111;
#P fasten 7 2 20 0 71 191 125 191;
#P connect 5 0 20 0;
#P connect 50 0 5 0;
#P connect 51 0 50 0;
#P connect 22 0 21 0;
#P connect 6 0 54 0;
#P fasten 7 1 6 0 55 196 39 196;
#P connect 7 0 6 0;
#P connect 2 0 7 0;
#P hidden connect 3 0 2 0;
#P window clipboard copycount 61;


March 17, 2008 | 8:09 pm

For the best, and probably most wizardly solution to this one, check out
the SceneWarp recipe that wraps up Book 3:

http://cycling74.com/story/2006/2/17/153427/406

Happy snacking.

Andrew B.


March 18, 2008 | 4:02 pm

Awesome, I got it to work with a custom shader chain, and it looks amazing. All bow to supreme wizard benson…
Thanks for your help guys!


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