Lighting and Field of View

Luke Peña

Member
My game is a 2D platform game that all takes place in dark corridors. I intend to use something like the Aura lighting engine on the Marketplace to handle the lighting:

https://marketplace.yoyogames.com/assets/721/aura-surface-based-lighting

But I also want to have it so that you can only see what is in the field of view for the player. So imagine that same lighting engine, except the only light is on the player and everything outside of that is pure black.

The problem is that I want both of these on top of each other: so underneath you have normal lighting coming from the environment and then on top of everything you have a second lighting system that limits the player's vision.

What is the most efficient way to do this? The way I first thought of would be to run an engine like Aura twice and have two separate surfaces layered: one for lighting and one for my field of vision.

Does anybody know of a better way to do this?


Thanks!
 
S

Snail Man

Guest
I don't know of a better way, but there should be ways to optimize your route, for example running the second part of the engine only over the part of the screen that's in the field of view. Even if you only divided the screen into quarters and only drew the quarter the player was looking towards, this would significantly increase performance over just running two full lighting engines
 
Top