Here is my problem. I have a terrain and i have a spotlight in that terrain…
The spotlight usually points down so it forms a cone. What i need is a way to render only the areas that are visible from the spotlights perspective, Like some kind of line of sight test.
Now i tried with shadow mapping but didn’t quite get anywhere.
I was thinking would it be possible to draw from the view of the spotlight ( btw. how do i set my projection to be as the spotlights ) into a FBO and then just dont lit anyface that is not in the FBO. In essence like the shadow mapping just not drawing a shadow map.
Or would it be possible to use occlusion query to chek what is not being “seen” by the light and not litting it ?