alternative to submatrix

Mar 19, 2013 at 10:04pm

alternative to submatrix

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. –
#67201
Mar 19, 2013 at 10:38pm

what about jit.scissors?

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

#241830
Mar 19, 2013 at 11:01pm

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!!!

#241831
Mar 20, 2013 at 9:57am

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. –
#241832
Mar 20, 2013 at 6:16pm

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. –
#241833
Mar 21, 2013 at 12:13pm

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. –
#241834
Mar 21, 2013 at 12:16pm

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!!!

#241835
Mar 24, 2013 at 12:56am

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. –
#241836
Mar 24, 2013 at 9:16am

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. –
#241837
Mar 29, 2013 at 11:22pm

@ 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. –
#241838
Mar 30, 2013 at 9:51am

@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

#241839
Mar 30, 2013 at 10:01am

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

– Pasted Max Patch, click to expand. –
#241840
Mar 30, 2013 at 1:28pm

…I mean “attrui”

#241841
Mar 31, 2013 at 9:47am

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?

#241842
Mar 31, 2013 at 4:24pm

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. –
#241843
Mar 31, 2013 at 7:07pm

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. –
#241844
Mar 31, 2013 at 10:39pm

@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. –
#241845
Mar 31, 2013 at 11:18pm

@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!

#241846
Apr 1, 2013 at 2:49pm

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

#241847
Apr 1, 2013 at 3:33pm

@erase_color 0 0 0 0

#241848
Apr 1, 2013 at 4:01pm

awesome! thanks!!

#241849

You must be logged in to reply to this topic.