Forums > Jitter

Implementing Open GL render into a Video Mixer

August 28, 2013 | 9:03 am


I am trying to implement some Open GL rendering into a live video mixer for a project I am working on. In this example, I am using Andrew Benson’s "Scramble" patch from the jitter recipes, and trying to be able to blend it’s output with movies using a 3 way video fader. I plan on using different renders in the final patch, but this is just an example. Does anyone have any advice?

– Pasted Max Patch, click to expand. –
August 28, 2013 | 10:40 am

Please start by doing "Copy compressed" instead into here. That’ll help.

August 28, 2013 | 10:44 am

Sorry for the long code. Here’s the compressed code:

– Pasted Max Patch, click to expand. –
September 2, 2013 | 12:09 pm

in order to turn a gl scene into a matrix that can be processed with standard matrix operators like jit.op, you should use
you’ve done this in your patch, but you haven’t connected the matrix output from gl.asyncread to your jit.op video mixer.

doing this makes your patch work as expected.

however, reading back an opengl scene from the GPU to the CPU (which is what gl.asyncread does) is not a very efficient technique. a much better solution is to use for each channel of your video mixer, and overlay the videos onto the 3D scene, controlling there color with the @color attribute.
make sure you set @depth_enable 0 @blend_enable 1 on your

September 3, 2013 | 4:26 pm

hi, i have a problem which I believe is similar, if I understand. I am trying to process every colorchannel separatly and then blend them together in the end. however, I end up with a picture that is not very bright and where the colors don’t match the original.

I think there must be a trick with blending everything correctly?


– Pasted Max Patch, click to expand. –


September 4, 2013 | 11:04 am

you need to change the blend mode to make this work.
on each of you, set @blend add.
you can then adjust the amount using the actual RGB color value for each layer, rather than the alpha value.

September 5, 2013 | 5:07 pm

hey, big thanks for your help, sounds exactly what I was looking for!!
now, so I added @blend add to each videoplane, but now I can’t get the different videoplanes to blend at all… I tried deleting the @layer attribute, then it works again but looks like before. would I have to adjust the RGB color val in a different way than I did until now?

sorry, I feel quite thick…


– Pasted Max Patch, click to expand. –


September 5, 2013 | 8:28 pm

I am now trying to send the output of two separate video mixers to two separate videoplanes in the same window. I have named all render destinations with the same name. I am not really sure what has gone wrong here…


– Pasted Max Patch, click to expand. –


September 6, 2013 | 10:58 am

@Mativa – you need @depth_enable 0 on your videoplanes

@Jpratcliffe – your patch works as expected for me.

September 10, 2013 | 2:26 pm

@rob ramirez – still no luck… also, the attribute @blend add doesn’t seem to exist, tried @blend_add too but nothing… do you think you could modify my patch and show me how it’s done? sorry if this is kind of bold, I am getting desperate…

ps, maybe it doesn’t work because i am still on max5?

September 10, 2013 | 3:17 pm

@blend is not available on max 5.
use @blend_mode 1 1 instead


– Pasted Max Patch, click to expand. –


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