[jitter] Bug (?) with jit.gl.slab and @automatic 0
Joshua Kit Clayton
jkc at musork.com
Wed Jan 9 14:51:43 MST 2008
- Previous message: [jitter] Bug (?) with jit.gl.slab and @automatic 0
- Next message: [jitter] Sharing is Fun [ was re: slab bug]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Jan 9, 2008, at 1:28 PM, Joshua Kit Clayton wrote: > The solution to such a situation is to just add an instance of > jit.gl.texture, which is banged by your gate instead, as the > attached modified patch demonstrates, or to have a single frame > delay stage which works differently than your logic (i.e. doesn't > update the right input immediately following, but instead keeps in > an external jit.gl.texture and updates immediately *before* sending > the current frame into the jit.gl.slab). Okay, I got all excited by taking some time to play with Jitter (rather than being nose deep in Max 5 development), that I kept fooling around and figured I should show you how to do this latter approach (since that's probably more what you want for your frame blending). This is actually pretty tricky to do if you don't know exactly how texture's dynamic mode works, and how jit.gl.slab uses the incoming texture name rather than copying. To have a true delay line which copies the data so that it can work with such a strategy, you'll need to do something like the following. If you don't want the extra CPU data copy that texture mode static employs you could just add another jit.gl.texture -> jit.gl.slab @thru 0 after the top right hand jit.gl.slab. Kinda tricky, I know, but these thigns are done to make the GPU code faster. Let me know if you have any questions. -Joshua #P window setfont "Sans Serif" 9.; #P window linecount 3; #P comment 769 355 298 196617 Also note that we need to use "static" texture mode \, otherwise the texture maintains a "dynamic" reference to the incoming matrix data--i.e. it is not copied \, so it's not a real delay stage; #P window linecount 1; #P message 768 402 107 196617 sendinput mode static; #P window linecount 3; #P comment 768 313 298 196617 note we use @thru 0 for jit.gl.slab \, bang to send the old frame \, then process the new frame \, keeping in this slab until the next frame is to be processed; #P window linecount 1; #P message 625 634 58 196617 gettexture; #P newex 742 701 62 196617 prepend set; #P window linecount 0; #P message 741 723 227 196617; #P window linecount 1; #P newex 756 514 269 196617 jit.gl.texture v001 @automatic 0 @adapt 1 @name righty; #P window linecount 4; #P comment 772 458 298 196617 also note that we *need* an extra jit.gl.texture since slab/texture inputs to another slab don't copy \, they just use the texture input by name. you can see this by sending the message "gettexture" to jit.gl.slab; #P user gswitch 317 400 41 32 0 0; #P window linecount 1; #P newex 425 506 263 196617 jit.gl.texture v001 @automatic 0 @adapt 1 @name lefty; #P newex 449 451 27 196617 b; #P user jit.fpsgui 449 471 60 196617 0; #P user jit.fpsgui 538 309 60 196617 0; #P message 302 121 107 196617 jitter glreadback fbo \;; #P message 303 104 106 196617 jitter glreadback rtt \;; #P newex 395 317 53 196617 t b l l b; #P newex 756 423 366 196617 jit.gl.slab v001 @automatic 0 @file cc.uyvy2rgba.jxs @dimscale 2. 1. @thru 0; #P flonum 557 583 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P newex 463 621 103 196617 pak param amount 0.; #P flonum 442 247 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0; #P message 441 267 44 196617 rate \$1; #P newex 425 423 327 196617 jit.gl.slab v001 @automatic 0 @file cc.uyvy2rgba.jxs @dimscale 2. 1.; #P newex 425 667 327 196617 jit.gl.slab v001 @automatic 0 @file co.normal.jxs @param amount 20.; #P message 395 171 30 196617 read; #P newex 276 765 269 196617 jit.gl.videoplane v001 @transform_reset 2 @automatic 0; #P newex 395 286 286 196617 jit.qt.movie @adapt 1 @unique 1 @colormode uyvy @rate 0.1; #P newex 275 198 40 196617 t b b b; #P toggle 120 89 15 0; #P newex 120 115 51 196617 qmetro 2; #P newex 120 153 58 196617 t b b erase; #P newex 180 788 157 196617 jit.window v001 @depthbuffer 1; #P newex 120 306 92 196617 jit.gl.render v001; #P comment 438 171 341 196617 load a movie please.; #P user panel 306 393 65 47; #X brgb 255 0 0; #X frgb 0 0 0; #X border 1; #X rounded 0; #X shadow 0; #X done; #P connect 32 0 17 0; #P fasten 18 3 17 0 442 355 761 355; #P connect 24 0 11 0; #P connect 8 0 18 0; #P connect 8 0 21 0; #P connect 18 2 12 0; #P fasten 18 1 17 0 415 384 761 384; #P connect 11 0 9 0; #P connect 17 0 27 0; #P connect 27 0 11 1; #P connect 30 0 11 0; #P connect 11 1 29 0; #P connect 29 0 28 0; #P connect 12 0 24 0; #P connect 12 0 23 0; #P connect 25 0 11 0; #P connect 16 0 15 2; #P connect 23 0 22 0; #P connect 14 0 13 0; #P connect 15 0 11 0; #P connect 13 0 8 0; #P connect 10 0 8 0; #P connect 7 2 8 0; #P connect 7 1 25 2; #P connect 7 0 9 0; #P fasten 4 1 7 0 149 184 280 184; #P connect 4 2 2 0; #P connect 4 0 2 0; #P connect 5 0 4 0; #P connect 6 0 5 0; #P window clipboard copycount 34;
- Previous message: [jitter] Bug (?) with jit.gl.slab and @automatic 0
- Next message: [jitter] Sharing is Fun [ was re: slab bug]
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
