modulating alpha videoplane

julienrobert's icon

I realized today that my jitter patch is slowed down by modulating the alpha of a videoplane. I want to map the amplitude of the sound to the alpha of some videoplanes. I used speedlim 30 to avoid it to be modulated faster than the speed of the images.

Someone has an idea how to do it without losing performance?

Thanks!

jaeho's icon

I'm not really sure but
[ jit.qball ] instead of [ speedlim ] might help.

julienrobert's icon

I tried to use jit.qball instead of speedlim or one after the other and it's about the same.

When I remove that mapping, I win 10 fps more on 8 videoplanes at the same time. It's quite a lot and make think about removing that mapping...

Wesley Smith's icon

How are you modulating the alpha channel? Could you post a simple patch that demonstrates the technique?

julienrobert's icon

with pleasure

Max Patch
Copy patch and select New From Clipboard in Max.

note that it is normally inside a M4L device.

Thanks

Wesley Smith's icon

I see no reason why this patch would cause a significant slowdown. It's not doing anything computationally intensive. You could get rid of the unpack/pack combo in favor of [zl slice 3] and reduce your object count though.

jaeho's icon

Hmm... julienrobert,
the patch you attached is not sufficient to guess the reason.

But I'm trying to guess:
Since slow-down problems when working with open-gl objects are often caused by multiple, traditional Max timing objects such as [ metro ], [ snapshot ], [ line ], etc., I'd recommend you to check if you are using [ metro ] instead of [ qmetro ], and try to use only one [ qmetro ] as a 'master clock'.

This is also why I told you to use [ jit.qball ] instead of [ speedim ] in the last post of mine.

julienrobert's icon

Yes, I'm using a qmetro 30 as a master clock for all the videoplanes.

Note that I'm modulating the alpha of 8 videoplanes at the same time and together, when I shut the modulation off, I save about 10 fps. It means that each modulated alpha reduces the fps of about 1-2 fps...

Wesley Smith's icon

Do you have depth_enable on or of? How big is the window and do the videoplanes fill the entire window? When you overdraw a window many times, you can start to become fill rate bound, meaning the GPU can't process the number of pixels you're asking it to. If you could make a normal Max patch that demonstrates the same problem, that would help.

julienrobert's icon

ok. I've found that the patch works well in Max alone. The problem comes when I use it inside M4L.
This is the live set with the M4L device.

I tried to clean the patch the much as I could.

3130.demolivedelay2Project.zip
zip
julienrobert's icon

deph enable = 0

it's running around 20 fps with modulating alpha activated and above 25 fps when it's off. keep in mind that this patch is running 3 videoplanes and in the big patch, there are 5.

macbook pro, 2.8 GHz Intel Core 2 Duo, 8 gig, 10.6.8, NVIDIA GeForce 9400M

thanks