How to block custom lighting with obstacles?

I created a custom lighting shader, but the light penetrates the obstruction.
What is the technology to prevent this?