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?
Please start by doing "Copy compressed" instead into here. That'll help.
Sorry for the long code. Here's the compressed code:
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.
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?
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.
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...
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...
@Mativa - you need @depth_enable 0 on your videoplanes
@Jpratcliffe - your patch works as expected for me.
@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?
@blend is not available on max 5.
use @blend_mode 1 1 instead