How to "limit" my light...

I hope its ok that i post again almost the same question… But i really need help…

Here is my problem…

What i want is only to light the faces that are in the line of sight of the light. As in the picture i dont want light where i have circled with red…

What i am thinking is somehow rendering a view from the spotlights pov. Then identifying all the faces or if i can fragments that the light can see, and then having light only on them ? At this point I am desperate for ANY ideas.

How can i identify the faces ? How can i draw light only on the ones the light can see.

Uhm, … shadowmaps

And DmitryM already told you what to do.

But he wasnt very clear :slight_smile:

‘Clear’ answers you can hear from a neighbor beginners section, especially for such kind of a question.

Read about shadow maps, applied for spot lights.
Read how they can be extended to point(omni) lights.
Ask your questions on the beginner forum. Don’t double post!