Mesh distance fields on planes

Hi everyone, I’m trying to build a low poly landscape and I’m using mesh distance fields to create far shadows. My landscape is made of walkable ground and cliffs, which are made of planes that intersect at the edge of the cliff. These are quite huge meshes, divided in smaller chunks, but all of them are just thin polygon planes with no thickness.

When building mesh distance fields, UE generates huge artifacts on the edges of the meshes, where the two planes touch. Of course, this creates shadow artifacts that ruin the project.

I also tried increasing the DF resolution scale, but that didn’t work. If I set “Two sided distance field generation” to true, the artifact disappears, but the shadows from the mesh become a mess of blotches and stripes.

Is there a way to solve this and use mesh distance fields with planes that have no thickness? Is there a workaround, or an alternative to DF based far shadows?

Thanks for your time.

Did you try increasing the distance field resolution in the mesh editor?

I did, I should have mentioned that. I tried to crank the resolution up to 100: the artifacts just get a bit smaller, but are still present and visible.

And you tried two sided?

I have a sneaking feeling that MDF isn’t going to work for planes… could be wrong. I have it working for buildings that have ‘no inside’.

I also think you’ll find that anything above 2 wont have any effect, the max MDF is 8MB, and it already reached that without much persuasion…

I tried two sided right now, I updated the original post with a picture of the result. The artifact disappears, but the shadows become funny. I’m afraid I won’t be able to use MDF for this project.

Have you got any suggestion about a possible alternative? I have cascade dynamic shadows for everything close to the camera, but I needed DF for objects at more than 40/50 meters from the player.

Why use DF? If you have stationary lights, you can build shadows, and then use cascade for the stuff near the camera.

I had to switch to movable lights because building stationary light became too heavy: to get some semi-decent shadows, I had to use lightmaps between 512 and 2048 px, and that’s too much for my 8 gigabytes of RAM.
Of course, the biggest meshes are split in smaller ones. Splitting them further would be really a pain, but maybe that could be a partial solution. I also had lots of problem with blurry shadows. Never been able to solve them, so I’m trying to switch to dynamic lights, since several users in the past suggested they are better for bigger maps.

Have you tried it with cascades? The whole point is you can have crappy static shadows, but you never get close enough to see because you’re always surrounded by dynamic shadows, in a range you specify.

Also, I have seen that dynamic can be faster sometimes. I think it depends on the amount of GPU RAM used by the shadows…

I had a lot of problems with light bleeding and single sided meshes. I spent ages sewing another side on, made no difference. What helped in the end was keeping the shadow distance at the default of 20000. I had cranked it up to 35000.

You could always just extrude the meshes and fix it that way…

All right, I will give stationary lights another go. Thank you for your help and suggestions, highly appreciated.
I’m regretting choosing single sided meshes, they are causing me lots of trouble.

No worries, get back if you can’t get it working right, at least I am a black belt in that!..