Clipping on DistanceToNearestSurface

Hi, I have problem using the Utility Expression DistanceToNearestSurface on material, namely some clipping happened when the camera is near the material, which it shouldn’t happen. It’s apparent on the left and right box.

247215-distancefield.gif

What I’ve done is enabling the Generate Mesh DIstance Fields in the project setting, having a movable SkyLight, and using the same example material as the unreal docs.

https://docs.unrealengine.com/portals/0/images/Engine/Rendering/Materials/ExpressionReference/Utility/DistanceNearSurface_01.png

Any Idea where I had done wrong? since the result I got is far-off from the docs example, and I cannot enlarge the ‘read area’. Thanks!

I think this is some kind of “LOD” or “mips” of distance field.

Not sure what you can do in this case.Try to search in engine ini’s for some relative properties.

Any chance you’ve found a solution? Currently I’ve faced the same issue and there are no information available :frowning:

Hey, after digging into the UE4 code I’ve finally found where the clipping distance can be changed!

It’s very simple, in the World Settings, look for the “Global DistanceField View Distance” parameter. By default it’s 20000 units, can be changed up to 100000.