Texture baking of shadow.

I have a scene with a light source that illuminates an object. Is it possible to make a baking of shadow only (black and white, shadow and illuminated part) and use this map as an alpha channel in the material of each object in order to get rid of the parts of the mesh are not lit? It is possible to do it in real time? Sorry for the strange question…

This is doable with a custom shader, but the “alpha channel” part is not necessary.