If I didn't completely misunderstand the question, it might be possible that you'll be happy with this thing here (Blender 3.1.2+, but it should be adaptable):
Here, everything depends on how finely the mesh is subdivided, since otherwise, of course, only coarse normals can be transferred.
Therefore the following approach:
Since it would be too computationally expensive to finely subdivide the entire mesh, I first apply the
Geometry Proximity node to cut out only the portion that is in close proximity to the objects.
Once I have separated this part, I apply the node
Subdivision Surface to specifically subdivide this area.
Then, also using
Geometry Proximity, but evaluated from the side of the object, I am able to get the distance to the mesh, which I then translate into a range from $0$ to $1$ using the node
Map Range (From Min and From Max defines the range here).
This value can then be used as a factor for blending the normals of the terrain and the object with the node
I then simply pass the vector achieved in this way to a
Group Output on the Point Domain and give it the name "blend_normals".
In the shader I can then use this attribute with the node
Attribute and the name I gave it before.
OK, this is getting totally crazy here ;-)
I've tried changing the objects now along the overlap, so that not only the normals line up with the ground, but also the mesh itself.
This is a little tricky, and it also depends a lot on the resolution of the terrain, as well as the type of mesh.
In any case, from my tests, it doesn't work equally well with all shapes, and I consider this more of a hack.
Still, the result is quite respectable, and I don't think you can currently do any better with Geometry Nodes (at least not with a reasonable amount of effort):
(Adapted for Blender 3.2 !!!)
Roughly summarized, here's what I do:
- I first cut the relevant part out of the terrain, so that the computational effort is not unnecessarily large.
- Then I enlarge the object a bit, so that I can create a slightly larger cut edge on the terrain.
- I cut the enlarged object with the terrain and separate the upper half from the lower half.
- I do the same with the original object, but I keep only the upper half.
- From these three objects I use
Geometry Proximity and
Map Range to build the positions for the lower edge of the original object as well as the normals.
...I will explain this in more detail in due time, but for today it is enough.
Here is an overview of the nodes:
Have fun with it!