Some lighting updates

While waiting for a few more models to be created, I’ve been doing more experiments with lighting.

Here’s a screenshot from a few moments ago:

This is just random point lights added to the scene, currently only drawing onto the terrain; not yet on buildings or other in-world objects (but that’ll be trivial to add, now that I have the basic system working). This is kind of neat; I haven’t supported multiple lights before, either in MMORPG Tycoon 2 or in the VectorStorm game engine in general.

Here’s where it gets really interesting, though; let’s zoom out:

It’s 50,000 randomly placed lights, covering the whole game world, all active at the same time. And it’s basically not affecting the game performance in any way. This is intriguing to me because MMORPG Tycoon 2 uses a forward rendering system, and traditionally it’s not supposed to be possible to have more then a small handful of lights in a forward renderer, without suffering from catastrophic performance problems.

Through its whole development cycle so far, MMORPG Tycoon 2 has used just one directional light, and some ambient light. And now we’ve jumped, in a single moment, right up to 50,000 lights (I haven’t even tried more than that; 50,000 itself is a silly number to have, so I have no clue what our actual maximum might be).

There’s still a bit of work to do on this, but I feel that it’s pretty promising. This was my third attempt at this kind of a “lots of lights while still doing forward-rendering” system, and the first one that is really performing as well as I felt like it needed to. Pretty soon, I’ll be able to put lights onto people who are leveling up, rezzing buildings will be able to cast light onto other nearby objects, fireballs will illuminate the trees they fly past, and so on. I’m really looking forward to getting all of that fully up and working!


And I now have these lights affecting ground clutter and objects in the world. What’s more, it’s now going through the same lighting pipeline as the regular directional light, so the lighting is better integrated into the shading. (It’s still just 50,000 randomly placed floating balls of light, though)


In motion:


And in light-motion:

(I’m not sure whether I’ll actually put lights on environment particles. It looks nice, but there’s a lot of them. We’ll see! But for the sake of a small video, it works nicely)