~23~

The OpenGL Letters—Part 1

Read First:

Some of next few chapters go into considerable detail about Microsoft’s efforts to win the 3D API battle, also revealing much of the internal thinking that went into the decisions, complete with original email threads. This level of detail is probably most interesting to technical nerds and people who just find the internal workings of Microsoft interesting. Otherwise, it might be safe to skip or skim those parts. But if you really want to witness the battles that led to the decision to support Direct3D, realize that it was that decision that directly enabled Xbox to happen.

----------------------------------------------

DirectX was like Noah’s Ark after Microsoft flooded the world of DOS and they were all refugees trapped with us, having lost the world they were previously free in. It was like building and loading Noah’s Ark ahead of a deluge. No time for rehearsals or mistakes. The first boat HAD to float.

-Alex St. John

Toward the end of 1996, Microsoft had adopted a policy of supporting Direct3D (D3D) for Windows as a consumer facing technology and OpenGL for NT as a high-end solution. The two platform groups continued to be adversarial, however, and the NT group was positioning itself to support OGL as a consumer product in competition with the Windows group, essentially thumbing their nose at D3D.

Direct3D was especially in the spotlight for a couple of reasons: One, its launch had been rushed, and two, it had been rushed because of competition, both internally and externally, from supporters of OpenGL. As Servan Keondjian observed, there were still a lot of flaws and unfinished business by the time the first version of D3D was released. And all of this opened the door for a continuation of the battle for 3D API supremacy between OpenGL and Direct3D.

St. John and his fellow evangelists believed that they had largely won the battle, however, with the clear adoption of DirectX. Direct3D was officially supported by Microsoft as the 3D solution for Windows 95, but support for OpenGL still existed inside the computer game industry. Even so, it came as a big surprise when, on December 23, 1996, John Carmack issued what amounted to a public statement in support of OpenGL. Carmack posted his statement on an open forum, causing an immediate storm of commentary within the game development community—mostly in favor of OpenGL.

(Where I have quoted from Carmack’s original message, I have done so exactly as it was originally written. This means that there are some typos and misspellings. But Carmack is known for his programming brilliance, not necessarily for his writing.)

In his post, Carmack noted that he had been working with OpenGL for the past six months and that it had impressed him, especially in how easy it was to use. He wrote, “A month ago, I ported quake to OpenGL. It was an extremely pleasant experience. It didn’t take long, the code was clean and simple, and it gave me a great testbed to rapidly try out new research ideas.”

On the other hand, his experience with Direct3D IM (Immediate Mode) was less satisfying. “I started porting glquake to Direct-3D IM with the intent of learning the api and doing a fair comparison. Well, I have learned enough about it. I’m not going to finish the port. I have better things to do with my time.”

He went on to state, “Direct-3D IM is a horribly broken API. It inflicts great pain and suffering on the programmers using it, without returning any significant advantages. I don’t think there is ANY market segment that D3D is apropriate for, OpenGL seems to work just fine for everything from quake to softimage. There is no good technical reason for the existance of D3D.”

Although he acknowledged that D3D would likely improve with future versions, he advocated for the adoption of OpenGL to save developers from having to go through the evolution of what he called an “ill-birthed API”.

Carmack, like most developers, found D3D very difficult to work with, and, like most developers, he disliked the Common Object Model (COM) that Microsoft used. Referring to COM and execute buffers he states, “Some of these choices were made so that the API would be able to gracefully expand in the future, but who cares about having an API that can grow if you have forced it to be painful to use now and forever after? Many things that are a single line of GL code require half a page of D3D code to allocate a structure, set a size, fill something in, call a COM routine, then extract the result.”

To Carmack, ease of use was paramount, and between the two APIs, there was no contest.

Carmack’s best-case scenario: “Microsoft integrates OpenGL with direct-x (probably calling it Direct-GL or something), ports D3D retained mode on top of GL, and tells everyone to forget they every [sic] heard of D3D immediate mode. Programmers have one good api, vendors have one driver to write, and the world is a better place.”

