Edit: Moved to bug reports. While I don’t know if this is a known behavior or not, I can’t imagine that it is intentional. Also, finally updated to 4.17.1 and this still happens.
Edit 2: This also happens if you apply a Distance Field Replacement Mesh to a plane, where the replacement mesh is from a 3D mesh that does not see this issue. The DF visualization of this mesh on the plane is different (overflows the mesh bounds) than on the closed mesh.
I want to use DF soft shadows in my level, so I’m building it out using small modular pieces, since they seem to get better results (fewer artifacts) than large meshes due to the 128^3 max DF texture limit. Most of the meshes that make up my walls, floors, etc are essentially just single-sided planes with cutouts or details added.
Here’s the problem I’m having: the mesh distance fields for 2D planes reliably extend past the actual bounds of the mesh itself, even with DF resolution maxed out. This is not a problem I’ve seen with 3D meshes. Here’s an example using the engine cube and plane:
Note that the DF representation of the cube is entirely within the mesh bounds whereas the plane’s representation extends past the bounding box on all sides.
This creates shadowing artifacts like this where two walls meet at a 90-degree angle:
You can see the cause of this by visualising DFs at this intersection. Note that they should be meeting at a 90 degree angle without overlapping:
I’ve tested this on imported meshes, too, and the same behavior occurs. Importing a plane results in DF overflowing the bounds, extruding it into a 3D mesh and reimporting “fixes” it.
I was unable to reproduce this issue on our end, I have a couple of questions to help narrow down the issue you are experiencing.
- Can you reproduce this issue in a new project?
- If So could you provide a detailed list of steps so that I can reproduce this issue on our end?
I can reproduce this in a new project. Here’s what I did to produce the scene below, which mimics the first image in the OP (albeit with the default level in the background):
- Create a new project via the editor launcher (I’m running v4.17.1). For expediency, I chose a blank Blueprint project with default settings (Desktop/Max quality/With Starter Content).
- Check Edit → Project Settings → Rendering → Lighting → Generate Mesh Distance Fields.
- Restart the editor.
- Once Mesh DFs are all generated, drag a cube mesh and a plane mesh into the level from the Modes → Place → Basic menu.
- Open the plane mesh in the Static Mesh editor and set LOD Sections (LOD0) → Build Settings → Distance Field Resolution Scale to 2.0 (if left at 1, this plane doesn’t generate a visible DF at all). You can also set it higher - the issue still occurs.
- Show → Visualize → Mesh DistanceFields.
Hope this helps. Please let me know if there’s any more information you need.
With the information you provided I have reproduced this issue and logged a report for it here
You can track the report’s status as the issue is reviewed by our development staff. Please be aware that this issue may not be prioritized or fixed soon.
Have a good day
Thanks, . To clarify, this also occurs with planes at a DF resolution scale of 1.0.
For some reason, the DF representation of the built-in engine Plane mesh is non-existent at this resolution, but if you import a larger simple plane, it has the same issue even at a resolution scale of 1.0.