Blender Object to Object Displacement Map Baking
A set of Geonodes which can be used to bake a displacement map that can be used to displace a mesh into the shape on another.
Useful for performance optimization with Adaptive SubSurf, or for baking LODs.
To use the nodes, add the "Displacement Texture Bake" geonode modifier onto the object that will be displaced, then define the object you wish to bake from. This will bake the displacement to an attribute channel, "Depth Baking". Bake this attribute into a texture. A material has been provided in the download file to demonstrate this.
Make sure to set the "Subdivision" input to a appropriate level. (higher levels will result in a better bake, but longer bake times) Tweak the "Displacement scale" input so that it just barely covers the entire mesh. (if it is set too low, then the texture will have it's values cutoff, resulting in sudden flat areas.)
The mesh that gets displaced must cover the entire reference mesh for the bake to work properly.
A set of nodes that can bake displacement textures.