CODESHOP: Step Into The Light
Geomerics kick-starts its vision of realtime game lighting with the launch of Enlighten.
Pointing out where game developers are going wrong is a traditional part of the delicate carrot and stick dance carried out by middleware companies trying to persuade said developers to use their technology. To that degree, it’s no surprise when Geomerics’ chief technical officer Jules Davis starts to stress the problems developers have to deal with when it comes to getting the correct look throughout a game.
“Everyone underestimates the amount of time it takes to do game lighting,” he argues. “The amount of money spent on lighting can be a bottomless pit.” The reason, he says, is that entire games can often end up being re-lit two or three times during development.
“Lighting is often the most important visual part of a game,” Davis explains. “Lighting is what gives a game its look. It’s not the textures per se, it’s the way they and the various maps interact, especially in terms of dynamic lighting.”
Usually this sort of sales pitch could be taken with a pinch of salt. The difference this time is Davis is talking from his own previous experiences as the technical director of UK studio Kuju.
“There are two basic lighting models currently used in games,” he continues. “One is an approximation to real lighting where you have lots of strong lights and lots of dark shadows but not much subtlety in between, let alone control over the color and atmosphere. The more common approach now is to pre-compute all your lighting offline and bake it into your levels, so everything looks gorgeous until you add dynamic lights. Then scenes start to look a little odd because the normal maps aren’t working well and you lose your specularity.”
Obviously, according to Davis, the solution is Geomerics’ just-released realtime lighting solution Enlighten.
Thanks to its use of a novel form of mathematics called geometric algebra (over which the Cambridge University spin-off holds several patents), it enables developers to take the first step in unifying these two approaches.
It’s not magic, though. For one thing, using Enlighten requires developers to reallocate some of their CPU budget to this new form of lighting. Davis won’t be drawn on exact figures, which depend on resolution and scene complexity, but says the order of five percent at 30 frames per second or better is achievable.
Still, one of the benefits of using geometric algebra is it works well on processors such as PlayStation 3’s SPUs, Xbox 360’s CPU cores or common-or-garden Intel multiple cores, as well as more esoteric platforms such as Nvidia’s CUDA and the possible technology behind the next consoles from Sony and Microsoft, Intel’s many-cored Larrabee.
It’s perhaps ironic, though, that Enlighten currently requires its own pre-compute step before the realtime lighting – technically realtime diffuse inter-reflections – is available. This is so Enlighten can understand the game’s geometry and pass this information to its runtime engine in a form it understands. Eventually Geomerics hopes to convert this to a realtime process, however.
More importantly, though, the technology itself is designed to be as accessible as possible. ”It’s not some sort of monolithic engine,” Davis explains. “It’s a small, modular API that’s scalable and flexible so developers have control over the quality of their output and the performance overhead.”
And it’s this promise of control that’s likely to be the fulcrum of Enlighten’s future success or failure. Once integrated within a developer’s pipeline, it’s designed to be an artist-focused tool in terms of day-to-day use.
“It will enable artists to iterate their materials and lighting in realtime, which makes an enormous difference in terms of how quickly they can come up with something stunning and unique,” Davis points out.
For example, studios which are currently pre-computing and then baking their lights into their levels often have to wait hours for the renders to be crunched through, and only then do any problems become known. Davis says that even if Enlighten is just used to replace this offline process, the productivity improvements would be significant.
“If you have to wait even ten minutes to tweak your lighting, not only does it have an impact in terms of time but quality too because you can’t immediately tweak it to get it right,” he says. “Using Enlighten, you get higher quality art, and there’s no waiting around for updates and you’re using your artists more efficiently, so you’re winning twice.”
Another important factor in this regard is the way that, while Enlighten could make in-game lighting look more realistic, it can equally be used to make it completely unrealistic. “Realism is a side-effect of Enlighten,” Davis says. “If an artist wants a wall to reflect light unrealistically, such as a red reflection off a white wall, they will have control over those sorts of options.”
Neatly, this also means that no matter how many games use Enlighten, there shouldn’t be a characteristic look – something that has been an issue in the past with less flexible middleware.
But, of course, the final validation will only come with industry acceptance. A small set of key partners have been using a pre-release version of the technology, with a commercial release expected in March. As part of Epic’s Integrated Partner Program, Geomerics will also be integrating Enlighten into the Unreal 3 Engine. This means that the first games using Enlighten could be in stores by the end of 2008, although early 2009 is a more likely timeframe. And then we’ll know if the smarts behind Enlighten really do shine.