Implementing Open GL render into a Video Mixer

Aug 28, 2013 at 9:03am

Implementing Open GL render into a Video Mixer

Hello,

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. –
#260136
Aug 28, 2013 at 10:40am

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

#260145
Aug 28, 2013 at 10:44am

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

– Pasted Max Patch, click to expand. –
#260146
Sep 2, 2013 at 12:09pm

in order to turn a gl scene into a matrix that can be processed with standard matrix operators like jit.op, you should use jit.gl.asyncread.
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 jit.gl.videoplanes 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 jit.gl.videoplanes.

#264031
Sep 3, 2013 at 4:26pm

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?

<code>

– Pasted Max Patch, click to expand. –

</code>

#264149
Sep 4, 2013 at 11:04am

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

#264267
Sep 5, 2013 at 5:07pm

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…

<code>

– Pasted Max Patch, click to expand. –

</code>

#264425
Sep 5, 2013 at 8:28pm

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…

<code>

– Pasted Max Patch, click to expand. –

</code>

#264429
Sep 6, 2013 at 10:58am

@Mativa – you need @depth_enable 0 on your videoplanes

@Jpratcliffe – your patch works as expected for me.

#264505
Sep 10, 2013 at 2:26pm

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

#264895
Sep 10, 2013 at 3:17pm

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

<code>

– Pasted Max Patch, click to expand. –

</code>

#264898

You must be logged in to reply to this topic.