After four years of waiting, Doom 3 has now gone GPL. Well, really, it’s just the id Tech 4 engine as all of the game data is still under the original EULA; Doom 3 and Doom 3: Resurrection of Evil are both still for sale on Steam. However, you can now see some of the genius and/or madness that went into the goods that powered games like Prey, Brink, and more.
Doom 3 actually innovated many new game engine technologies (MegaTextures, which can be found aplenty in Rage, came later in its prototypical form with Enemy Territory: Quake Wars), though the big one would be unified lighting and shadowing. Most games before had used lightmaps, a rudimentary method of statically representing how an object should be lit, with dynamic lights only changing the brightness of a given vertex and not generating realtime shadows.
This new lighting technique, however, could produce realtime shadows where an object’s reflected light would affect the whole scene and offer self-shadowing. This largely came from a breakthrough by John Carmack in developing something many came to call “Carmack’s Reverse.” This is basically Carmack’s implementation of the depth pass variation of shadow volumes (first proposed by Tim Heidmann in 1991) called depth fail, but it turns out this algorithm had been discovered and discussed by researchers at Creative Labs years prior, resulting in a patent in 2002, two years after Carmack’s discovery.
However, due to the patent, Carmack’s Reverse resulted in legal trouble regarding Doom 3’s release. Creative Labs eventually agreed to allow id to use the algorithm for free (a ridiculous notion to start with; this is like patenting the Pythagorean theorem) but with one stipulation: they must use OpenAL, an open-source multi-platform audio API, and Creative’s EAX sound technologies.
The reason I bring this up is two-fold: 1) this is not, technically, the Doom 3 you’ve played in the past, and 2) the Creative patent on stencil buffer shadow volumes is absurd. I’m sure most of the engine has remained untouched, but I’m also sure a team involving John Carmack and Timothee Besset won’t leave problems unsolved; they’ve almost certainly made improvements while ensuring the release was ready for public consumption.
And in regards to the second point, to get around the patent, Carmack added four lines of code and changed another two. While I won’t argue that at the time it made sense with respect to finances and release schedules and whatnot to acquiesce to Creative, it’s a damn shame the situation had to shake out that way. Shadow volumes is one of the most popular methods for realtime lighting in 3D graphics, and now a precedent has been set for using a stencil buffer implementation of the technique.
Yes, I am still upset about it. Why do you ask?
Anyways, have fun poking around the code! I’m curious to see what this PropTree library is all about.
Source: John Carmack’s Twitter