# Distance Field WPO and Displacement acting weird

**URL:** <https://forums.unrealengine.com/t/distance-field-wpo-and-displacement-acting-weird/1910188>\
**Category:** Rendering\
**Tags:** distance-fields, unreal-engine, Rendering, question\
**Created:** [June 20, 2024, 12:42pm UTC](https://forums.unrealengine.com/t/distance-field-wpo-and-displacement-acting-weird/1910188 "2024-06-20T12:42:58Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jmekilll](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jmekilll](https://forums.unrealengine.com/u/Jmekilll)\
**Post date:** [June 20, 2024, 12:42pm UTC](https://forums.unrealengine.com/t/distance-field-wpo-and-displacement-acting-weird/1910188/1 "2024-06-20T12:42:58Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/4/f/64fbb707dbb0ed225b42331ffac3b1dad483ff65.jpeg)

Does anyone know why my WPO and displacement seems to be reacting differently if i am using the distance field to mask it? When I am using the distance field to mask my Displacement or WPO, the mesh ‘‘bounds’’ does not react the same way as when i am maksing using other methods like a world gradient in this case.

Any help would be appreciated thanks.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/1/8/118fbeb4d07ed61719ae8e890e13a18354f7ab8e.jpeg)

---

<div class="post-metadata">

**Author:** ![somawheels](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@somawheels](https://forums.unrealengine.com/u/somawheels)\
**Post date:** [June 20, 2024, 6:42pm UTC](https://forums.unrealengine.com/t/distance-field-wpo-and-displacement-acting-weird/1910188/2 "2024-06-20T18:42:12Z")

</div>

Im not sure what your setup is, so this is just a guess.  
It may be to do with the fact that one method includes shader offsets and one does not?  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/4/2/a/42acf054cdae80874952d297d7940f83507b9fa8.png)

This is a setting in the WorldPosition node, perhaps if you play with that it will help you figure it out.

---

<div class="post-metadata">

**Author:** ![Jmekilll](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jmekilll](https://forums.unrealengine.com/u/Jmekilll)\
**Post date:** [June 20, 2024, 7:24pm UTC](https://forums.unrealengine.com/t/distance-field-wpo-and-displacement-acting-weird/1910188/3 "2024-06-20T19:24:22Z")

</div>

Thank you for the reply but unfortunatly it did not fix it. here is my distancefield setup (does weird stuff)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/5/d/25db8216ee11d77d2a8c7e86fb5675ec28f1397a.png)

and my world gradient setup (Works correctly)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/6/e/b6e385eb47e4816ba8e65ba69a6903c036973852.png)

---

<div class="post-metadata">

**Author:** ![Jmekilll](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jmekilll](https://forums.unrealengine.com/u/Jmekilll)\
**Post date:** [June 20, 2024, 7:26pm UTC](https://forums.unrealengine.com/t/distance-field-wpo-and-displacement-acting-weird/1910188/4 "2024-06-20T19:26:11Z")

</div>

It seems like as soon as the Distance to nearest surface is in my displacement or WPO calculation, it breaks something

---

<div class="post-metadata">

**Author:** ![somawheels](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@somawheels](https://forums.unrealengine.com/u/somawheels)\
**Post date:** [June 20, 2024, 7:35pm UTC](https://forums.unrealengine.com/t/distance-field-wpo-and-displacement-acting-weird/1910188/5 "2024-06-20T19:35:09Z")

</div>

I see. Are these both going into the “world position offset” material output? You mentioned something about displacement earlier.

---

<div class="post-metadata">

**Author:** ![Jmekilll](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jmekilll](https://forums.unrealengine.com/u/Jmekilll)\
**Post date:** [June 20, 2024, 7:38pm UTC](https://forums.unrealengine.com/t/distance-field-wpo-and-displacement-acting-weird/1910188/6 "2024-06-20T19:38:50Z")

</div>

Yes. at the moment they are both using the WorldPositionOffset Output but I tried it with the nanite displacement instead and the result is the same.
