Layering multiple separate png/video blends

Hi all,
I’m trying to create a scene comprised of multiple pngs/jpgs each blended independently with a separate video.

I’d like to do it with pngs, so everything’s transparent except for the particular part of the scene in that file, but when i blend that with video the video fills the transparent area as well as the white area that I want it to show up in (all files are b&w drawings).

I can get it to work with the same pictures as jpgs, the video only shows up in the white area. But then I have to lumakey out the black in order to blend it with the other layers, and the lumakey makes the black parts in the video - as well as the black lines in the original picture - transparent as well which is annoying.
(plus there’s 24 layers, so having 24 extra lumakeys isn’t great for performance)

Is there a way to blend video with a png (or other file that preserves transparency) and not have the video fill the transparent area?

Is there another way to approach this entirely?

Am I stuck with lumakey?

Is there a way to preserve the alpha through the video blend? or to reinstate the picture’s original alpha after the blend?

Thanks for any help!

You could use lumakeying to get the video into the white parts as you already are, then use video.a *=mask.a; to write into the alpha value of your video so it gets lumakeyed then the masks alpha is applied. (video and mask refer to what ever the input texture are in your shader of course)
Does that make sense?
If you want to use less shaders, you could combine some together too but that will be more complicated if your not too familiar with them

Thanks Cat, although i’m afraid I don’t really understand that at all!

Is video.a*=mask referring to the code in the shader? I don’t know how to write or edit shaders at all :/

I found a convoluted solution late last night after writing the above post, by relayering the original png behind the blended & lumakeyed jpg/video I reinstate the original black and transparency. But it’s not very elegant.
I’ll post it later when i can get to my v computer to see if anyone can point out a way to make it a bit more efficient

Attached is a patch, seem to be a bit more bother than I suggested ;)
So I’ve just put a quad behind the keyed image so the mask is rendered behind the keyed image so you get black (or white if you invert the key) lines from the mask as well as the keyed source…
Is this what you needed?

LumakeyWithMask.zip (11.9 kB)

Awesome! Thanks Cat, that does seem to do exactly what I want and it’s a lot neater than my solution (which i’ve attached in case you were interested)
Computer seems to be able to handle 24 of them running so far, so that’s promising!

Thanks again

example element patch.v4p (10.4 kB)