This more patchy then the AO version because it will not test surfaces and can be very slow. This will create a sphere ray from each vertex of the target object and project it onto the surface w/ the shader node through the 'density' output.
You can invert this output with the invert node and use a color ramp if you need to adjust the bias (although usually displacement you want as linear) then run it to an emission shader and bake the emission pass.Īnother option might be the 'point density' node, set to 'object vertices' mode, world space, targeting the other object. As soon as a ray hits a target it will return a color, black will be a ray that basically didn't travel at all, White if it traveled the longest distance you allow it to travel in the material node the surface will return white. Check the 'inside' option to project rays internally (from the backface normal).
In the shader editor, add an Ambient Occlusion node. You can get a rough grey-scale displacement by using Ambient Occlusion. I don't think displacement has technically been in blender since 2.79 or lower as it was par tof the blender internal engine that was dropped.