Blend alpha channels?

Hi!
Is there any possibility to blend materials or channels in such a way that their alpha channels will blend?

Example:
In this case I multiply one alpha mask on top of another. And they both work like a solid alpha channel for the material.

If it is possible, will be efficient to blend something like 10–20 channels at the same time?
My task is to create some kind of screen with dynamic holes which will cover the objects behind it.

I think you would be better served by creating a texture on the CPU. Just keep a list of “holes” and re-paint the texture when holes are added/removed. It’s possible to do this very efficiently by just re-painting the region of the hole.

If you go down this route - there is no theoretical limit on number of holes as long as you don’t run out of memory :slight_smile:

And how it should be done on the CPU? By what means? Maybe there is an example to look at, because I cannot imagine what you’re talking about.

Binary-level manipulation of bitmap, pixel by pixel is one way. There is a ton on libraries out there for doing this. There’s always the HTML5 api.

I think that you assume three.js to be a lot more than it is :slight_smile:

1 Like

Got it, thank you! :slight_smile:

1 Like