Forums > Jitter

should be a basic task

May 3, 2007 | 8:30 am

I try to render to a preview and a performance screen.
It should be a basic task for a jitter patch.

Of course the "drawto" message can only draw to one destination at a time.
My patch should be able to use either the preview or the performance screen, or both.

@shared_context only permit to share context, not to choose first destination, second, or both.

Things aren’t very clear in the doc, and there is no trace for @shared_context in jitter tutorials.

Forum archives gives complexes solutions which are contradicted.
I spent much time on them without satisfaction.

Could someone clear the way, the simplest one to have a "double" rendering with choice of configuration.

Thank you very much.


May 3, 2007 | 8:45 am

#P window setfont "Sans Serif" 9.;
#P window linecount 4;
#P comment 362 110 100 196617 specify shared context and texture to
copy the render result to;
#P window linecount 1;
#P newex 159 310 300 196617 jit.gl.videoplane pview @transform_reset 2
@texture pviewTex;
#P newex 159 279 171 196617 jit.gl.texture test @name pviewTex;
#P newex 272 180 257 196617 jit.gl.gridshape test @scale 0.5 0.5 0.5
@color 1 0 0 1;
#P toggle 92 240 15 0;
#N vpatcher 53 128 279 297;
#P inlet 106 30 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 43 95 47 196617 gate 1 1;
#P newex 42 116 41 196617 s draw;
#P window linecount 1;
#P newex 17 52 58 196617 t b b erase;
#P inlet 17 32 15 0;
#P outlet 17 83 15 0;
#P connect 1 0 2 0;
#P fasten 2 2 0 0 70 75 22 75;
#P connect 2 0 0 0;
#P connect 4 0 3 0;
#P fasten 5 0 4 0 111 88 48 88;
#P fasten 2 1 4 1 46 83 85 83;
#P lcolor 15;
#P pop;
#P newobj 30 269 42 196617 p Draw;
#P toggle 159 210 15 0;
#P message 159 230 68 196617 fullscreen $1;
#N vpatcher 30 89 166 253;
#P window setfont "Sans Serif" 9.;
#P newex 50 71 35 196617 sel 27;
#P newex 50 50 40 196617 key;
#P outlet 50 93 15 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P pop;
#P newobj 159 190 33 196617 p Esc;
#P newex 159 248 225 196617 jit.window pview @size 120 90 @depthbuffer 1;
#P toggle 30 221 15 0;
#P newex 30 240 57 196617 qmetro 30;
#P newex 30 294 95 196617 jit.gl.render pview;
#P toggle 87 89 15 0;
#N vpatcher 53 128 279 297;
#P inlet 106 30 15 0;
#P window setfont "Sans Serif" 9.;
#P window linecount 0;
#P newex 43 95 47 196617 gate 1 1;
#P newex 42 116 41 196617 s draw;
#P window linecount 1;
#P newex 17 52 58 196617 t b b erase;
#P inlet 17 32 15 0;
#P outlet 17 83 15 0;
#P connect 1 0 2 0;
#P fasten 2 2 0 0 70 75 22 75;
#P connect 2 0 0 0;
#P connect 4 0 3 0;
#P fasten 5 0 4 0 111 88 48 88;
#P fasten 2 1 4 1 46 83 85 83;
#P lcolor 15;
#P pop;
#P newobj 25 118 42 196617 p Draw;
#P toggle 154 59 15 0;
#P message 154 79 68 196617 fullscreen $1;
#N vpatcher 30 89 166 253;
#P window setfont "Sans Serif" 9.;
#P newex 50 71 35 196617 sel 27;
#P newex 50 50 40 196617 key;
#P outlet 50 93 15 0;
#P connect 1 0 2 0;
#P connect 2 0 0 0;
#P pop;
#P newobj 154 39 33 196617 p Esc;
#P newex 154 97 151 196617 jit.window test @depthbuffer 1;
#P message 115 97 34 196617 reset;
#P newex 115 118 186 196617 jit.gl.handle test @inherit_transform 1;
#P toggle 25 70 15 0;
#P newex 25 89 57 196617 qmetro 30;
#P newex 25 143 316 196617 jit.gl.render test @shared_context pview
@copy_texture pviewTex;
#P window linecount 2;
#P comment 344 278 100 196617 can bind in pview because it’s shared;
#P connect 3 0 2 0;
#P connect 2 0 10 0;
#P connect 10 0 1 0;
#P fasten 4 0 1 0 120 139 30 139;
#P connect 14 0 13 0;
#P connect 13 0 19 0;
#P connect 19 0 12 0;
#P fasten 11 0 10 1 92 111 62 111;
#P fasten 20 0 19 1 97 262 67 262;
#P connect 5 0 4 0;
#P connect 7 0 9 0;
#P connect 9 0 8 0;
#P connect 8 0 6 0;
#P connect 16 0 18 0;
#P connect 18 0 17 0;
#P connect 17 0 15 0;
#P window clipboard copycount 25;


