Best way to mix a varying number of matrices together

Feb 8, 2014 at 6:48pm

Best way to mix a varying number of matrices together

Hi,

I am trying to make a patch which combines a (potentially quite large) number of video inputs into one matrix. I want to be able to control the opacity of each video. Say there were 5 videos I might like them to all show at 20% opacity, or I might like one to show at 40% and the rest and 15% and so on.

The number of videos may change, so I would like the patch to adapt to this circumstance.

The ways I’ve thought about doing this is with straight jitter and probably javascript or using opengl and slabs (and probably still javascript).

I would really appreciate some feedback on a good approach to aim for because I haven’t done a lot of work with opengl, shaders or javascript within max. I don’t want to dive into shaders right now if it’s not necessary for my project.

Jitter tutorial 43 (a slab of your very own) is pretty much what I want, but I want to make the number of videos variable.

Thanks in advance!

#280440
Feb 9, 2014 at 1:28am

I’d do it with openGL en poly~ by making a poly-voice that contains a jit.qt.movie going into a jit.gl.videoplane for each video. Lets you control the number of video’s by changing the voice count and has messaging built-in for sending commands to individual voices/videos.

#280448
Feb 9, 2014 at 1:29am

Plus the number crunching for mixing your matrices will be off loaded to your graphics card.

Btw, no need for slabs, you can control the mixing with the opacity of the videoplanes (unless you need more funky mixing modes).

#280449
Feb 14, 2014 at 12:20am

Thank you for your response. I had no luck rendering multiple videoplanes with different videos, but I was able to to sequentially add videos to a single videoplane after altering their alpha values and setting the videoplane @blend to alphaadd. Making the number of clips variable is a work in progress, thanks for the poly~ suggestion :)

#281071
Feb 14, 2014 at 3:14pm

Did you set @blend_enable 1 @depth_enable 0 on the videoplanes?

#281142

You must be logged in to reply to this topic.