I’m running into a weird issue with the DistanceToNearestSurface node not behaving how I would expect it to. I am trying to create foam that goes along the border of the water plane as it intersects objects in the scene. Basically, I’m trying to make this https://www.youtube.com/watch?v=bUkIjMrCbnM
I changed the colors to make it easier to see the problem
As you can see, the “foam” is inconsistent as it goes along objects.
Here is my material setup
As far as I can tell, I am using the node how it should be used… but the results are less than ideal as you can see.
Any idea what’s going on? Is there a way to make the node more accurate?
Edit: The solution is adjusting the Global DistanceField View Distance under the World Settings. I made a gumroad with the water material I was trying to make, check it out here. https://gumroad.com/l/aEttK