I’m trying to make a basic ray marcher using distance fields in 4.25, but the ‘GetDistanceToNearestSurfaceGlobal’ function in a custom node always outputs a distance of 0.
I’ve definitely generated the distance fields in the project settings, as they are there in the Visualize Distance Field view mode, and the ‘DistanceToNearestSurface’ node works fine. I have also tried using 8 bit mesh distance fields and compressed mesh distance fields but neither made any difference.
The weird part is it appears to be working fine in the material preview window:
I’ve already tried multiple different meshes, using a few other versions of UE4 on a couple of different PCs, and a variant of the function called ‘GetDistanceToNearestSurfaceGlobalClipmap’ but I always get the same issue.
Any help on this would be greatly appreciated,
Thanks!