Overlay jit.render over video
I’m building a patch which draws trails that follow the images coming the camera (see attachment). To do this, I’m using the cv.jit.touches object and cv.jit.touches.recycle abstraction ( http://jmpelletier.com/using-cv-jit-touches-recycling-index-values/ ).
I then send the "touch/drag/release) values to a poly~ object (I guess it’s not very an ortodox method, but I needed to identify every trail by number) which generates the circles and trails that follow the blobs. I took inspiration from this topic for the "Trail" patch: http://cycling74.com/forums/topic.php?id=14726 .And everything works.
As you can see in the attached patches (MultiTrailsExample_NOGL.maxpat), my first attempt to mix the rendered trails and the video was made in the "matrix world", using jit.op to overlay the two matrices.
But I was looking to obtain the same effect in "GL world" (MultiTrailsExample_GL.maxpat), in order to achieve some performance benefit by using the GPU: I got it to work using jit.gl.videoplane.
And here come the questions:
1) in the first case (NO GL), I’m forced to send the overlayed video to a jit.pwindow, because as I try to switch to a jit.window I get lots of buffer underflow and overflow messages (actually, the video is correctly displayed, but I get this bunch of errors which I’m afraid of…).
2) in the second case (GL), it seems that the "erase_alpha" is ignored, and so I have no "motion blur" effect when the circles move. Is there a way to obtain that effect?
3) the patch works on Max 5, but it seems not to work at all on Max 6. Any ideas?
Thanks in advance