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!!!
what about jit.scissors?
also, you may try jit.gl.cornerpin for keystone correction.
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!!!
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?
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.
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 :
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!!!
this patch gives a significant improvement on cpu performance, loading a movie at 3072x768 using the submatrix I have 11fps, with this patch I have 16fps.. not bad!
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.
@ 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
@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: https://cycling74.com/forums/slab-compositing-and-colormodes
You can use number boxes instead of pattrui to store values in presets:
...I mean "attrui"
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?
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:
we can use the pattr object's @bindto attribute to bind the pattr to any of a script-named jitter object's attributes:
@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?
@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!
is there any way to set the jit.gl.node background to be transparent?
@erase_color 0 0 0 0
awesome! thanks!!