In-Level Lighting


You know when I said I'd take the weekend off? 

I lied.

I originally made a very crude, very very inefficient line-of-sight system, that would obscure anything outside of the player's field of view (actually, anything obscured by a wall). This literally killed the framerate in larger levels, though, so I quickly ditched it.

Searching for tutorials regarding lighting using surfaces, I stumbled upon a very cool set of scripts, that were free to use. After a quick field test, I decided to include them in Downfall, Inc. They're a ton better than anything I could do, and it means I can focus on the A.I more now.

First, credit to the author - Shiny Jumpluff (http://youtu.be/MaDPr2Z1-lM). 

Initially, I used only one light, which followed the player. This was a visual indication to the player as to what they can see. They're looking overhead, whereas the character isn't. So I wanted to highlight clearly what was hidden from your view. 

My first problem was that the lights were always visible, even out of focus. I tried in vain to create two layers -- one for 'baked' lighting and another for the line-of-sight lighting - but I wasn't able to get it working.

I found a compromise for now, anyway. Basically, lights are just dimmer, and the overlap from the line-of-sight adds them back up to full value. It's not elegant, but I'm trying to find a better solution.

Here's a test shot;


And here's a demonstration of the line-of-sight indication.


Just a flying visit, back to work for me.

- Rob

Comments

Popular posts from this blog

A productive day!

New Character Designs

Locked Doors