Multiply color of video texture by black and white animated texture

HI, I think this would be kind of complicated without probably a custom shader, but maybe there is a easy way:

I have a sheet animation black/white/ gray. I could also make a video out f it, if it works better.

my goal is to put that texture on a plane, and multiply the color values by a video. (so that of course the white values show the video, and the black values stay black). Any ideas on how to go about this?

pd: Actually the main goal is to get the video of the webcam, und multiply the colours using planes that have animated black and white values.

I think it might be possible to do this as a post process with a very simple custom shader. You feed in the mask, feed that output into the video texture shader, then take the result of that and send to the normal shader as its diffuse channel?

I’m curious if there’s a better way since I have some similar problems to solve.

By using your mask into emissiveTexture channel, you may be able to get the result you want:

https://www.babylonjs-playground.com/#CHQ4T#203

4 Likes

yeah that works! thanks

https://www.babylonjs-playground.com/#18AM34

1 Like