Forums > Jitter

videoplane blend_mode translation

October 27, 2011 | 8:44 pm

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!


October 27, 2011 | 8:49 pm

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


October 27, 2011 | 9:56 pm

thank you so much

I finally have these valuable pairs!



FP
November 2, 2011 | 1:23 pm

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

– Pasted Max Patch, click to expand. –


FP
November 2, 2011 | 1:59 pm

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


November 2, 2011 | 4:01 pm

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
November 9, 2011 | 9:28 am

thx a lot Wesley, that’s clear.


Viewing 7 posts - 1 through 7 (of 7 total)