DistanceToNearestSurface doesnt work runtime [updated]

Summary

I upgrade my project to 5.8.2 and i checke that everything look like normal, but i notice that the water material i made that check the nearest surface of the level doesnt work properly

What Type of Bug are you experiencing?

Level Design & Art Tools

Steps to Reproduce

Create a Material that uses DistanceToNearestSurface

Place the material on a Mesh, could be a flat plane or a cube.

Expected Result

The material detects the surface is touching of any mesh (B) is near the mesh (A) that has the material and creates the siluette of the mesh is touching

Observed Result

the editor show the material unaffected by any mesh near the surface even if you play the game on standalone.

it seems like when Realtime is activated the node doesnt work, not even playing in standalone or new viewport.

on the material preview it works fine but not in the editor viewport

Affects Versions

5.8

Platform(s)

Windows

Upload an image

Additional Notes

generate mesh field distance is on
the material works on 5.6 before upgrade

I have the same problem, but only when I use SSAO. If I use DFAO, it works fine.

Can you specify if you’re using SSAO?