Telling a shader where shadows should go
Sometimes you want fancy shadow casting techniques to give your shadows just the shape of the object that created them, but sometimes you already know where the shadows should be and there's no need for any sophistication.
For example, suppose you're in a hallway and the only source of light is a torch. There's a corner, and the corner blocks the light of the torch, casting a shadow on the entire hallway beyond the corner. It's simple enough to determine where the shadow should be. We don't need to render the scene from the point of view of the light or anything crazy like that. All we need to do is tell the shader to ignore all direct light beyond a certain point in the hallway.
The question is: how exactly do we get that information to the shader? Right now my favorite theory is creating a scene-spanning texture that's dark-colored in areas that should not get direct light and light-colored where the light can reach. We can use SetPixel to update the texture for dynamic lighting. I have also considered adding vertex colors to every vertex in the shadowed areas. Either way feels like it's missing the point of what I'm trying to do.
What is the correct way to do this?