So here’s a preview, using a threshold on brightness of the ground texture to decide where “pixel shadow” is.
It’s somehow unintended that the overall-effect appears out-of shadow instead of in-shadow, but that’s ok. The image with the lower contrast in light shows “before” situation, and the hard in-light one should, according to my theory, feel a lot more natural.