Reference another object's position in the shader

Is there any way to do it? Like, for example I have the object which cannot be UV mapped (animated metaballs or voxel remesh) and want to color it procedurally based on distance to the dummy object