If you need it for gameplay purposes, I suggest doing a trace from the object to the light, checking if anything interrupts visibility. For better approximation, you could do this from several points( all corners of the cube), and average the results. This is doable in blueprints. Obviously you can only afford to implement this for 1 object only, for performance reasons.
Rendering side of things looks different. It is possible to approximate this in post process material, but no way nearly accurate. You should inform what are you intending to achieve, since in most cases when such questions arise there already is an elegant solution