May 3, 2007 | 3:58 pm

thanks a lot.

Derrick


May 3, 2007 | 5:44 pm

Hi, sorry to insist
It works fine in argb colormode, not in uyvy.
I don’t see any reason for.

Please take a look :

max v2;
#N vpatcher 265 164 1115 675;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 661 77 48 196617 loadbang;
#P newex 311 164 27 196617 + 1;
#P user ubumenu 311 137 100 196617 0 1 1 0;
#X add colormode argb;
#X add colormode uyvy;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P newex 515 207 38 196617 gate 2;
#P newex 543 259 184 196617 jit.gl.slab perf @file cc.uyvy2rgba.jxs;
#P newex 523 62 30 196617 t b b;
#P toggle 522 18 15 0;
#P newex 522 42 57 196617 qmetro 30;
#P toggle 56 143 15 0;
#P newex 56 160 47 196617 gate 1 1;
#P toggle 106 143 15 0;
#P newex 106 160 47 196617 gate 1 1;
#P newex 93 94 111 196617 t b b erase;
#P newex 106 281 263 196617 jit.gl.videoplane perf @transform_reset 2 @texture tex;
#P message 618 123 29 196617 stop;
#P message 584 123 33 196617 start;
#P newex 584 103 41 196617 sel 1 0;
#P newex 543 169 167 196617 jit.qt.movie 320 240 @autostart 1;
#P message 661 96 76 196617 read bball.mov;
#P comment 142 227 296 196617 specify shared context and texture to copy the render result to;
#P newex 55 406 254 196617 jit.gl.videoplane ap @transform_reset 2 @texture tex;
#P newex 515 308 143 196617 jit.gl.texture perf @name tex;
#P newex 55 386 208 196617 jit.window ap @size 120 90 @depthbuffer 1;
#P newex 56 363 78 196617 jit.gl.render ap;
#P newex 106 260 152 196617 jit.window perf @depthbuffer 1;
#P newex 106 240 271 196617 jit.gl.render perf @shared_context ap @copy_texture tex;
#P window linecount 2;
#P comment 528 333 100 196617 can bind in pview because it’s shared;
#P window linecount 1;
#P comment 269 117 213 196617 shared_context seems impossible in uyvy ??;
#P connect 19 0 18 0;
#P connect 15 2 4 0;
#P connect 18 0 4 0;
#P fasten 22 0 15 0 528 86 98 86;
#P connect 15 0 18 1;
#P connect 17 0 16 0;
#P connect 15 2 2 0;
#P connect 16 0 2 0;
#P connect 15 1 16 1;
#P connect 25 0 26 0;
#P fasten 26 0 24 0 316 194 520 194;
#P connect 24 0 6 0;
#P connect 23 0 6 0;
#P connect 21 0 20 0;
#P connect 20 0 22 0;
#P fasten 25 1 10 0 361 163 548 163;
#P fasten 9 0 10 0 666 165 548 165;
#P fasten 12 0 10 0 589 163 548 163;
#P fasten 13 0 10 0 623 163 548 163;
#P connect 22 1 10 0;
#P connect 10 0 24 1;
#P connect 24 1 23 0;
#P fasten 21 0 11 0 527 37 589 37;
#P connect 11 0 12 0;
#P fasten 11 1 13 0 604 121 623 121;
#P connect 27 0 9 0;
#P pop;


May 3, 2007 | 6:01 pm

You’re lucky that argb was even working. It wasn’t for me. You were
badly abusing textures in your patch. You had the same texture as
both a copy destination for jit.gl.render and a copy target from
jit.qt.movie/jit.gl.slab. This is bad! The texture was getting
corrupted. Here’s a fixed patch:

