In this reprint from the April 2005 issue of Game Developer magazine, Steve Theodore concludes a two-part series on design fundamentals for lighting artists. Part one is here.
Last month we started looking at the uses and abuses of lighting for games. It's worth repeating that lighting is our most powerful tool for subtly manipulating a player's emotions. This month we're going to round off the discussion of lighting by going to the dark side, literally, by asking what is the role of contrasts in lighting design?
3, 2, 1 Contrast!
The last column ("Let There Be Light: Colored Light,"
March 2005) alluded to the way color choices in lighting can act as a kind of running commentary on the scenes and actions they illuminate. If colored lighting is all about suggestion or implication, contrast is all about bald statements and information.
Contrast, after all, is written right into the way we perceive forms. We know the difference between a sphere and a circular plate because we see gradations of shade on the curved surface. Without that contrast of highlight and shadow, color alone ends up as a set of abstractions. Color can evoke a mood, but without the definition provided by shading, it can't embody concrete things. For this reason we have a lot less freedom in how we use contrast than how we tweak color when we light scenes.
In theatrical and film lighting, contrast is expressed as the the key-fill ratio, the relative brightness of the key and fill lights. The key light represents the major source of light, such as the sun, moon, or the main room lighting. The fill light, the secondary light source, is positioned about 90 degrees away from the key light and is intended to bring the major forms of the subject into relief. High key-fill ratios produce strong contrasts, which generally suggest tension or drama. Low ratios, on the other hand, produce more even lighting and a gentler distribution of tones. The key-fill ratio is distinct from the overall brightness of the scene. High ratio scenes are typically darker overall than those with lower ratios. In traditional cinematography, contrast in lighting design has been refined to almost scientific rigor. Even though our medium is quite different, the accumulated experience of a hundred years of film and theatrical lighting is an excellent starting point when planning a lighting scheme.
The choice of key-fill ratios is usually governed by well-established conventions. TV comedies and talk shows, for example, typically use a ratio of 2:1 or 3:1. A low ratio like this produces no ominous undertones and creates even, pleasant gradations in tone. Not coincidentally, low contrast lighting also flatters the actors' complexions, de-emphasizing wrinkles and bulges. Dramatic shows, however, us u ally shoot at a key-fill ratio of around 4:1. This creates stronger shading, injecting some graphic tension into the composition. It also emphasizes the geometry of the actors' faces, making it easier to read their expressions. Ratios above 7:1 or 8:1 are usually reserved for thrillers and action movies. A brooding film noir shot or a stylish Matrix
action scene might go as high as 20:1.
The conventional language of key-fill ratios is a good starting place for planning game lighting, but doesn't (and shouldn't) provide precise numbers. Real-world lighting is infinitely more subtle and complex than our crude digital approximation, where we don't have to worry about unwanted bounce light or shadows, and we can choose whether to let our lights fall off with distance. But even if you can't rely on the numbers, you do need to be aware of how those conventions will shape the audience's reactions. You can violate those expectations, but it's not wise to do so without a clear reason in mind.
Light Defines Space
The list of key-fill ratios doesn't cover all possible lighting scenarios. The canon of cinematic lighting focuses on modulating the appearance of the actors, but a great deal of game lighting is really about defining spaces rather than spotlighting characters. Oddly shaped or unusually constructed spaces need to be lit with particular care. Lacking some of cinema's built-in cues, like atmospheric effects, depth of field, and shape-emphasizing radiosity, it can be hard for players to decipher an unfamiliar setting. It's usually wisest to begin experimenting with a moderate contrast ratio, in the region of 3:1. Go much lower than that and it becomes difficult to perceive the 3D contours of a space (although cartoonish environments with very strong color contrasts are an exception). On the other hand, very high contrast ratios tend to disassemble the scene altogether, reducing it to an abstract pattern of light and darkness in the classic film noir style.
Sunny Side Up
When you have complete control of the scene, especially in enclosed spaces with artificial light, you can base your contrast scheme on the dramatic needs of the game, using the contrast to create or diffuse graphic tension. Lighting for outdoor scenes, however, is a much trickier business.
Most developers know that the 2 4-bit color space used in games is so fine that most people can't actually see all 16 .7 million possible RGB colors distinctly. That's true, but it's only part of the story. We all know that an RGB value of 25 5, 255, 255 means white. But the white of a piece of paper and the white of a snowy field are hardly the same. From the standpoint of pure physics, snow on a sunny day may reflect 300 or 400 times more light than that sheet of paper. Of course, we know our monitors and TV screens aren't as bright as a kid's flashlight, much less the sun (not a bad thing, when you recall our unhealthy ad diction to garish sprite effects). How c an we recycle those measly 256 levels of brightness to represent everything from the mines of Moria to the blazing nebulas of distant galaxies?
Doth My Eyes Deceive Me?
Luckily for us, our pictures (and photographs and movies) work within such a limited range because our eyes are programmed to recalibrate their perceptions of light and dark. Mid-tone shadings that would be easily distinguishable under a reading lamp are blanked out in the bright light of day. Faint glimmers of light that would be invisible in daylight are easy to navigate by at night. Most of us are capable of distinguishing between 100 and 200 shades between black and white. As white grows or shrinks in intensity, our brains basically stretch those hundred or so shades to cover the whole range from darkness to lightness. Since our eyes are already doing a great deal to compress the huge range of intensity variations, we're physiologically primed to accept monitor images or printed pictures as "real" even when they cluster in a very narrow range of absolute intensities.
This might seem like just interesting trivia, but in fact it's critical for effective contrast management. Our ability to recalibrate teaches us that the distribution of contrast in the image is an indication of the strength of the light source(s). T his is actually something of a paradox. Bathing a scene with intense light ought to mean that every surface is reflecting more back to the eye, and so you might expect the image to wash out. Our biological contrast filter, though, has to stretch our limited visual palette to cover the intense highlights as well as the somewhat elevated ambient colors. Even though the low tones really are brighter in absolute terms, that increase is insignificant against the vastly expanded scale of intensities. Tones in the low end of the scale will seem darker even as they reflect more. For obvious reasons, therefore, we instinctively see contrast as a proxy for the intensity of light in a scene. Sharp contrasts suggest intense light sources while an even distribution of mid-tones implies a softer light.
For a perfect example of this principle, take a look at the two Vermeer paintings in Figures 1 and 2. The sharp contrast between the glaring sky and darkened houses in Figure 1 subliminally reminds us that the sky should really be hundreds of times brighter than the bricks and stones. Conversely, the very level tonal range of Figure 2 recalls the dim, ambient light of an overcast day; the contrasts are so gentle that the whitewashed walls seem dingy, even though they are almost exactly the same luminosity value as the bright sky in the first picture. As you can see from the histograms (Figures 3 and 4), the "brighter" image actually uses far more dark colors.
The complex role of contrast is both a blessing and a curse for artists. As the two paintings demonstrate, it's possible to suggest enormous variations in light conditions convincingly simply by manipulating our expectations about contrast and intensity. At the same time, our tendency to read contrast as an indication of intensity places some limitations on how much we can tweak it in game scenes. This, in turn, can create some tricky problems when the needs of composition and mood conflict with the demands of realism. When designing lighting for an indoor scene, you can cheat your way to whatever contrast scheme suits your needs. If you invoke natural light, however, you give up a good deal of freedom -- unless, of course, you're content with the perpetual dreary overcast that passes for outdoor lighting in most games.
Take It Outside
The variable intensity of outdoor lighting also places a large strain on texture artists. Imagine the following scenario: You ask a texture artist for a brick texture. Naturally, you want it to contain all sorts of subtle little details, cracks, stains, and so on. In order to include those, the texture artist uses most of the RGB range in painting the texture; the cracks are down near black, the mortar up near white and so on. You look at the texture in isolation, it's great. You render the texture in the game on a moderately lit interior wall and again, it looks great. Then you try it outdoors and run into an obvious problem: The white in that mortar is as white as the clouds in your skybox, which should be several dozen times brighter (see Figure 5).
There's no easy way to preserve both the detail in the original texture and the lighting of the scene. You could make two copies of the texture and dim the exterior version. Doing so costs memory and throws away some of the detail data in the dimmed version but retains the subliminal sense of natural light. If texture memory is at a premium, though, you may have to reuse the original version of the texture, accepting that the even contrast in the final image will destroy the illusion of outdoor lighting. Many offline renderers (and a scant handful of game engines) will allow you to apply a post-process darkening to the texture (or, if you're particularly lucky a post-render gamma correction) that mimics the adaptive behavior of the eye. With most contemporary real-time engines, you'll have to sacrifice something, either memory or lighting fidelity. A useful trick, if you have support from your coders, is to add a dimming coefficient to the material system; you can tune down the original texture without having to duplicate it. Nevertheless, the basic problem remains: While you can let your imagination run wild in indoor scenes, naturalistic, outdoor lighting is a very demanding medium.
Lighten the Mood
Hopefully, up-and-coming technologies will at least lighten the burden of coping with naturalistic lighting. Few of us can match Vermeer's eye for the subtleties of light--but even fewer of us have game engines that can handle dynamic over-brightening very well, much less true HDR rendering. Progress is being made, though. Some remarkable work is being done in academia, and in offline rendering (notably last year's Spider-Man 2
and The Matrix Reloaded
). In the meantime, Masaki Kawase's image-based lighting demo
shows how much can be achieved in real time today, albeit under tightly controlled circumstances. For most of us, though, it will be quite some time before we can rely on technology to simulate the real behavior of light. While difficult, immersive lighting is far from impossible. ICO
proved that even a PS2 can marshal the intricacies of light in the service of story-telling. The point, after all, isn't to create a soulless simulation of photons bouncing around, it's to set a mood, create an atmosphere, and to transport players into the worlds we build for them.