Thanks much Rob – that helps a lot! Iâ€™ve been digging into learning the wonderful world of jit.gl.pix; seems it can be very useful as I further develop the patch.
Iâ€™m sure there will be some things that will still need to be done with matrices, but it certainly seems that for speedâ€™s sake I should do as much as possible on the GL side. One thing Iâ€™m trying do is distort the images and alphas something like the jit.repos-distortquad example. Iâ€™ve attached my revised patch showing how Iâ€™m using it – (See blue objects in the multilayer_stuff patcher.) Since I end up having to apply the distortion eight times – (4 videos, RGB + alpha for each), it slows things down. (And Iâ€™m still using it at 320×240 as in the original example – when I take it up to 854×480 itâ€™s extremely slow.) It seems like that type of distortion effect might be fairly straightforward to do with jit.gl, but I havenâ€™t found a similar example. I can imagine it could be done by distorting a textured mesh – but then I lose the alpha blending from the videoplanes. So perhaps a shader? Is there perhaps a similar example out there Iâ€™m missing? Iâ€™m not sure how to approach writing that from scratch.
Also, I had a couple other general questions about jit.gl.pix:
* Are there performance hits from daisy chaining too many jit.gl.pix objects? I.e. is it faster to combine shader functions into one jit.gl.pix object when possible, or is it ok to keep daisy chaining individual shaders? (I realize itâ€™s sometimes necessary to use separate objects because of vectors vs. pixels).
* Is there a way to give jit.gl.pix objects names, so i can see easily in my code what each one does? A workaround of course would be to put them into descriptively-named subpatchers, but just wondering if there is a way to name them directly.
Re: jit.gl.hap – thanks for the suggestion – I played around with it some. Seems that it will really only help if Iâ€™m not doing any matrix operations on the videos, correct? As soon as I convert to matrix, frame rate slows down, which I guess makes sense. I also tried it without any matrix operations (i.e. the distort-quads) on the videos, but keeping the distorts on the 4 alphas. It didnâ€™t seem to make much difference vs. doing the same with jit.qt.movie in uyvy mode – so I think the distorts on the alphas are bottlenecking it in that case.
Thanks very much again!
Apr 29, 2013 at 7:21am #242116