# Nanite displacement issue

**URL:** <https://forums.unrealengine.com/t/nanite-displacement-issue/1531582>\
**Category:** World Creation\
**Tags:** unreal-engine, question\
**Created:** [December 17, 2023, 12:10am UTC](https://forums.unrealengine.com/t/nanite-displacement-issue/1531582 "2023-12-17T00:10:38Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![REAPONER](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@REAPONER](https://forums.unrealengine.com/u/REAPONER)\
**Post date:** [December 17, 2023, 12:10am UTC](https://forums.unrealengine.com/t/nanite-displacement-issue/1531582/1 "2023-12-17T00:10:38Z")

</div>

Hello, Unreals!

Trying to add some displacement I ran into a problem. Displaced geometry make a holes at the edges of the geometry. I use the standard method with a displacement map. On spheres it works perfectly, but at more complex meshes, like wall for example, the geometry brokes immediately.

Probably the solution to the problem lies in the use of Geometry Script and Dynamic Mesh, as [Paul Mader showed at GDS23](https://youtu.be/05FCjQR--Sc?feature=shared&t=300).

Can someone help me to understand, how to make something like this? Or how to recreate this effect?

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/e/8/1e8831077cc91f4f61c71cf975b8316438aaa9ca.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/d/8/6d89fe7f4658b1607b58df8a98509204f809332c.jpeg)

#Nanite #displacement #geometry-script

---

<div class="post-metadata">

**Author:** ![EliasWick](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eliaswick/32/1175208_2.png) [@EliasWick](https://forums.unrealengine.com/u/EliasWick)\
**Post date:** [December 17, 2023, 2:54pm UTC](https://forums.unrealengine.com/t/nanite-displacement-issue/1531582/2 "2023-12-17T14:54:20Z")

</div>

This is expected.

You can change the effect so that it starts from the outmost position of the mesh, in the material displacement settings.

---

<div class="post-metadata">

**Author:** ![REAPONER](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@REAPONER](https://forums.unrealengine.com/u/REAPONER)\
**Post date:** [December 17, 2023, 7:14pm UTC](https://forums.unrealengine.com/t/nanite-displacement-issue/1531582/3 "2023-12-17T19:14:57Z")

</div>

Thank you for the reply!

You mean Magnitude and Center values ? Tried. Unfortunately any values gives a bad result.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/1/d/b1d16b7363b90b4c1f6e311330c1a82eb9691a10.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/4/7/747b7b19e3acc2df0b26f0480bd3ea743b52089a.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/5/7/057b6c34820058355c3787700fbb7efadf1dad1e.jpeg)

If I understood right, geometry script and dynamic mesh pushes all the vertices on the edges of the mash back to 0 and close all holes, thats why I mentioned it at the first messege as the possible solution.

In other way, maybe there’s an option to add a slight gradient or outline along the edges of the mesh and multiply it on displacement map or subtract it from the map that will give the same result as script? Unfortunately I don’t now how to implement this option.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/6/8/8682beffc356cb025e80e93e1fd014a7d36e6582.jpeg)

---

<div class="post-metadata">

**Author:** ![EliasWick](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/eliaswick/32/1175208_2.png) [@EliasWick](https://forums.unrealengine.com/u/EliasWick)\
**Post date:** [December 18, 2023, 6:45pm UTC](https://forums.unrealengine.com/t/nanite-displacement-issue/1531582/4 "2023-12-18T18:45:23Z")

</div>

Oh, now I see the issue that you are facing. You likely will need to create one smoothing group for the entire mesh. Have a look here: [https://youtu.be/UWrCA-t0v3U?si=N1dlUubJ\_dPHiU\_Y&t=1429](https://youtu.be/UWrCA-t0v3U?si=N1dlUubJ_dPHiU_Y&t=1429), about 23:49.

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [December 18, 2023, 7:43pm UTC](https://forums.unrealengine.com/t/nanite-displacement-issue/1531582/5 "2023-12-18T19:43:06Z")

</div>

> [@REAPONER](#):
>
> In other way, maybe there’s an option to add a slight gradient or outline along the edges of the mesh and multiply it on displacement map or subtract it from the map that will give the same result as script?

You could use the UV positions as that mask, something like:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/8/d/b8da5cbff4df06d013755cbe3da4ebbff93c5d71.jpeg)

---

<div class="post-metadata">

**Author:** ![REAPONER](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@REAPONER](https://forums.unrealengine.com/u/REAPONER)\
**Post date:** [December 18, 2023, 10:44pm UTC](https://forums.unrealengine.com/t/nanite-displacement-issue/1531582/6 "2023-12-18T22:44:19Z")

</div>

Thank you for the reply! ❤

Unfortunately it’s not working with assets that must have a few smoothing groups, like this wall for example. It will help to hide the holes, but the shading of the rest parts of the model comes broken.

Maybe if this method will be used with Texture Data or assets with one material, it might work, but I’m not sure.

---

<div class="post-metadata">

**Author:** ![REAPONER](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@REAPONER](https://forums.unrealengine.com/u/REAPONER)\
**Post date:** [December 18, 2023, 10:59pm UTC](https://forums.unrealengine.com/t/nanite-displacement-issue/1531582/7 "2023-12-18T22:59:21Z")

</div>

Thank you for the reply! ❤

Looks like it’s worked! As a temporary solution 🥲

I’m not sure that it can be used in all cases, but in my case a slight gradient actually worked. Actually it even looks pretty natural and modular system wasn’t broken. Thanks to mirrored UV’s and Triplanar projection.

Thank you!

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/f/7/cf7ebcf614cc9907ca9336adcff7982e9796dbd5.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/2/e/c2e2ba4df2be52fec288f2c9dedb24d772a7ed07.jpeg)

---

<div class="post-metadata">

**Author:** ![REAPONER](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@REAPONER](https://forums.unrealengine.com/u/REAPONER)\
**Post date:** [December 18, 2023, 11:09pm UTC](https://forums.unrealengine.com/t/nanite-displacement-issue/1531582/8 "2023-12-18T23:09:59Z")

</div>

Oh and if we’ll close the holes at the top and the bottom of the mesh with this method, it will make this seam between meshes and broke up a modular system. So thats why gradient isn’t the best solution.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/8/e/c8e99a7f28da5095e3e624f813b8268af5bc493c.jpeg)  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/2/d/42d1e5c6d0fba8712a993783eaf4b3d2e9ed2b82.jpeg)

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [December 18, 2023, 11:31pm UTC](https://forums.unrealengine.com/t/nanite-displacement-issue/1531582/9 "2023-12-18T23:31:05Z")

</div>

Yeah, you could make MIs which specified which edges to ramp, but not exactly an optimal solution - maybe the easiest and cleanest way would be to have End meshes that match up to the wall ends…

---

<div class="post-metadata">

**Author:** ![REAPONER](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@REAPONER](https://forums.unrealengine.com/u/REAPONER)\
**Post date:** [December 19, 2023, 12:35am UTC](https://forums.unrealengine.com/t/nanite-displacement-issue/1531582/10 "2023-12-19T00:35:01Z")

</div>

> [@RecourseDesign](#):
>
> maybe the easiest and cleanest way would be to have End meshes that match up to the wall ends…

Sorry, but I don’t quite understand what you mean, or rather I’m not sure that I understood you correctly.

You mean to separate this gray sides of the wall from the base brick geometry ?

---

<div class="post-metadata">

**Author:** ![REAPONER](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@REAPONER](https://forums.unrealengine.com/u/REAPONER)\
**Post date:** [December 19, 2023, 12:43am UTC](https://forums.unrealengine.com/t/nanite-displacement-issue/1531582/11 "2023-12-19T00:43:42Z")

</div>

Ideally to have something like this, but in engine. I already made a dozens of assets and decided to add displacement in the last moment 🥲

 ![Screenshot_20231219-033700_YouTube](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/5/a/65a43b4251ea56b549bfbdeac4397815ef01f9c7.jpeg)

---

<div class="post-metadata">

**Author:** ![RecourseDesign](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/recoursedesign/32/1194503_2.png) [@RecourseDesign](https://forums.unrealengine.com/u/RecourseDesign)\
**Post date:** [December 19, 2023, 1:38am UTC](https://forums.unrealengine.com/t/nanite-displacement-issue/1531582/12 "2023-12-19T01:38:26Z")

</div>

Yeah that’s what I was thinking, but that just isolates it into those meshes, you’d still need to mask the outer edges in those meshes…

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [June 16, 2024, 10:33am UTC](https://forums.unrealengine.com/t/nanite-displacement-issue/1531582/13 "2024-06-16T10:33:33Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
