Valve confirms OpenGL is faster than DirectX even on Windows
Valve software’s 3D Source engine that powers half-Life2, Left 4 Dead, Team fortress 2, Portal and Dota 2 runs faster on Linux based Ubuntu 12.04 and OpenGL than Windows 7 and DirectX/Direct3D.
In order to test the performance of the game Valve Linux team assembled a high configuration system:
Processor Intel core i7 3930K, Graphic card NVIDIA GeForce GTX 680, 32GB RAM.
Windows 7 Service Pack 1 64-bit, Left 4 Dead 2, Ubuntu 12.04 32-bit
Running Left 4 Dead 2 on windows 7 with Direct3D driver team got 270.6 FPS as a baseline. Linux version of Left 4 Dead 2 gave them 315 FPS.
Then the team used the new OpenGL optimization. The OpenGL version of Left 4 Dead 2 on Windows is now faster than the DirectX version. With the same Hardware configuration, Left 4 Dead 2 running on windows 7, with OpenGL driver, gave 303.4 FPS.
OpenGL versus Direct3D on Windows 7
This experience lead to the question: why does an OpenGL version of our game run faster than Direct3D on Windows 7? It appears that it’s not related to multitasking overhead.
The Team has been doing some fairly close analysis and it comes down to a few additional microseconds overhead per batch in Direct3D which does not affect OpenGL on Windows. Now that the team knows the hardware is capable of more performance, team like to figure out how to mitigate this effect under Direct3D.
Working with hardware vendors
Valve has been working with NVIDIA, AMD, and Intel to improve graphic driver performance on Linux. They have all been great to work with and have been very committed to having engineer’s on-site working with Valve engineers, carefully analyzing the data.
Valve have had very rapid turnaround on any bugs that the team finds and it has been invaluable to have people who understand the game, the renderer, the driver, and the hardware working alongside valve when attacking these performance issues.
This is a great example of the benefits that are the result of close coordination between software and hardware developers and should provide value to the Linux community at large.
It shows that cross platform OpenGL is now faster than Microsoft proprietary Direct X. OpenGL has solid implementation in Mac, Linux, PlayStation 3, Nintendo Wii, and just about every modern smartphone (OpenGL ES).
Direct X is popular because of its cleaner API, better documentation and easier to learn. Microsoft has relentlessly marketed DirectX, too. That is the reason more developers are using Direct X to develop games, drivers, tools, etc.
Now OpenGL 4.0 has all of shaders and tessellators and widgets that DX has. All Nvidia and AMD graphics cards support the latest version of OpenGL along with DirectX.
This clearly shows that, if the Windows gaming crown continues to slip, OpenGL might soon become the default API.
We have to wait and see what valve will be speaking in coming SIGGRAPH about OpenGL and DirectX.