Better Floor Lighting

17.03.2012

Having played the excellent Return to Valmor mod for a while, I noticed that Chuck had used terrain type objects as floors. Usually they're used as walls, but if you make the flat and remove their physics, you can easily use them as floors as well. They make excellent floors for buildings, because they have sharp edges, but they lack in one major aspect - lights only affect their edges. That is, if you are standing in the middle of the floor, your torch wouldn't light anything at all, because only the terrain edges could have lights. And I've just fixed that!

I've added a new button to the editor for terrain objects that allows turning on polygon subdivisioning, which makes the terrain objects have lighting points inside them as well. They are a little bit slower to draw, so use the effect sparingly. I will update Driftmoon with the new code as soon as I can finish another new thing I'm making... Stairs!