Distance Field Edge Blending

Texture Sample requires texture input, else it doesn’t work. I get error red text and mesh has no material (gray tiles). I really wonder why it’s different in your case, I’ve copied straight to MF in 4.15.1

What you need is a texture image to plug into your Texture Sample node. Download the image below and add it in there. Hope this helps.

Hmm, i had to add a texture too to avoid a compile error. Used the texture posted by Wolf89. Is this how it’s supposed to work? @hallatore? Also when i turned off “Affect Distance Field Lighting” it doesn’t have any effect at all it seems. Im on 4.15 and copy pasted the MF from the initial post.

Here’s how it’s looking for me:
https://i.gyazo.com/4feb1756e9e456e21719b5613a62b2e6.jpg

And if i turn on “Affect Distance Field Lighting”
https://gyazo.com/9a080bd84af96eda4ef025350ebaa021

Im clearly missing something.

I need to check what texture I used when I get home. Maybe rewrite it to use noise instead.

The object you use this material on should have affect distance field lighting turned off. But the object you want to blend it with needs to have it on. (Since objects occlude themself, having distance field on the object itself will create artifacts)

Ah, and since this is actually the same object i just repeated several times rotated and scaled, i suppose that’s the reason.

It’s a limitation with this technique. I wish there was a DF channel, and a way to exclude itself.

I found that this doesn’t work so well with dynamic shadows.
I need to somehow remove the pixel without removing the depth information. Otherwise the blending can get really dark.

I fixed the dynamic shadows by using the Opacity Mask instead of pixel offset. Need to change the material to Masked though.
This effect would be much better if I could use it without turning off distance field lighting on the object.

Here is current off/on: Distance Field Edge Blending - Unreal Engine - Imgsli
And here I photoshopped how it would look if I could have distance field lighting enabled: Distance Field Edge Blending - Unreal Engine - Imgsli

@DanielW Is it an impossible dream? It’s just the Landscape I want distance to. (I really like the result below)

What about this error? :confused:

I used Perlin noise texture that is already there.

did you mean that ?

When I added this noise my mesh looks like this :confused:

That doesn’t look right. Have you turned off distance field on the mesh?

An easier but more subtle effect is to just plug TemporalAADither into PixelOffset. Maybe multiply be 10 or around there.

PS: This is not a perfect method since you have to turn off distance field on your mesh.

Yeah Distance Field is turned off. also enabled in project settings. but still have problem :confused:

Still not working with TemporalAADither :confused:

if you have time I will upload my project on drive and give you and take a look maybe I’m making something wrong :confused:

This sounds fantastic! Can’t wait to give it a try :slight_smile:

i have exact the Same Problem like GIO, any ideas?

Hello there!
Just a question… the blend makes the work, but i can work with it so i can see the blend itself from a bigger distance?
As you can see in the pic, it only shows the blend close to the camera, and not further away.
Thanks in advance!