Page 1 of 1

FOV: How to use it for vision and lighting

Posted: Sun Oct 28, 2018 7:38 pm
by Duc_Guermantes
Suppose I have a tilebased 2D game where all objects have the same 32x32 dimension. I have a light bulb inside a room, and I want it to work just like it would in real life, aka with shadows, and I also only want to render pixels inside the player's field of vision.

How could I do that? People tell me I need to use a depth test but I don't know how to do that with Love or GLSL. I suppose I could use some sort of geometry for each light, but I don't know how to do that either.

I'm completely lost, I don't even know where to start. I made a very simple FOV system with GLSL but it is terrible and not useful. Could someone help me?

Re: FOV: How to use it for vision and lighting

Posted: Mon Oct 29, 2018 7:20 am
by veethree
Here's a nice article about it.