# Filling gaps in mesh after applying opacity mask

**URL:** <https://forums.unrealengine.com/t/filling-gaps-in-mesh-after-applying-opacity-mask/330424>\
**Category:** Rendering\
**Tags:** opacity-mask, opacity, unreal-engine, mask, question\
**Created:** [August 30, 2015, 10:02pm UTC](https://forums.unrealengine.com/t/filling-gaps-in-mesh-after-applying-opacity-mask/330424 "2015-08-30T22:02:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Acrossfy](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Acrossfy](https://forums.unrealengine.com/u/Acrossfy)\
**Post date:** [August 30, 2015, 10:02pm UTC](https://forums.unrealengine.com/t/filling-gaps-in-mesh-after-applying-opacity-mask/330424/1 "2015-08-30T22:02:07Z")

</div>

Hello guys,  
I want to slice a mesh object dynamically. I got location based opacity (with [this tutorial][1]) and now I need to make more complex feature: fill holes (gaps) after masking. I’m stuck with it and need your help.

I tried to show what exactly I want on screenshots below (red lines show area which I want to fill with material):

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/c/9/c9491534649c92e50531739b6d3fb3149f745d11.png)

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/c/2/c2a7423d2973e40ee5160347184505fa6fe2522e.png)

 ![](https://d3kjluh73b9h9o.cloudfront.net/original/3X/5/0/50b23c0d972dc08f0ff0a28516d0486703f497a0.png)

I would be grateful for any advice.

---

<div class="post-metadata">

**Author:** ![ImmortalEmperor](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/immortalemperor/32/466268_2.png) [@ImmortalEmperor](https://forums.unrealengine.com/u/ImmortalEmperor)\
**Post date:** [August 31, 2015, 1:49am UTC](https://forums.unrealengine.com/t/filling-gaps-in-mesh-after-applying-opacity-mask/330424/2 "2015-08-31T01:49:22Z")

</div>

Trouble with what you are trying to do is that there isn’t any actual geometry to fill in with material information. What you could try doing is, instead of passing the mask to opacity, pass it to world position offset and offset those vertices by a vector. This wont work for slicing but if your just shortening or lengthening.

A much more complex solution would involve some kind of parallax occlusion “like” mapping but I wouldn’t have any clue how to implement that.

Though I just saw in the 4.9 release notes an experimental “Volume Decal” that would work but epic says is very GPU expensive.

Otherwise a geometric solution would be to modify the underlying mesh at runtime using the custom mesh component:

> **[Custom Mesh](https://docs.unrealengine.com/4.27/en-US/BlueprintAPI/Components/CustomMesh/)**
>
> Custom Mesh

or procedural mesh component:

> **[Procedural Mesh](https://docs.unrealengine.com/4.27/en-US/BlueprintAPI/Components/ProceduralMesh/)**
>
> Procedural Mesh

---

<div class="post-metadata">

**Author:** ![Naocan](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Naocan](https://forums.unrealengine.com/u/Naocan)\
**Post date:** [August 18, 2016, 8:04pm UTC](https://forums.unrealengine.com/t/filling-gaps-in-mesh-after-applying-opacity-mask/330424/3 "2016-08-18T20:04:57Z")

</div>

I need an input on this as well. However my application of the mask is slightly different. I am slicing two planes that are parallel to each other and has a gap so it practically is a wall. After applying the opacity mask, I can see the gap.

---

<div class="post-metadata">

**Author:** ![Darrel\_Leigh](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Darrel\_Leigh](https://forums.unrealengine.com/u/Darrel_Leigh)\
**Post date:** [September 18, 2019, 8:36pm UTC](https://forums.unrealengine.com/t/filling-gaps-in-mesh-after-applying-opacity-mask/330424/4 "2019-09-18T20:36:04Z")

</div>

Did you have any success with this? I’m very interested in figuring this out as well.

---

<div class="post-metadata">

**Author:** ![rangemotions](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@rangemotions](https://forums.unrealengine.com/u/rangemotions)\
**Post date:** [November 12, 2019, 2:11pm UTC](https://forums.unrealengine.com/t/filling-gaps-in-mesh-after-applying-opacity-mask/330424/5 "2019-11-12T14:11:43Z")

</div>

The only current way to make something similar (i mean fake it with unlit color):

[![](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/0/b/30b389dd1522ce3a824cee667e42d4e33c515f17.jpeg "3D Printer Shader - Material Tutorial - [UE4]") ](https://www.youtube.com/watch?v=GO5zQ5tUUbM)

---

<div class="post-metadata">

**Author:** ![DDemon](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@DDemon](https://forums.unrealengine.com/u/DDemon)\
**Post date:** [December 20, 2019, 9:42am UTC](https://forums.unrealengine.com/t/filling-gaps-in-mesh-after-applying-opacity-mask/330424/6 "2019-12-20T09:42:16Z")

</div>

Thanks, better than nothing.
