DistanceToNearestSurface material node

Thanks for your answers, I still can’t get it to work :frowning:

If the cube is “going through” the landscape, I actually see the different color in the landscape.

If it’s just “touching” the landscape perfectly, I still see the black on the landscape:

But once it is slightly above the landscape, the landscape again is pure white.

The mesh distance fields are good:

“Local” Distance field:

Global Distance Field:

Another thing I noticed is, if I disable “cast shadows” on the cube, the landscape turns fully black. I tested a bit more and noticed that I need to have at least one shadow casting mesh in the world, otherwise the landscape is fully black. I have “cast static shadows” disabled in the project settings.

I have also tried to divide the output from the node and to power(0.2) or power(20) it, but it really just outputs a perfect white (0/0/0) even if the cube is just 0.01 cm above the landscape :frowning: