Possible Shadow Idea?? Question.

I read a paper the other day online, that told me a way to do shadows. BUT i have no idea if it holds water. Here is what i remember about it. Let me know if you think it would work.

First you render the scene. Then you take the depth buffer, and compair the values of the depth buffer with the location of the lights in the scene. You then Take those locations, and based on the xy values you can determin if the point in the depth buffer lies infront of behind the light. If its behind the light, then it is shadowed.

But i have a confiliction here. It is only shadowed if there is something in front of that particular piece inside the buffer. SO, 2 problems, how do you determin if there is something larger in front of that object blocking the light, and also how do you know if someing off screen isnt blocking the light?? This method seems to be a little full of holes, but maybe i read it wrong.
Any ideas??

Hi Dabeav,

Are you talking about shadow mapping? There are lots of examples of this technique in use.

Thanks -