Makin' a Game: Natural Lighting Engine

Avatar image for fobwashed
fobwashed

2818

Forum Posts

388

Wiki Points

606

Followers

Reviews: 15

User Lists: 16

Edited By fobwashed

What's this update about?

Boiled down real short and sweet, the lighting engine.

Light and it's importance

For the type of game I'm making, exploration and indoor environments will play a huge role. When indoors, something that most games don't seem to really get right is lighting (and doors right =P). More specifically, natural lighting. Almost every game I've played, when you're indoors, you seem to always be able to see. I understand that not being able to see would really make most games stupid and unfun but try going into a room with no windows and turning off the lights. . . there is ZERO effing light =P So say you're in a situation where electricity is no longer around, and you're rummaging through a house, light management is going to be something that you want to pay attention to.

This video should show off a little better what I'm talking about. At the end, I'm simulating a bit of what it'd be like to explore by switching everything to undiscovered. Thinking about it, I should prolly have done a second walk through during night time to show the difference since things are really bright during the daytime =P I'll annotate it to clarify a few things when I can.

Natural light specifically

Flashlights and other portable light sources will play an equally important role, but the focus of this update is natural light. I'm no lightologist, but I've been doing some research into how light from the sun and outdoors enters into an area and I think I've got a reasonable grasp on it. The most important thing (I feel) about sunlight is that is scatters everywhere and so it comes in through an opening in all directions. Once it's inside, it also bounces around in all directions allowing it to light around corners and such. There's a word for the type of light that is, but I forget it at the moment -_-;; I wanted to build an engine that takes into account the way that natural light disperses through an area and I think I've gotten fairly close to what I want.

Improvements left to make

The first and foremost is the day night cycle. I've already got one, but specifically, I want the light to enter at different intensities depending on where the sun is located at a specific time of day. So, for instance, during the first half of the day, windows that are facing east should get more light than windows that are facing west, and then swap after mid day. I've got the hooks in place so hopefully I'll be able to knock that out in a couple days. I also need the light to travel up and down to different floor levels. So say a window on the second floor can light down a staircase and into the first floor. That's gonna be a bit more difficult, but I don't think it'll be too hard. Lastly, the dispersion of light is a bit rough, and I'd like to smooth it out a bit more. I'll have to tweak some of the numbers but I think I should be able to get that too.

I'll post up another blog once I get something more worth showing done. I don't think I've put up an update that's specifically about the changes I've made to the way player vision works so maybe next week or so I'll put up something having to do with that. The short version is that the player can now look up and down, and will need to do so to look at things above or below. Please feel free to leave comments, ask questions or just tell me how shitty everything is =D