Answers for "DistanceToNearestSurface doesn't blend"
https://answers.unrealengine.com/questions/463563/distancetonearestsurface-doesnt-blend.html
The latest answers for the question "DistanceToNearestSurface doesn't blend"Answer by Roel
https://answers.unrealengine.com/answers/464905/view.html
*"Apparently it calculates the distance between the nearest DistanceField and the desired position."*
This is not entirely correct. It gives the approximate distance in centimeters to the nearest surface from the given position. Which is positive when the given position is outside of the mesh, and negative when the given position is inside of a mesh.
Since you clamp the value between 0 and 1 anything negative is going to be zero. Next you invert it using the lerp(1,0) so this means all the negative values will become white.
Your mesh is probably a bit to small, and approximately the distance towards the surface is inside the mesh, giving you since it is clamped and inverted the white spots.
In all my demos I used fairly large meshes. You could also play around with the console settings. All settings start with r.DF or r.DistanceField.
Bonus tip: Since at the end you have a value between 0 and 1, doing a lerp(1,0) as doing a OneMinus.
Expample, lets say you have a value of 0.3, these would be the equations:
Lerp: 0.3 * (0 - 1) + 1 = 0.7;
OneMinus: 1 - 0.3 = 0.7;
OneMinus basically inverts a value between 0 and 1. Lerp linearly interpolates between 2 values based on a single value between 0 and 1.
Enjoy!Fri, 05 Aug 2016 10:24:57 GMTRoel