This is generally handled with ambient occlusion or ambient obscuration, basically some type of “closer I am to a deep notch in geometry, the darker I make the pixel.”
There are various runtime solutions to this, including screenspace techniques such as SSAO that approximate the effect for runtime use.