# Artifacts when combining sphere masks

**URL:** <https://forums.unrealengine.com/t/artifacts-when-combining-sphere-masks/333067>\
**Category:** Rendering\
**Tags:** bug, artifacts, sphere, unreal-engine, mask, question\
**Created:** [September 22, 2015, 7:08pm UTC](https://forums.unrealengine.com/t/artifacts-when-combining-sphere-masks/333067 "2015-09-22T19:08:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_cec1baa2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_cec1baa2](https://forums.unrealengine.com/u/anonymous_user_cec1baa2)\
**Post date:** [September 22, 2015, 7:08pm UTC](https://forums.unrealengine.com/t/artifacts-when-combining-sphere-masks/333067/1 "2015-09-22T19:08:26Z")

</div>

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

 ![59743-sph_1.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/6/f/26f83f17f1719f767162ecb8551e3f0fb448967e.jpeg)

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

 ![59744-sph_2.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/6/3/a630111d5eeae854e7223fb9062653142c70070a.jpeg)

This effect gets worse the closer the spheres are.

 ![59745-sph_3.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/0/5/405b2dbe396867f5ca05b665e55e44cfe579606e.jpeg)

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.

 ![59747-blueprint.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/4/a/24aa919f975d092a5ef41a36c9afab68d122b47e.png)

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.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_cec1baa2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_cec1baa2](https://forums.unrealengine.com/u/anonymous_user_cec1baa2)\
**Post date:** [September 22, 2015, 8:59pm UTC](https://forums.unrealengine.com/t/artifacts-when-combining-sphere-masks/333067/2 "2015-09-22T20:59:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![xelaju](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@xelaju](https://forums.unrealengine.com/u/xelaju)\
**Post date:** [July 6, 2022, 10:36pm UTC](https://forums.unrealengine.com/t/artifacts-when-combining-sphere-masks/333067/3 "2022-07-06T22:36:52Z")

</div>

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