Artifacts when combining sphere masks

In our project we are using multiple sphere masks to reveal or hide parts of the level as the core mechanic.

However when two or more sphere masks are close to each other, visual artifacts start to appear.

This effect gets worse the closer the spheres are.

Our implementation is simply defined the spheres using a material parameter collection for the radii and centers, and creating the sphere masks in a material blueprint function. For combining the sphere masks we just simply add them.

Is this possibly an error of the Add operation, a known bug or are we not understanding how to combine multiple sphere masks?

Any help would be appreciated,
Thanks.

Managed to solve the issue thanks to reddit user :

I don’t know if this is a problem but your Add seems strange to me.

Sphere Mask returns 0 or 1 as the result.

But the result after the Add will be 0, 1 or 2 (if inside both spheres).

I think you should use the Max node so your result is still 0 or 1.

So yeah, changed the Add operation for a Max operation and it worked

1 Like

I was to added 4 Sphere Masks to material using the MAX node. Thank you!!! and Thanks livingonthedge.