[This tutorial](https://www.youtube.com/watch?v=eztcGKeHfaI&list=PLfpbYBiij1cHeuaQrzo5Z7T7pW6JzJPCr&index=105&ab_channel=EdLeszczynski) explains how to make a shader that blend object with the ground by extracting the ground texture and applying it to the object.
Here is an exemple:[![enter image description here](https://i.stack.imgur.com/qZ9y8.jpg)](https://i.stack.imgur.com/qZ9y8.jpg)

The blending is done with a color ramp creating a gradient along the Z axis
[![enter image description here](https://i.stack.imgur.com/iiqL2.png)](https://i.stack.imgur.com/iiqL2.png)

Here is my version:
[![enter image description here](https://i.stack.imgur.com/wF2ub.jpg)](https://i.stack.imgur.com/wF2ub.jpg)

I would like to use it in combination with a displacement modifier to increase realism. Turns out the gradient along the Z axis is not affected by the displacement (he remain straight) as you can see.

[![enter image description here](https://i.stack.imgur.com/w9KWH.jpg)](https://i.stack.imgur.com/w9KWH.jpg)
Here is how the gradient is created in the shader

[![enter image description here](https://i.stack.imgur.com/aDCfB.png)](https://i.stack.imgur.com/aDCfB.png)

Is there a way to get this gradient affected by the displacement map in order to achieve a nice blend between ground and object (blend follows geometry) or any other solution to get a nice blend with an uneven ground, some geometry node maybe ?

here is the file for those who want to have a look:
[![](https://blend-exchange.com/embedImage.png?bid=2vbJZ482)](https://blend-exchange.com/b/2vbJZ482/)

Here are more tutorial related to the blending between floor and meshes:
<https://www.youtube.com/watch?v=6auecD4Rhx4&ab_channel=LOLDOBLENDER>
<https://www.youtube.com/watch?v=5xYo0rE0aIM&ab_channel=PalurdasArts>
<https://www.youtube.com/watch?v=4BTM4YPAeh0&ab_channel=Crompwell>