This full-throated endorsement of OpenGL and scathing take-down of Direct3D blindsided people at Microsoft. St. John states, “I just remember the shock my team experienced when Carmack made the post because we had been working with him so long and didn’t see it coming.”

Internally, the initial responses to Carmack’s message disputed his position. One message from Kate Seekings quoted a software engineer named Aaron Peapell, who wrote:

“> Ive seen the complete quake source.

> OpenGL was uses [sic] in the WinQuake src _only_ to blit a buffer to the screen

> thats it. So all the John Carmack on OpenGL vs DX is a load.”

Another email sent by Christine McGavran on January 3, provided a breakdown of the relative strengths and weaknesses of some of the existing 3D engines. Calling out four main issues: 1. Usability, 2. Compatibility with 3D hardware, 3. Speed on software only, and 4. Cost, she provided the following information, which summarized the issues and somewhat agreed with what Carmack had written:

“D3d passes 2, semi-passes 3, passes 4, but fails 1. Open GL passes 1 and 4, but currently fails 2 and 3.

Renderware passes 1, semi-passes 2, passes 3, and fails 4. It also has the disadvantage of being doomed to fail eventually through lack of big-company support.

There’s also Quickdraw 3d to consider, which I haven’t seen much PC enthusiasm for.”

St. John’s Response

Meanwhile, St. John began an email thread under the subject header “Response to Carmack”. Of course, he took Carmack’s criticism seriously. In fact, on the subject of Direct3D being hard to use, he wrote, “Yup. He’s right.” He pointed out that if a genius like Carmack had a hard time working with it, who wouldn’t? He also stated that this was not news, and that they were already producing better documentation and new sample code.

St. John also pointed out that D3D was never meant to be “the ultimate software rendering engine.” Its purpose was to provide consumer oriented 3D hardware acceleration. He even stated that Carmack himself made the request, saying, “Get your fat APIs out of my way and let me at the iron.” St. John also made it clear that D3D had drivers for every major hardware accelerator, which OGL did not, and that they would evolve D3D faster than OGL. Finally, he revealed that there would be new, primitive APIs like DrawTriangle to make it easier for people to do “quick ports or evaluations to get up and running without the fuss,” but with some sacrifice in performance and versatility.

There’s much more to St. John’s lengthy response, including a comparison of D3D and OGL as being like forks and spoons—designed for different purposes. “Forks and Spoons are both silverware but it hardly makes sense to say that you don’t need forks because they’re lousy for eating soup, or that spoons suck because you can’t eat spaghetti with them. Saying you have to always eat with a spoon, or that you’re only going to eat soup because you can’t figure out how to use a fork is a fair point, but kind of pitiful and should be fixed.”*

In his email, he notes that both D3D and OGL are supported by Microsoft. D3D as a real-time consumer multimedia API and OGL as an “industrial strength” 3D API for use in CAD, modeling and scientific visualization. Noting that “it’s going to get very weird out there for 3D hardware,” he wrote that there was a need for standard driver architecture that is “flexible enough to accommodate innovation, yet rigid enough to actually be a standard that gets used.” Not an easy problem to solve, he said, following up with a long list of questions, scenarios and requirements. He closed his post saying, “I dunno, but if you think you’ve got all the answers then I’ve got a few questions I’m dying to put to you.”

See Carmack’s D3D/OGL Post and St. John’s Response to Carmack in the

Online Appendix.

By early February it became clear that developers were not going to shift en masse toward OpenGL and, as Keondjian reported in a February 5 email from a large UK developers conference, there was actually quite a bit of support for D3D, especially for retain mode, as opposed to immediate mode, which is what Carmack had tested. Keondjian also reported, “We had an open discussion about John Carmack’s comments and it was surprising to see that not a single developer there seemed to agree with him. Even more so, developers were saying they wanted D3D to become the standard and were keen to push it to be the standard.”

Did the 3D Graphics Wars Affect Xbox?

