GL Blending Options on a Videoplane

mrmorrisplains's icon

Hi All -

I know this is a much-discussed topic - but after reading some of the previous discussions, I'm still a bit confused..

I've attached a patch that has two GL sections - one is just a qt.movie into a chromakey slab and the other is an isosurf in a chromakey feedback arrangement.

They are mixed together via an xfade slab.

What I would like is for the isosurf feedback to crisply overlap the background image, without blending and whitening the image.

I realize that another chromakey slab could remove the white background from the feedback channel and impose the video, but this potentially creates different kinds of sloppiness - especially if I decide to change the color of the isosurf or the feedback starts to get heavy.

Is there a better way to do this?

double-nickels-on-the-dime.maxpat
Max Patch
Andro's icon

Hi there, I had the same problem, just use jit.gl.pix. This works on 4 texture layers and keeps the alpha channel data intact.
Just open it up and add the 2 inputs together, add a param object call it crossfade and your done.

mrmorrisplains's icon

Hmm... I'm not super familiar with the gl.pix object - it seems to have the two inputs added together already and it seems to be using the feedback slab as an alpha mask? Can you show me what you mean?

Rob Ramirez's icon

you don't need to use chromakeying for this.
you simply set the @erase_color attribute of jit.gl.node to 0 0 0 0

then you can overlay the isosurf texture directly onto the background image using to gl.videoplanes with blending enabled.

double-nickels-on-the-dime1.maxpat
Max Patch
mrmorrisplains's icon

Thanks Rob!

It does seem that the feedback produces a very different outcome in this arrangement, though. Is it possible to gain a similar effect with a chromakey slab?

Throwing one in the effect chain does seem to produce the desired result, initially - but the background image disappears when I go full screen...

double-nickels-on-the-dime2.maxpat
Max Patch
mrmorrisplains's icon

If I use the Fullscreen mode to reset the Chromakey color, it seems to work alright.. Not sure if this is the most efficient way to pull this off.. Any idea why it works this way?

double-nickels-on-the-dime21.maxpat
Max Patch
mrmorrisplains's icon

Is there a good tutorial on dealing with layering and planes?

Rob Ramirez's icon

feedback effects are generally pretty sensitive to rebuilding the context (which is what happens when you go fullscreen).

what are you curious about regarding layering?

mrmorrisplains's icon

I'm just in over my head, I'm afraid.

Here's a patch using the layering idea you showed me - but I can't get it to behave the way I'd like - the top layer seems to be working as an either an alpha mask or a pretty faded layer, rather than a hard superimposition. (Depending on the erase_color)...

I feel a little guilty taking up forum space and your generosity with this - is it possible to contact you for freelance work?

a-mess-a-mess.maxpat
Max Patch
Rob Ramirez's icon

again, if you want a hard-mix, then why do you need the chromakey?
setting gl.node @erase_color to 0 0 0 0 does exactly this.
when i remove the chromakey slab in your patch, i get this.

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

granted, since you are using jit.noise as your texture, certain alpha values will be transparent on the individual cube textures. if you don't want the cubes transparent, jit.pack a 3 plane noise matrix with a 1 plane, all white matrix as the alpha plane (which is the first plane for jitter matrices).

Rob Ramirez's icon

and no need to feel guilty, this is what the forum is for.

hthaw's icon

Huh...even after removing the chromakey slab, I still get a weird-looking pack, image attached..

As for the chromakey - it just seems to have a very substantially different characteristic than xfade feedback, since it doesn't lose strength with each reiteration. The xfade is blending a difference between the input image and the feedback reiterations.

abcd.jpg
jpg
mrmorrisplains's icon

Oops - I think I posted that last post on a different account.. still struggling with this issue, though. Is it maybe better dealt with via a specialized slab?