Forums > Jitter

alternative to submatrix

March 19, 2013 | 10:04 pm

I am using this patch to subdivide a video content into two projectors (will be more in the future), and I notice that when using submatrix there is a decay in performance. I’ve searched on the forum and seen a couple of alternatives to submatrix using jit.gl.pix, but this approach is still very new to my understanding.. and I cannot connect them to the cornerpin keystone patch.

Can someone advice please? Thanks in advance!!!

– Pasted Max Patch, click to expand. –

March 19, 2013 | 10:38 pm

what about jit.scissors?

also, you may try jit.gl.cornerpin for keystone correction.


March 19, 2013 | 11:01 pm

jit.scissors cuts a single matrix in an uniform fashion, but I need the submatrix dimensions and offset features.

on the other hand jit.gl.cornerpin is just awesome!!! thanks!!!


March 20, 2013 | 9:57 am

This is an approach to using jit.gl.cornerpin with a gen patch as a substitute to submatrix.
Now, how can I give videoplane attributes like position, scale, rotation and alphablend?

– Pasted Max Patch, click to expand. –

March 20, 2013 | 6:16 pm

i may not be understanding what you are trying to do, but the most efficient way to "subdivide" a matrix to different geometries is probably to share the same texture, and use tex_coords to control what part of the texture is drawn where.

if you’d rather use cornerpin, simply replace the videoplanes with gl.cornerpins.

if you want to use both videoplanes and cornerpin, render the videoplanes to a texture using jit.gl.node @capture 1, and send the output texture to the cornerpins.

– Pasted Max Patch, click to expand. –

March 21, 2013 | 12:13 pm

thank you for helping!! i apologize if I am not able to express what I need..

following your advice, if I replace the videoplane by the cornerpin, the cornerpin object doesn’t recognize the messages tex_plane_s and tex_plane_t, wich I would really like to have

I have also tried to follow your second advice, to render the videoplanes to a texture using jit.gl.node without any success.. I understand that I can capture the texture with the jit.gl.node and use it for another purpose, but it just doesn’t work, will you be able to help me solving this?

this is as far as I can go :

– Pasted Max Patch, click to expand. –

March 21, 2013 | 12:16 pm

just to clarify what I really need, is exactly to use (two or more) subdivided matrix, each one on its own geometry with videoplane properties, plus cornerpin properties

thank you so much for helping!!!


March 24, 2013 | 12:56 am

this patch gives a significant improvement on cpu performance, loading a movie at 3072×768 using the submatrix I have 11fps, with this patch I have 16fps.. not bad!

– Pasted Max Patch, click to expand. –

March 24, 2013 | 9:16 am

You can get a significant performance boost working in UYVY colormode while on the CPU and then converting to RGBA when entering the GL domain.

– Pasted Max Patch, click to expand. –

March 29, 2013 | 11:22 pm

@ LSka, why do you say that when entering to GL domain one should convert to RGBA? normally I use UYVY all the way.. please explain

@ Rob Ramirez, I think I finally managed how the gl.node works! thank you for pointing the direction!!

this patch shows a bit of compositing textures inside other textures using gl.node, it is a pitty that cornerpin values aren’t stored inside the presets

– Pasted Max Patch, click to expand. –

March 30, 2013 | 9:51 am

@Guilherme: GPU always processes data in ARGB. UYVY colormode is used to speed up data stream from disk to GPU.
You can find some more info in this thread: http://cycling74.com/forums/topic.php?id=28955


March 30, 2013 | 10:01 am

You can use number boxes instead of pattrui to store values in presets:

– Pasted Max Patch, click to expand. –

March 30, 2013 | 1:28 pm

…I mean "attrui"


March 31, 2013 | 9:47 am

I was also mentioning attrui object, the thing in using the number boxes instead of the attrui is that if you use the mouse to set the corner pin the attrui automatically updates values, and the number boxes don’t

I will leave a patch showing a way to store jit.gl.cornerpin values

Regarding the UYVY, I have a question wich is, if using [jit.qt.movie @colormode uyvy] and sending to a videoplane object, I need to set the videoplane colormode to uyvy, is this correct? normally it is what I do..

or instead should I use a slab with a shader to perform uyvy to argb before sending to the videoplane?


March 31, 2013 | 4:24 pm

mr Joshua Kit Clayton once said:

OS X supports a UYVY texture type, which undergoes a shader based conversion to RGBA as it is loaded into the GPU, but it doesn’t do chroma smoothing or other color corrections, and Windows does not provide any. This is why cc.uyvy2rgba.jxs exists, and it should *always* be used with @dimscale 2 1 like the example jjit.gl.slab-uyvy-gpu.maxpat example, to convert from half chroma horizontal resolution to full horizontal resolution.

So using [jit.gl.slab @file cc.uyvy2rgba.jxs @dimscale 2 1] should give you the best quality available.

Maybe I found a solution for storing presets using pattr:

– Pasted Max Patch, click to expand. –

March 31, 2013 | 7:07 pm

we can use the pattr object’s @bindto attribute to bind the pattr to any of a script-named jitter object’s attributes:

– Pasted Max Patch, click to expand. –

March 31, 2013 | 10:39 pm

@LSka: thank you for clarifying this to me!

@Rob: nice tip! thanks!!

should we use multiple instances of the pattr object in case we need to store multiple attributes any script’named object?

– Pasted Max Patch, click to expand. –

March 31, 2013 | 11:18 pm

@LSka: using [jit.gl.slab @file cc.uyvy2rgba.jxs @dimscale 2. 1.] made my FPS jump from 19 to 30! I think this is the 1st time I am using a shader knowing exactly what it is doing!


April 1, 2013 | 2:49 pm

is there any way to set the jit.gl.node background to be transparent?


April 1, 2013 | 3:33 pm

@erase_color 0 0 0 0


April 1, 2013 | 4:01 pm

awesome! thanks!!


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