wes

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P newex 512 305 152 196617 jit.gl.texture perf @name video;
#P user jit.pwindow 402 341 82 62 0 1 0 0 1 0;
#P newex 539 260 184 196617 jit.gl.slab perf @file cc.uyvy2rgba.jxs;
#P newex 668 84 48 196617 loadbang;
#P newex 318 171 27 196617 + 1;
#P user ubumenu 318 144 100 196617 0 1 1 0;
#X add colormode argb;
#X add colormode uyvy;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P newex 522 214 38 196617 gate 2;
#P newex 530 69 30 196617 t b b;
#P toggle 529 25 15 0;
#P newex 529 49 57 196617 qmetro 30;
#P toggle 63 150 15 0;
#P newex 63 167 47 196617 gate 1 1;
#P toggle 113 150 15 0;
#P newex 113 167 47 196617 gate 1 1;
#P newex 100 101 111 196617 t b b erase;
#P newex 113 288 272 196617 jit.gl.videoplane perf @transform_reset 2
@texture video;
#P message 625 130 29 196617 stop;
#P message 591 130 33 196617 start;
#P newex 591 110 41 196617 sel 1 0;
#P newex 550 176 167 196617 jit.qt.movie 320 240 @autostart 1;
#P message 668 103 76 196617 read bball.mov;
#P comment 149 234 296 196617 specify shared context and texture to
copy the render result to;
#P newex 62 413 254 196617 jit.gl.videoplane ap @transform_reset 2 @texture tex;
#P newex 488 410 143 196617 jit.gl.texture perf @name tex;
#P newex 62 393 208 196617 jit.window ap @size 120 90 @depthbuffer 1;
#P newex 63 370 78 196617 jit.gl.render ap;
#P newex 113 267 152 196617 jit.window perf @depthbuffer 1;
#P newex 113 247 271 196617 jit.gl.render perf @shared_context ap
@copy_texture tex;
#P window linecount 2;
#P comment 641 405 100 196617 can bind in pview because it’s shared;
#P window linecount 1;
#P comment 276 124 213 196617 shared_context seems impossible in uyvy ??;
#P connect 23 1 27 0;
#P connect 23 0 28 0;
#P connect 23 0 29 0;
#P connect 27 0 29 0;
#P connect 26 0 9 0;
#P fasten 11 1 13 0 611 128 630 128;
#P connect 11 0 12 0;
#P connect 21 0 20 0;
#P fasten 21 0 11 0 534 44 596 44;
#P connect 10 0 23 1;
#P connect 22 1 10 0;
#P fasten 13 0 10 0 630 170 555 170;
#P fasten 12 0 10 0 596 170 555 170;
#P fasten 9 0 10 0 673 172 555 172;
#P fasten 24 1 10 0 368 170 555 170;
#P connect 20 0 22 0;
#P fasten 25 0 23 0 323 201 527 201;
#P connect 24 0 25 0;
#P connect 15 1 16 1;
#P connect 16 0 2 0;
#P connect 15 2 4 0;
#P connect 15 2 2 0;
#P connect 17 0 16 0;
#P connect 15 0 18 1;
#P fasten 22 0 15 0 535 93 105 93;
#P connect 18 0 4 0;
#P connect 19 0 18 0;
#P window clipboard copycount 30;


May 3, 2007 | 6:25 pm

On May 3, 2007, at 10:44 AM, derrickgiscloux wrote:

> jit.gl.slab perf @file cc.uyvy2rgba.jxs;

Also, you probably already know this and were just making a quick
example patch, but just in case, you need to use the "@dimscale 2.
1." attribute when doing the above conversion in a shader to make the
half size X axis of UYVY into the correct size of RGBA. It won’t look
as nice.

-Joshua


May 3, 2007 | 7:09 pm

Okay, thank you very much.
These suggestions gives me some orientation.
… though I’d like and will wait for "in-depth" clarifications at next jitter release tutorials … perhaps …

Thanks again.

Derrick


May 3, 2007 | 7:20 pm

Don’t expect too much in the way of "in-depth" clarifications in
J1.6.3. If you have any questions, ask now. The basic thing you were
doing wrong was reusing a texture that was being filled with video
data and then having the rendered scene copied to it. The shared
context thing makes texture resources available in multiple contexts.
jit.gl.render @copy_texture simply specifies a texture for the
rendered scene to be copied to when the buffer swap occurs.

wes

On 5/3/07, derrickgiscloux wrote:
>
> Okay, thank you very much.
> These suggestions gives me some orientation.
> … though I’d like and will wait for "in-depth" clarifications at next jitter release tutorials … perhaps …
>
> Thanks again.
>
> Derrick
>


May 3, 2007 | 8:29 pm

>Okay, thank you very much.
>These suggestions gives me some orientation.
>… though I’d like and will wait for "in-depth" clarifications at
>next jitter release tutorials … perhaps …

You don’t have to wait very long. Tutorial 1 explains to you on its first page
what the default behavior of a QuickTime movie loaded into a jit.qt.movie
object is, and it even tells you how NOT to autostart playback.

You can find a description of the rate message in the section of Tutorial 4
(Controlling movie playback) labeled "Starting, Stopping, and Slowing
Down." Or, you can use the "stop" or "start" commands described in the
first paragraph of that section.

on the floor there’s a long wooden table/on the table there’s an open book/
on the page there’s a detailed drawing/and on the drawing is the name I took
Gregory Taylor http://www.rtqe.net


May 3, 2007 | 8:47 pm

> Tutorial 1 explains to you on its first page
what the default behavior of a QuickTime movie ….

ah! ok! thank you, what is the link with my texture destination problem ?


May 3, 2007 | 9:05 pm