“When DirectDraw was subsumed into Direct3D, it really started to flesh out what DirectX was: a base level high performance API that worked within Windows. This was always the goal/vision of the project as expressed to me by Alex, Eric and Craig, and what I bought into as I knew how bad the rest of Windows was and that it needed a solid path for fixing it. So in a sense, yes, I can agree this created a baseline platform (DirectX) that a console could be made for. And even in those early days we were pretty clear that was something we were enabling by creating it. We just did not think Microsoft would be the ones who went off and built it in the end as ‘Microsoft would never make a console, they stay out of hardware’ was the common understanding of the company. This is what I believe the Xbox creation was then up against, but that was just after my time there.

“I also believe it was the changes that got pushed out by the rapid development of DirectX that then forced GL to fully mature and become the more workable solution it is today. That was not the case in the early days; it was not a complete enough API to build a whole console with.

“There is a counter argument, that SONY for example with PS2 put together a bunch of libraries with a version of GL for its launch. But this was a very untogether platform, and most developers ended up pretty much re-engineering most or everything from scratch while MS was enabling full easy ports over from DirectX on Windows to the Xbox.”

—Servan Keondjian, principal architect of Direct3D

Gates on DreamWorks

A couple of days after Keondjian sent his good news email from the UK, Bill Gates fired off a message about some technology he’d seen while visiting DreamWorks, especially the work around physical modeling, acoustics, and physics. His email asked why they seemed so far ahead of Microsoft’s games group.

Gates’ email signalled profound consequences for Microsoft because of the person who had most impressed him—Seamus Blackley. More to come…

Gates & St. John

In his email about his visit to DreamWorks, Gate’s expressed enthusiasm for what Microsoft could learn from the work he had seen. He recommended that they get their games up to that level of sophistication, and also that they should work on their own technology to incorporate some of the innovative methods that DreamWorks had used. He wrote, “They admitted that others will clone their work so I don’t think they would mind the system taking over some of it.” Gates was also impressed that the DreamWorks team had incorporated some techniques they had learned from their preview of Talisman.

Within two hours, St. John had sent a reply to Gates’ email in which he clarified some of the issues that Gates had brought up. At one point in his email Gates had written, “It seems like these games guys are so far ahead of what we are doing right now that our work is not very leveraged.” This comment set St. John off. In his usual colorful way, he refocused the argument toward the need for better, more “robust” multimedia drivers for new and existing hardware and focus on enabling real-time applications like video, games, video conferencing, 3D animation, and interactive web browsing. All of which Gates took well, asking for more of what St. John was proposing.

Of course, St. John—never at a loss for ideas and always prepared—jumped into the opening Gates had left, offering several specific suggestions that would help improve performance, partly by fixing issues in the operating system that sucked up time and memory, such as a CD cache that he claimed could slow input/output by up to 30%. He wrote, “There aren’t 10 different processes seeking the drive randomly, so the cache both slows down CD access and eats very valuable RAM thus increasing the amount of disk paging the OS carries out while the multimedia-title/video-player is trying to maintain a steady frame rate.”

St. John also suggested that they allow real-time applications (like games) to lock and hold memory and force the OS to stop, or “page out,” any unnecessary components before a multimedia application starts. And finally, he suggested that they examine Windows 95 for other areas that tend to suck up time or memory, saying, “Some of this stuff could probably be categorized as just a little bug fixing or architecture tweaking.” He makes the point that a lot of the functionality of Windows that is useful for business and productivity applications creates impediments to the best-case scenario for multimedia. He uses an example of web pages vs. real-time games: “One of the reasons that our browser can take over a second to draw a single web page with a little text on it and some tiny bitmaps is that is has to load/call around 21 dll’s and go through COM, ActiveX gyrations to get its drawing done. Maybe fine for slow web browsing, but completely ridiculous for applications like Quake.”

Gates had also responded to St. John’s focus on drivers versus “wizzy” technology, and St. John pointed out that Microsoft’s goal was to provide reliability and broad coverages for applications, whereas the hardware companies were much more interested in selling their latest and greatest chip technology… that they were in competition with other chip makers, and so they didn’t much care about supporting previous chips. From Microsoft’s point of view, this created what he called “a huge driver headache” trying to support all the competing chips and their multiple versions—each with its various tweaks and changes.

