Global Illuminations
Most lighting in computer games is created using a direct lighting model, in which surfaces are lit by direct sources and a preset ‘ambient’ light level. Ambient light doesn’t exist in the real world, however. Instead, surfaces are indirectly illuminated by light bouncing off other surfaces, which affects both intensity and tone of the light. In 3D graphics, the light reflecting from surface to surface many times is impossible to compute in realtime at present, and won’t be possible for a good while yet. So the idea of ‘global illumination’ right now is to compute light bounce values and hold them in textures that are taken into consideration for final colour values when rendering the scene in realtime. There are other techniques but, in effect, the results are currently very similar – static yet realistic lighting with some limited influence of realtime lighting. It can still create some spectacular results – witness the subtlety evident in the lighting of Halo 3.
Imposters and Geometry Sequencing
With games increasingly attempting to show a far greater scale of action, such as large battles or bustling city scenes, the need to render large numbers of similar objects has become ever more significant. Two very different techniques can achieve this while avoiding some of the great processing cost. Geometry instancing uses a single carefully optimised model that can be manipulated purely by the GPU by ‘instancing’ it and changing just a few parameters, such as its location, to repeat it in the scene. By restricting the process to the GPU there’s less need to move memory around and take up power from the CPU. The vividly named impostors procedure renders a single or series of models to textures, which are then displayed as scaled sprites in the game world. Because the sprites have been created with the very same parameters, such as lighting, they tend to fit into the scene naturally. This is how Rare created the troll battle sequences in 2005’s Kameo.
Parametric Surfaces
A problem with representing 3D worlds with meshes of polygons is that of detail versus distance. If a single static mesh is used for each object, the computation in rendering its detail when viewing from afar would be wasteful, and not have enough detail if viewed from close by. This can be eliminated by storing multiple meshes and switching between them (see ‘level of detail’), but in some instances it would be better to construct the mesh on the fly, adding or subtracting polygons as distance changes. Parametric surfaces can be used to achieve this by representing surfaces like the curved underside of an arch as mathematical formulae, from which the rendering engine generates meshes on the fly. Such curves can be represented by a spline and a specified width. Quake III used the technique in order to generate the complex organic forms that feature in some of its maps.
Spline: In computer graphics, a spline refers to a curve in 3D space defined by a number of control points.
Level of Detail
As 3D worlds allow players more freedom to move around and explore, level of detail switching becomes crucial to maintain high levels of detail. Players would expect to see individual branches and fronds of foliage when close to a tree, but it’s wasteful to use this model when the tree is at a distance. There are many ways to simplify distant geometry by culling detail, such as with impostors, tessellation of parametric surfaces, or switching in lower detail meshes – all parts of a level of detail system. An outstanding example of this is the forest rendering system in 2004’s Far Cry, in which trees switched from high detail models to lower detail and eventually to sprites, while ground foliage was faded out and eventually turned off in the middle distance as Crytek made use of the fact that foliage in densely packed jungle obscures much of the ground cover further away. Employing LODs in this way was the only way Crytek could realise its vision on the available hardware, and it’s one of the key features of many modern graphics engines.
Post Processing
Some of the more arresting visual effects created by games in the last few years, such as bloom, depth of field and blur, are down to post processing. They’re possible through the ability of a modern GPU to convert the frame buffer to a texture at any point during the rendering of a frame. This can then be used as an input in other rendering passes, converting the frame buffer to a texture multiple times. Depth of field is created by rendering as normal and capturing both the colour and Z-buffer to a texture. The colour texture is then blurred and composited back over the original, sharp frame buffer using the Z-buffer’s depth value to define where it should be sharp and blurry. Most current-generation games make heavy use of post processing, but Prince Of Persia: The Sands Of Time stands out as one of the first games to rely on these techniques to create a highly distinctive visual identity.
High Dynamic Range Rendering
Another fundamental problem with game lighting is that of light intensity. The human eye has a contrast perception of about 1,000,000:1, but the best plasma TVs offer only a contrast ratio of about 10,000:1. Put another way, at best, a TV’s brightness is only 1000 lux, compared to a clear day, which can be 20,000 lux. What’s more, computers render images using just 256 levels of intensity each for red, green and blue – hardly wide enough to simulate the likes of sunlight streaming in through a church window. HDR attempts to fix this by rendering the scene with many more light levels than the 256 the TV can display. It then ‘tone maps’ the value back down to 256 levels as a post processing step. Tone mapping simulates an iris contracting and expanding to alter the exposure of the image, so that the dark areas appear darker and the lighter ones relatively brighter than the original image. It’s now a standard element of most games, but its benefits were demonstrated best in Valve’s Half-Life 2: Lost Coast tech demo.
Waaah! You forgot cel-shading! My fond memories of Jet Grind Radio are aching.
Great article! I’m really glad I know what all those fancy words mean now, seriously. It’s fascinating to learn the various tricks that devs use to make the games look real, when the way light really works would be too expensive even for today’s powerful processors.
A nice overview, but I was a little disappointed by the lack of 'future tech'. LittleBigPlanet showcases a new lighting technique that creates a very convincing realtime GI look. Alex Evans work is documented here :
http://ati.amd.com/developer/siggraph06/Evans-Fast_Approximations_for_Li...
He goes into more technical detail here, in a combination paper that links in with some other methods. Evans' GI solution is the last chapter. :
http://ati.amd.com/developer/techreports/2006/SIGGRAPH2006/Course_26_SIG...
The method isn't broadly applicable and only found its way into LBP due to LBP's 2.5D design, but it shows an alternative lighting model and how novel thinking can find striking solutions.
This is a brilliant article EDGE. I've just been on an animation course and i really needed the basis like this to understand what the hell i was doing. I didn't most of the time. So although i can use Maya quite well it feels pretty hollow.
This has been really helpful. I think they should put this sort of thing in as the first chapter in the textbooks, and have references to pages where each effect is explained in more detail, and pages which explain using it in Maya. You could have a checklist for your understanding of each technique. Then you could skim through in revision, reading this first article and easily revising more if you don't understand. We students are kind of desperate for this stuff. It's knowledge that teachers tend to assume we have. Teachers try to explain each deep and convoluted technique, but loads of students get left behind in a sea of unknown intensely technical talk that means nothing to them. The teachers tend to rely on all their own familiar terminology and like to give a focussed little speech that assumes we know all the background information, just so they can delve into a technique quickly, rounding it out for their own benefit. We really need a well ordered way of studying it ourselves, just to get a grounding. It needs to be in our own time, backtracking to what we need to know when necessary.
I was fascinating how much of this I actually understood just because I work with satellite imagery on occasion. Granted, I've HEARD and could basically explain all of it to someone dumber than me, but someone who did this stuff for a living would see right through me.