> ah! ok! thank you, what is the link with my texture destination problem ?

I have no idea either…


May 3, 2007 | 9:16 pm

Can’t I shared_context with others than the one specified with by ??
shared_context messages get no responses :

max v2;
#N vpatcher 1336 53 2373 790;
#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P message 404 234 99 196617 shared_context ap2;
#B color 14;
#P message 403 216 93 196617 shared_context ap;
#B color 14;
#P toggle 296 324 15 0;
#P message 296 343 55 196617 visible $1;
#P newex 56 570 260 196617 jit.gl.videoplane ap2 @transform_reset 2 @texture tex;
#P toggle 57 255 15 0;
#P newex 57 272 47 196617 gate 1 1;
#P newex 56 547 282 196617 jit.window ap2 @size 120 90 @pos 220 100 @depthbuffer 1;
#P newex 57 524 84 196617 jit.gl.render ap2;
#P newex 220 487 254 196617 jit.gl.videoplane ap @transform_reset 2 @texture tex;
#P newex 680 349 152 196617 jit.gl.texture perf @name video;
#P user jit.pwindow 618 289 54 39 0 1 0 0 1 0;
#P newex 697 306 252 196617 jit.gl.slab perf @file cc.uyvy2rgba.jxs @dimscale 2.1;
#P newex 826 130 48 196617 loadbang;
#P newex 562 220 27 196617 + 1;
#P user ubumenu 562 193 100 196617 0 1 1 0;
#X add colormode argb;
#X add colormode uyvy;
#X prefix_set 0 0 0;
#X pattrmode 1;
#P newex 680 260 38 196617 gate 2;
#P newex 688 115 30 196617 t b b;
#P toggle 687 71 15 0;
#P newex 687 95 57 196617 qmetro 30;
#P toggle 221 196 15 0;
#P newex 221 213 47 196617 gate 1 1;
#P toggle 271 196 15 0;
#P newex 271 213 47 196617 gate 1 1;
#P newex 258 147 111 196617 t b b erase;
#P newex 487 401 272 196617 jit.gl.videoplane perf @transform_reset 2 @texture video;
#P message 783 176 29 196617 stop;
#P message 749 176 33 196617 start;
#P newex 749 156 41 196617 sel 1 0;
#P newex 708 222 167 196617 jit.qt.movie 320 240 @autostart 1;
#P message 826 149 76 196617 read bball.mov;
#P comment 278 280 296 196617 specify shared context and texture to copy the render result to;
#P newex 582 479 143 196617 jit.gl.texture perf @name tex;
#P newex 220 464 208 196617 jit.window ap @size 120 90 @depthbuffer 1;
#P newex 221 441 78 196617 jit.gl.render ap;
#P newex 296 361 270 196617 jit.window perf @depthbuffer 1 @pos 100 220 @visible 0;
#P newex 271 293 271 196617 jit.gl.render perf @shared_context ap @copy_texture tex;
#P window linecount 2;
#P comment 735 474 100 196617 can bind in pview because it’s shared;
#P connect 32 0 31 0;
#P connect 31 0 29 0;
#P fasten 13 0 31 1 263 179 99 179;
#P connect 17 0 16 0;
#P connect 13 2 3 0;
#P connect 16 0 3 0;
#P fasten 20 0 13 0 693 139 263 139;
#P connect 13 0 16 1;
#P connect 15 0 14 0;
#P connect 36 0 1 0;
#P connect 37 0 1 0;
#P connect 14 0 1 0;
#P connect 13 2 1 0;
#P connect 35 0 34 0;
#P connect 34 0 2 0;
#P connect 13 1 14 1;
#P connect 22 0 23 0;
#P fasten 21 0 26 0 685 283 624 283;
#P fasten 23 0 21 0 567 247 685 247;
#P connect 25 0 27 0;
#P connect 21 0 27 0;
#P connect 19 0 18 0;
#P connect 18 0 20 0;
#P connect 21 1 25 0;
#P connect 20 1 8 0;
#P fasten 11 0 8 0 788 216 713 216;
#P fasten 10 0 8 0 754 216 713 216;
#P fasten 7 0 8 0 831 218 713 218;
#P fasten 22 1 8 0 612 216 713 216;
#P connect 8 0 21 1;
#P fasten 19 0 9 0 692 90 754 90;
#P connect 9 0 10 0;
#P fasten 9 1 11 0 769 174 788 174;
#P connect 24 0 7 0;
#P pop;


May 3, 2007 | 9:17 pm

by "attribut" (sorry arobas doesn’t seems to appear)


May 3, 2007 | 9:40 pm

Hm. I can’t get it to work either. I’m going to have to take some
time to look at this later.

wes

On 5/3/07, derrickgiscloux wrote:
>
> by "attribut" (sorry arobas doesn’t seems to appear)
>


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