Creating a material that catches only shadows

There are post-process materials available on the forum and the internet that work great if your ground is flat. However, if you have non-flat geometry like I do, Unreal will calculate self-shadows from the mesh, and there’s no way to cancel them.

It looks like this feature might be implemented in UE 5.6:

My last attempt was with Composure. It seemed to be the most promising method, but I didn’t have time to finish my tests as we switched to Blender.