# Error distance field generated when using two-sided material 

**URL:** <https://forums.unrealengine.com/t/error-distance-field-generated-when-using-two-sided-material/2676752>\
**Category:** Rendering\
**Tags:** unreal-engine, Epic-Pro-Support, question\
**Created:** [September 24, 2025, 9:04am UTC](https://forums.unrealengine.com/t/error-distance-field-generated-when-using-two-sided-material/2676752 "2025-09-24T09:04:12Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [September 24, 2025, 9:04am UTC](https://forums.unrealengine.com/t/error-distance-field-generated-when-using-two-sided-material/2676752/1 "2025-09-24T09:04:12Z")

</div>

Error distance field generated when using two-sided material

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [September 24, 2025, 9:04am UTC](https://forums.unrealengine.com/t/error-distance-field-generated-when-using-two-sided-material/2676752/2 "2025-09-24T09:04:16Z")

</div>

**重现步骤**  
1.Open Modeling Mode, create a box.

[Image Removed]

2.Create a Two-Sided material

[Image Removed]

3.Open StaticMesh Editor, give the Two-Sided material to the box

[Image Removed]

4.Show Mesh DistanceFields

[Image Removed]

5.Whether to check the TwoSided DistanceField option in StaticMesh’s BuildSettings will not affect the results

---

<div class="post-metadata">

**Author:** ![K.Nappoly](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/k.nappoly/32/1216749_2.png) [@K.Nappoly](https://forums.unrealengine.com/u/K.Nappoly)\
**Post date:** [September 30, 2025, 11:28pm UTC](https://forums.unrealengine.com/t/error-distance-field-generated-when-using-two-sided-material/2676752/3 "2025-09-30T23:28:19Z")

</div>

Hello,

Thank you for reaching out.

There might be an issue with the visualizer that we are investigating further.

Testing using a simple material setup using DistanceToNearestSurface shows that the actual data is what is expected. Are you seeing lighting issues with this or are you only seeing the visualizer as an issue in this case like we are?

---

<div class="post-metadata">

**Author:** ![anonymous-edc](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous-edc](https://forums.unrealengine.com/u/anonymous-edc)\
**Post date:** [October 9, 2025, 8:42am UTC](https://forums.unrealengine.com/t/error-distance-field-generated-when-using-two-sided-material/2676752/4 "2025-10-09T08:42:00Z")

</div>

[Image Removed]There is a difference in the effect of switching the TwoSided Flag on and off. I think it is not just a visualization problem.

---

<div class="post-metadata">

**Author:** ![K.Nappoly](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/k.nappoly/32/1216749_2.png) [@K.Nappoly](https://forums.unrealengine.com/u/K.Nappoly)\
**Post date:** [October 21, 2025, 10:25pm UTC](https://forums.unrealengine.com/t/error-distance-field-generated-when-using-two-sided-material/2676752/5 "2025-10-21T22:25:38Z")

</div>

When using a Material to check the Distance Fields, you need to apply it to a separate mesh, such as a plane, that does not write into the distance field.

If you apply the checking Material to any mesh writing into the distance field, you will get artifacts on the surface based on how close the mesh surface is to the voxels in the Global Distance Field texture. Since, with a two-sided Distance Field representation, the voxels inside will be positive, the artifacts will be different in that case.

For an example of this, you can see how it is done for the documentation of the DistanceToNearestSurface Material Expression:

[https://dev.epicgames.com/documentation/en-us/unreal-engine/utility-material-expressions-in-unreal-engine#distance-to-nearest-surface](https://dev.epicgames.com/documentation/en-us/unreal-engine/utility-material-expressions-in-unreal-engine#distance-to-nearest-surface)

Please let us know if this helps.

---

<div class="post-metadata">

**Author:** ![Msv777](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Msv777](https://forums.unrealengine.com/u/Msv777)\
**Post date:** [December 20, 2025, 9:33am UTC](https://forums.unrealengine.com/t/error-distance-field-generated-when-using-two-sided-material/2676752/6 "2025-12-20T09:33:34Z")

</div>

This issue can be reproduced in 5.7.1, and it’s not a simple visual bug. I initially discovered that the problem was that Niagara leaf particles using GPU Distance Field collision were not colliding with a double-sided floor, but re-importing the same mesh without materials allowed for proper collision and they stayed on the surface (this took me a lot of time).  
I removed double-sided textures from all materials, slightly changed the build resolution in LOD Build Settings to rebuild, and the holes and artifacts in the MDF disappeared in the viewport. The artifacts also appear to be related to the current camera (see this image). More details are similar to [Distance fields issue](https://forums.unrealengine.com/t/distance-fields-issue/2672275)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/c/7/ac734fe147a1c93a584bc167387fd00b2745cb0b.jpeg)

> [@Mesh Distance Fields Seem Broken Project-Wide](https://forums.unrealengine.com/t/mesh-distance-fields-seem-broken-project-wide/642109):
>
> Hi all, I’m having an issue with Mesh Distance Fields- sort of greasy, splotchy shadows that (from my research) are a common symptom of meshes that aren’t playing nice with MDF generation. However, as I’ve dug deeper into the issue, I’m coming to believe that, in my case, that’s not what’s going on- For a couple of reasons. Firstly, the artifacts are present even on the default Material Sphere- If you look carefully, you’ll see some subtle splotching on the sphere- that’s not image compression…

Due to confidentiality requirements, I cannot provide my screenshots.

---

<div class="post-metadata">

**Author:** ![Daondare](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Daondare](https://forums.unrealengine.com/u/Daondare)\
**Post date:** [June 28, 2026, 6:05pm UTC](https://forums.unrealengine.com/t/error-distance-field-generated-when-using-two-sided-material/2676752/7 "2026-06-28T18:05:41Z")

</div>

Well sure is visual, sure not no bug… btw since 5.0 and nanite introduction reproduceable… hf  
mesh needs to reapply generate distance fields to show changing the setting having an effect…

 ![1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/f/8/1f897461521cb9a614e79132c64e1af98e655138.jpeg)

 ![4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/f/a/cfa86fdfce4ed3cc76f838d9f6611916b8c7a3cf.jpeg)

 ![3](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/7/3/a73af36250b6520f9a21d079b9123451d0fcf108.jpeg)

 ![2](https://d3kjluh73b9h9o.cloudfront.net/original/4X/9/4/0/940845f8ab541932536d071a7adc8374a19a9214.jpeg)

---

<div class="post-metadata">

**Author:** ![ZacD](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZacD](https://forums.unrealengine.com/u/ZacD)\
**Post date:** [June 29, 2026, 1:18pm UTC](https://forums.unrealengine.com/t/error-distance-field-generated-when-using-two-sided-material/2676752/8 "2026-06-29T13:18:42Z")

</div>

It’s expected behavior, the mesh is being treated as a paper thin wall, you can use two sided distance field generation in the static mesh settings, but I believe that’s intended more for things like trees and sparse/thin meshes. It’s generally not a good idea to use two sided materials for everything.

---

<div class="post-metadata">

**Author:** ![Daondare](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Daondare](https://forums.unrealengine.com/u/Daondare)\
**Post date:** [July 3, 2026, 12:29am UTC](https://forums.unrealengine.com/t/error-distance-field-generated-when-using-two-sided-material/2676752/9 "2026-07-03T00:29:12Z")

</div>

Well, I did not know that. As far as I understand it now, the two-sided material flag makes distance field generation behave as if that section of the mesh where the material is applied was two-sided distancefield by default. In that case, the two-sided flag inside the mesh does not make much sense anymore and feels redundant, it turns the whole mesh twosided not just the material which is twosided. This should be a separate material flag, not bundled into the two-sided flag on materials. It kind of sucks for cutout shaders, inside faces turning black, etc. But who makes isometric games with Unreal anyway…

Using twosided materials on a lot of stuff is a bad idea when using Nanite, that much is true, because there it sadly tanks performance, because the overdraw calculations do not like it then.

My hacky solution/workaround i will try to do is an editor script that takes a mesh and turns off twosided on materials, generates distancefields and then turns twosided on again…yey

after some more investigations… the documentation also mentions nowwhere, that twosided flag on a material will generate the distancefield for this section of the mesh as twosided. - i think this is just some oversight nobody noticed and or complained about. - this makes only sense when any and all twosided geometry is by defenition a foliage like object…
