Blending objects into terrain

Does anyone have any idea how to do something like this?

I was looking for a shadertoy example or something so I could at least get a grasp of it, but nothing. :frowning:

I think it may be simply implemented through vertex painting. You may color vertices that intersect the terrain, then just bake a model and apply your shader that utilizes the colors and blend materials together.