Another idea that Gates floated was a certification program for drivers, but St. John countered with a proposal of his own—something he had previously suggested called “Funstones”*. The idea behind Funstones was to create a benchmark suite for multimedia and promote it heavily to the media and marketplace, and also make it available to any consumer. “We’d just tell the press that if an OEM’s machine doesn’t pass a Funstone test, it’s not a working multimedia computer. Instead of running a big certification bureaucracy, we’d just publish the benchmark.”

St. John also wrote about video streaming and synchronization and problems with Windows technology, ending with a note about Java and its similar problems. It was a long, involved email, at the conclusion of which he wrote:

“-Wow I’m impressed that you read this far. <g>

(See Online Appendix for the complete email thread.

In retrospect, St. John claims that whenever he wrote a “treatise” to Gates, “it would become gospel to everybody on the thread and everybody he forwarded it to. Windows update, Windows driver WHQL certification all evolved from those dialogs.” And St. John worked hard to get Gates’ backing and support for better driver quality. “I believed that if Microsoft got religious about the stability of its IHV drivers, Microsoft would rule the consumer market. People always wanted to invent new useless features instead of focusing on very basic stability, speed and robustness, and so I would hammer the point with Gates knowing that a lot of important ears were listening.”

Internal OpenGL Squabbles

Life at Microsoft in early 1997 might have been business as usual for many people, but in the aftermath of John Carmack’s pro-OpenGL posting, the internal disagreements between the supporters of OpenGL and those who were championing Direct3D were heating up. Long email exchanges debated both technical issues and areas of influence, with Alex St. John once again at the center of the arguments. Only days after Bill Gates’ DreamWorks email, St. John was embroiled in a contentious argument with Steve Wright from the OGL team in the NT group. The thread subject line originally read, “Response to Carmack”, and later became “Alex St. John on D3D, OGL, and John Carmack”.

What follows is a glimpse into some actual email exchanges that occurred during the time in which people were arguing about OpenGL and Direct3D. There is little doubt that contentious emails occurred often at Microsoft in those days, but it’s rare to get a ringside seat—so to speak—to an actual exchange.

The argument seems to have begun when Phil Taylor, an evangelist for Direct3D, posted St. John’s original response to Carmack’s message on a public OpenGL forum. To be blunt, this royally pissed off people on the OpenGL team at Microsoft, notably Steve Wright, who wrote, “These comments include numerous technical errors that I believe can only damage Microsoft’s reputation in the 3D technology arena. I don’t want to see any further posts on this thread until or unless we have a coordinated and reviewed response to make.”

In another email less than an hour later, Wright continued, “…posting Alex’s comments without any review to the usegroups was a potentially disastrous piece of bone-headedness.” In fact, one of Wright’s OGL team, Nicholas Wilt was on the cc list on the original message St. John sent out to seek feedback—before Taylor posted it. Wilt did respond saying, “Looks pretty good,” adding some information about Carmack’s custom software rasterizer to correct one misconception. St. John had then replied to Wilt and Taylor writing, “Mods made, thanks for the feedback Nick. Ship it Phil.”

But Wright had some valid concerns. He and one of his key people, Mark Kenworthy, had not been on the original cc list, for which Taylor later apologized. Wright viewed his team’s work to include the management of the OpenGL message as well as relationships with hardware and software companies. In his opinion, posting St. John’s response to Carmack was detrimental to their efforts. “The point of this message is to reiterate that we do not continue muddying the waters with more postings like this. This was incredibly inappropriate.”

To which St. John replied, “Actually Steve, you’re dead wrong, and making these message calls is our job. The only display of ignorance in this regard is yours, and the only damage to our reputation in the industry is the result of you guys bickering foolishly with the D3D guys instead of pulling together. It is our job to communicate Microsoft’s strategic messages to the developer community. If you are communicating something contradictory on the usegroups it is you who is ‘muddying the waters’.” St. John also mentioned that Otto Berkes had visited id sometime before Carmack’s post, which he implied might have “stirred the pot” and helped inspire Carmack’s posting, an assertion which Wright subsequently denied. St. John ended saying, “DirectX is Microsoft’s strategic message to the game development community, it has been for 2 years, nobody involved in our marketing and evangelism efforts has ever been confused about that. Perhaps you should make some time to meet with us so we can sort out our roles and messages a little more clearly.”

Wright’s response was to attack St. John again, claiming that he could not do his job of messaging without coordinating with his group, also claiming that the original reply to Carmack contained “numerous misstatements about both Direct3D and OpengGL that do nothing but demonstrate that you are out of touch with both the technology as well as our most strategic thinking.”

Wright ended his message by claiming to have been “beaten to a bloody pulp” while helping promote Microsoft’s 3D strategy, including “pulling together” with Direct3D. “I’d thank you for interposing yourself as a far more vulnerable and incoherent target, but we really need a time to ‘repair and nurture’ right now, not inflame and antagonize, and that’s what you’ve accomplished.”

St. John replied, of course, accusing Wright of doing the evangelists’ job where that wasn’t his proper role. “Asserting that you have any business doing this while I do not puts you on pretty shaky ground babe. Yup, maybe I inflame, antagonize, misstate etc… it’s still my job, and I’m paid to use my judgment about how it’s done. Apparently you have a lot of time on your hands from your ordinary responsibilities and feel the urge to dabble in marketing and evangelism a bit… perhaps you’d like an office over here?”

Wright turned down the invitation to join DRG, reiterating that his messaging had always been clear, that OpenGL was for professional 3D applications and Direct3D was for games and entertainment. He asserted that St. John’s message was mistaken in its details about the execute buffer / draw triangle issue, adding a personal dig, “…you, or Philip, posted this misinformation to an OpenGL-focused newsgroup where it can only succeed in drawing down a rain of fire, an experience which I understand you personally enjoy, but which is the last thing we need right now.”

Another contentious issue involved an apparent visit by OpenGL’s Otto Berkes to id, and whether this was appropriate. This also continued in the thread, with St. John claiming that his information had come from id’s Jay Wilbur. He then questioned why Berkes was scheduled to conduct a session at the next CGDC about OpenGL for games, pointing out that it was contradictory to the message Wright himself claimed to be promoting.

Wright claimed that Berkes’ presentation was originally declined, but that they believed it would be best for someone to represent Microsoft to the game crowd instead of letting SGI control the message, and further, that this decision was sanctioned by Jay Torborg and “management,” to which St. John replied, “Bad decision, doesn’t have anything to do with Jay’s team. Which part of ‘multimedia messaging to developers is our job’ has been ambiguous in this thread. Apparently we’re going to have to burn some exec time having that explained to you at this point.”

Wright and Taylor also had a battle of their own, full of accusations and heated rhetoric, the gist of it being about who controls the message and what the message is, ultimately devolving into attacks on and defenses of Direct3D. This goes on for pages of back and forth arguments and rebuttals, with St. John entering the discussion to further emphasize the fact that it was the DRG’s job to promote and evangelize technology, not the NT group. The issue of Berkes’ visit to id and OpenGL talk at GDC were seen as an attempt by the OpenGL team to encroach on the message that Bill Gates had already settled—that D3D was the API for games, the consumer level API for graphics.

One of the points of contention was that game developers weren’t using Direct3D for software rendering, which was true, but finally, after a couple of more exchanges, on February 21, after a star-studded multimedia retreat, St. John wrote “D3D has 5-6 Retain mode games now. But I still agree with you, its primary usage is as a low level API to access consumer 3D HW. Top technology games will never use our software renderers. Bill made his position on OGL pretty clear this week. Let’s get on with it.”

For the whole long and often technical exchange, see the Online Appendix.

*For the record, St. John later said to me, “Mustyou tell the forks and spoons analogy? That has to be the single dumbest analogy I ever made.” Sorry Alex. I think it’s funny.
*Funstones was ultimately implemented in the Vista operating system years later.