videoplane blend_mode translation

julienrobert's icon

Someone knows what pair of numbers I have to use inside videoplane to achieve these 3 blending modes?
NORMAL (6 7 I guest)
ADD
LIGHTEN

Here is the project:

I'm planning to do a simple video mixer openGL.

Basically, it will have two banks of videos (720p) each one going to a different videoplane. I want to do compositing between the two videoplanes.

I've read the documentation about blending_mode inside the max help but it did not help me much. Usually, I'm trying each blend mode and choose the one works. But, in that project, I want to know exactly what kind of compositing mode I'm using.

I would like to avoid using slab object for performance issue. This patch needs to be really stable and efficient.

thanks!

Wesley Smith's icon

in Max6, jit.gl. objects have a new attribute for blending @blend, which can take a blending mode name corresponding to particular values for @blend_mode. Here's the list:

@blend -> @blend_mode
add -> 1 1
multiply -> 2 0
coloradd -> 3 1
colorblend -> 3 4
screen -> 4 1
exclusion -> 4 5
alphaadd -> 6 1
alphablend -> 6 7

julienrobert's icon

thank you so much

I finally have these valuable pairs!

FP's icon
Max Patch
Copy patch and select New From Clipboard in Max.

What did I do wrong ? Blend_mode doesn't work anymore for me in max6.
It works perfectly with max5.

FP's icon

it seems I have to add depth_enable 0, could somebody explain me why please ? thx.

Wesley Smith's icon

With @depth_enable 1, the graphics card will remove surfaces that are behind other surfaces. With blending enabled, the order you draw the geometry is very important. If you draw the nearest surface first, the back surface will never appear because the front one blocks it. If you draw the back one first, it will be drawn with the front one on top of it. With @depth_enable 0, no surfaces are removed because there is no depth testing.

FP's icon

thx a lot Wesley, that's clear.