Improving patcher performance (and avoiding slab to matrix for alpha blending)

Sep 9, 2013 at 7:03pm

Improving patcher performance (and avoiding slab to matrix for alpha blending)

Hi all – I’ve got a patcher that’s nearly done, but I’m not happy with the performance. I read about the vade optimizations (http://abstrakt.vade.info/?p=147) – and watched the cycling74 tutorial on optimization – http://www.youtube.com/watch?v=8xwdbdljAKA. I’ve tried various combinations of things to get my framerate up – which you can see in this patch, such as qlim on the preview monitor, unique 1 on the movies, disabling onscreen on the preview window, etc.

One thing I have a feeling is that, while I’m rendering a syphon live camera feed and a movie together on a slab, I later use a matrix to alpha blend that with another video. I feel like there’s a way to accomplish this while maintaining the use of slabs, but I haven’t figured it out.

At any rate, if anyone is willing to have a peak at the patch and suggest some optimizations, or even point me in the right direction, I’d be incredibly grateful. Thanks!

Attachments:
  1. sfx1.maxpat
#264781
Sep 10, 2013 at 12:39am

The patch doesn’t have any video or live feed so it’s impossible to test.

#264799
Sep 10, 2013 at 4:45am

Yes – the live videos are pulled in from a text file – each one that I’m using is about 2GB so I can’t attach them. I was more just hoping someone could look at the patch and see if there’s anything I’m doing that seems like it would cause a performance bottleneck, or could be optimized.

#264822
Sep 10, 2013 at 10:18am

you will definitely get better performance if you remove the readback to jit.matix.
alphablending is very simple to achieve in GL land (once you know a few details).

simply overlay two gl.videoplanes, with @depth_enable 0, @blend_enable 1, and control the layer order with @layer attribute.

<code>

– Pasted Max Patch, click to expand. –

</code>

#264875
Sep 11, 2013 at 5:57am

This is great! Definitely faster. Is there any way to still have a preview of the entire composition now that things are separated in to two video planes? Before it was stemming off the combined matrix – but now that combination is only happening from a blend parameter off two different objects.

#264980

You must be logged in to reply to this topic.