The computer gaming icon that is Half-Life 2 recently celebrated its 20th anniversary Valve has made every effort with a major recent update integrating the game with its episodes and adding a commentary track. The studio also released a two-hour documentary about the creation of the game and what was happening at Valve during its development, full of fascinating digressions about the challenge it set itself. And one of them was lighting.
The development of Half-Life 2 was rooted in what many employees refer to as a “technical wish list” that would take six years to fully come to fruition and was absolutely fundamental to what Valve wanted to achieve with the game.
Ken Birdwell was one of Valve’s first employees (he left the company in 2016) and, like almost every Valve employee, he wore many hats throughout his time at Valve: however, he can easily be described as an extremely talented computer engineer. The now-defunct Half-Life website included a biography of Birdwell, listing some of his projects: “circuit emulators (CodeTap), 3D surface reconstruction (Surfgen), 3D prosthetic design tools (Shapemaker), and satellite networks (Microsoft’s Broadcast PC program). He also wrote one of the first graphical shells for online multiplayer games for Compuserve’s Sniper.
Antonov actually underestimates the shooting angle. Birdwell worked for TeleCalc (a B2B software company) in the 1980s and apparently saved enough money to pursue his passions after he left: he studied painting, photography and animation at Evergreen State University from 1990-94 and earned a B.A. degree in Fine Arts. Returning to Valve and Half-Life, he mainly worked on the animations and artificial intelligence of the first game (and also had the idea for the G-Man). When Half-Life 2 came out, there was probably no one in the world who was better suited to the state-of-the-art lighting Valve wanted. Sure enough, he noticed the problem right away.
“The calculations we used were wrong,” Birdwell says. “And not only that, the math everyone was using was wrong. And when I started correcting it, I realized how bad it turned out… and then I corrected it and suddenly everything looked great!
Let’s stop on this side. Birdwell smirks as he says the last line, which we’ll allow because this guy improved the math used for lighting so difficult that graphics card manufacturers had to change their calculations. I found the thought too fascinating to leave alone, and sought out Birdwell to ask if he could branch out a bit.
“It’s a bit technical,” Birdwell begins, “but the simplest version is that graphics cards of the time always stored RGB textures and even displayed everything as non-linear intensities, which meant that an 8-bit RGB value of 128 encodes a pixel of approximately 22% as bright as the 255 value, but the graphics hardware performed the lighting calculations as if everything were linear.
“The end result was that the lighting always looked bad. If you were trying to shade something that was curved, the darkening caused by the angle of the surface away from the light source would darken too quickly. Similar to the example above, something that was supposed to look 50% as bright as at full intensity but only looked 22% as bright on the display. It looked very unnatural, instead of a nice curve everything was too much shaded, the rounded shapes looked strangely exaggerated. there was no way to get things working in the general case.
Birdwell states that this is a “very common graphical error” and that even today in some areas of programming the programmer must “remember that all bitmap values are likely non-linear and cannot simply be added, mixed or mixed into a linear calculation without taking into account what ‘gamma spacewhere you work.”
The good news is that “current graphics cards already know all this” and at runtime they automatically convert any non-linear formats “to a nicely behaved linear floating point value inside the graphics card before the math is done, so it’s a lot easier.” But that’s how it is now.”
The reason for this is probably the fine arts major.
“Throughout the 1990s and into the early 2010s, that wasn’t the case,” Birdwell says. “At every step of the process you had to be very aware of what ‘gamma space’ you were in, otherwise everything would look very strange.
“The problem was that when I pointed this out to graphics hardware manufacturers in the 1999s and early 2000s, their response was, ‘you just noticed that my chips are basically broken until we design completely new silicon, I hate you.’ This wasn’t a fun conversation. She went through stages of denial, anger, bargaining, etc., all in quick succession with each new producer.
“I was very happy to be able to hand over these conversations to the newly hired HL2 graphics programmers, Gary McTaggert and Charlie Brown, who have been working on this step by step over the years.”
While trying to contact Birdwell, I found an unrelated patent issued to Valve in 2007 that lists him as an inventor. Patent No. 20070195090 concerns “Determining Model Lighting Using an Ambient Crop Abstraction” and is summarized as “a system and method for specifying model lighting in a virtual environment.” It goes into great detail about Birdwell’s innovations, and even if it has nothing to do with what he described above, it’s clear that this man is the god of lighting in video games.
Producer Bill Van Buren says elsewhere in the documentary that Half-Life 2 was based on three key principles, and lighting was one of those first. “To create something immersive,” says Van Buren, “visually really rich and compelling, something more like a movie, and the art direction and technology that made that possible.”
Valve certainly achieved this: Half-Life 2 still looks amazing to this day. And there are many, many people responsible for this achievement. But Ken Birdwell is the reason the lighting looks so good, and he did such an outstanding job that you could probably argue that every game since has benefited from him: Or, in other words, our graphics cards certainly have.
