Light is sight
When we start talking about the importance of lighting in Geomerics, we often refer directly to light’s importance in setting the mood and atmosphere of a scene - but we jump way ahead of ourselves here. Step one of light in physics – without light, there is no sight. Everything we see in the real world is the result of light reflecting off surfaces and into our eyes. If we turn off the lights in a room, close the curtains, stuff the doorframe with fabric to stop light leaking in, the objects within it are still there, our eyes are still there, but the objects remain unseen. Defining and highlighting form is the first step in lighting; it lets us see details in objects and determine how they are shaped. Smooth surfaces gradient softly between light and shadow, but sharp edges deliver distinct changes.
Going from this basic first step to effectively using lighting to set the mood, intensity and atmosphere of a scene is a long jump. There is no magic formula for getting the perfect combination of light, shadow and color to achieve the desired artistic vision for the environment, in part because it is, like any art, subjective.The combination depends so much on the ambience being created - mystery horrors, for example, will tend to use low lighting and lots of shadows, punctuated by pools of light to grab your attention and draw you in; sometimes even plunging the player into darkness with the only light source being a torch controlled by the player.
The variety of lighting
When designing a game, there are many different light sources available: for example directional, ambient, spotlight and point light. The source of a directional light is infinitely far away such that by the time they reach the viewer all light rays are parallel – a good example is sunlight; they can be stationary or movable. Ambient lighting casts soft rays equally to every part of a scene without any specific direction, and so provides light but not shadow; it has no real source. Spotlights emit from a single source in a cone shape with an inner cone angle that provides full brightness and an outer cone angle that allow softening at the edges of where the light is falling; these are often used for torches. Point lights are much like real-world lightbulbs or candles, they emit from a single point in all directions.
Each of these light sources will provide a different type of direct lighting and their effect is computed by the rendering engine. However, to simulate the physics of lighting in the real world it is important to also calculate the indirect lighting, or global illumination, of a scene. Global illumination takes into account the way in which light travels from its source, hits an object and is then absorbed, reflected, scattered or refracted across every subsequent surface it encounters. It is perfect for producing the kind of style required by architectural visualization, interior renders, scenes with direct sunlight and photorealistic renders thanks to its calculation of indirect lighting, soft shadows, colour bleeding and more. For example, light reflecting off a red leather seat cushion will “bleed” colour onto the wall next to it – depending on the colour of the wall this could produce a reddish glow (if wall is white), or purple (if wall is blue). Alternatively, a great effect is where light can leak from one room to its neighbour, gently illuminating the new room through just an open crack in a door.
Bear in mind that an exact simulation of how light works is not necessarily required. All that’s needed is something that is good enough to fool the (admittedly, clever) human eye.
Solving the global illumination challenge
One option for achieving global illumination in a scene is an offline lightmap bake. This gives the illusion that light is being cast onto an object, but what you’re actually seeing is just the effect of the light baked onto the texture. This technique delivers high quality results, but the iteration time is slow and it has limited runtime possibilities – for example the baked light won’t have any effect on moving objects, not can it be turned on or off during play. Another technique is “bounce lighting”, where artists add light sources into the game at strategic positions in order to simulate global illumination – for example at the point where a light would be reflected, a new light source is added with the desired properties. In comparison, this has a fast iteration time, but it can take a very high number of iterations to achieve physical correctness, it is hard to achieve dynamism and the number of light sources may be limited by the engine in use.
Enlighten is a third option for achieving accurate, lightweight and dynamic global illumination. Enlighten uses real time radiosity to compute the interaction between a scene’s geometry and light. It contains a unique and highly optimised runtime library that generates lightmaps of bounce lighting in real time. The lightmap generation occurs on the CPU and is simply added to the rest of the direct lighting on the GPU. This approach can be further combined with lightmaps generated offline, so only the lights and materials that need to be updated at run time incur any cost. In this way, Enlighten offers a highly scalable solution suitable for all gaming platforms, from PC and console right the way down to mobile, and all lighting requirements, from fully baked to totally dynamic. Because the scene’s lighting and materials are also able to be updated dynamically at runtime in the editor (as well as in the game), rapid iteration is possible. By taking into account the indirect light, surface properties, and specularity in a scene it generates an extremely high quality and realistic output. For example, by enabling the bounce lighting to pick up the colour properties of the surfaces in the scene, Enlighten naturally ties together the geometry and lighting in an environment. In addition its ability to update materials’ properties at runtime create a host of new gameplay opportunities, as demonstrated with the Subway demo where destruction was achieved by making walls transparent.
More information on Enlighten is available at www.geomerics.com.