Shadow with shader using black and white values / not vertex

Hi all!
There is some way to create shadow using just a fragment shader? I’m making a project working only on fragment (for now) and i’m looking to find a solution to generate a kind of shadow, using the gray value I generate on my fragment. There is some way?