Why You Should Use OpenGL and not Direct3D



OpenGL

Direct3D


The fight between OpenGL and Direct3D (not DirectX!) is still a hot topic and the guys at Wolfire Games Blog have published a must-read article for all OpenGL developers (and end-users too) about the importance of OpenGL in game development and 3D industry.

I don’t know why but I agree with all their arguments especially these two ones:

  • OpenGL is faster than Direct3D. At least from my tests between OpenGL 2 and Direct3D 9 under WinXP some weeks ago for the furry donut… GL 3 against D3D 10/11 will be done soon. But this statement should be taken with care. The core code was simple (vertex / pixel shader + vertex buffer) and in this case OpenGL render path was faster and produced more heat than Direct3D 9 render path. But with more complex codes, that might be another story. Anyway, I think OpenGL is as fast as Direct3D or faster…
  • New 3D features are available first in OpenGL. Each vendor can add a new feature via an OpenGL extension (and currently AMD and NVIDIA have many non-exposed OpenGL extensions…) at any time. No need to wait for a major OS update to expose the feature.

With better GL drivers and more free tools (like D3D Pix or PerfHUD), OpenGL would be almost perfect…

Here are some interesting parts of this article:

Network effect:

It’s a positive feedback loop because whenever one API becomes more popular, it keeps becoming more and more popular due to network effects. The most important network effects are as follows: the more popular API gets better support from graphics card vendors, and graphics programmers are more likely to already know how to use it.

Microsoft’s FUD campaign:

API use was shifted in favor of DirectX by Microsoft’s two-pronged DirectX campaign around the launch of XBox 360 and Windows Vista, including the spread of FUD (fear, uncertainty and doubt) about the future of OpenGL, and wild exaggeration of the merits of DirectX.

Direct3D makes graphics brighter:

DX9 vs DX10

The launch strategies for Windows Vista and Windows 7 were both accompanied with an immense marketing push by Microsoft for DirectX, in which they showed ‘before’ and ‘after’ screenshots of the different DirectX versions. Many gamers now think that switching from DirectX 9 to DirectX 10 magically transforms graphics from stupidly dark to normal

The killer part:

…in reality, OpenGL is more powerful than DirectX, supports more platforms, and is essential for the future of games.

It’s common knowledge that OpenGL has faster draw calls than DirectX

OpenGL faster than Direct3D
source

New features are available first in OpenGL

OpenGL gives you direct access to all new graphics features on all platforms, while DirectX only provides occasional snapshots of them on their newest versions of Windows.

Targeting the maximum number of graphics cards requires OpenGL

Microsoft has worked hard on DirectX 10 and 11, and they’re now about as fast as OpenGL, and support almost as many features. However, there’s one big problem: they don’t work on Windows XP! Half of PC gamers still use XP, so using DirectX 10 or 11 is not really a viable option.


If you use DirectX, you have to choose between using the weak, bloated DirectX 9 or sacrificing most of your user-base to use DirectX 10 or 11.


On the other hand, if you use OpenGL, you get faster and more powerful graphics features than DirectX 11, and you get them on all versions of Windows, Mac and Linux, as well as the PS3, Wii, PSP, DS, and iPhone. You also get these features in the rapidly-developing WebGL standard, which may become the foundation for the next generation of browser games.

You can read the full version of this excellent article HERE.



18 thoughts on “Why You Should Use OpenGL and not Direct3D”

  1. JFFulcrum

    >Each vendor can add a new feature via an >OpenGL extension (and currently AMD and NVIDIA >have many non-exposed OpenGL extensions…) at >any time. No need to wait for a major OS >update to expose the feature.

    Industry already was tired of by hardware-vendor ‘capabilities’ in times of DirectX 7/8. No one will plan for two to three years typical game project using ‘private’ vendor extensions, which can one time simple disappear from driver, like it happens with N-patch tesselation in ATI drivers (and we seen no one good example of using this ‘cutting-edge’ technology). Microsoft done a right thing with cutting-off caps bits from DirectX, and seems like Khronos moving in same direction with required ‘core features’ in OpenGL 3.x development. Industry needs stability and predictability.

    >Targeting the maximum number of graphics cards requires OpenGL
    Good luck for us with Intel onboard video monopoly, which (oh thank you, God!) just receive OpenGL 2.1 support, after year with OpenGL 3.x with NVIDIA and ATI. And Mesa3D GL 3.x feature set implementation was cursed by patent injunctions in core OpenGL 3 specifications — excellent example of ‘FUD’ about freedom with OpenGL .

  2. Korvin77

    about “faster draw calls” from NVidia (not ATI 😉 ): of course NVidia is (or now was) leader in OpenGL :I remember Neverwinter Nights 1 where they used exclusive NVidia (oh yeah we know good that NVidia always loved OpenGL) extensions like NV_register_combiners so I couldn’t see nice water because I had ATI card (of course developer gave us the patch that fixed it later but many other developers just don’t do stuff like this).

  3. Roel

    Regarding the draw call speed: those slides are from 2006. Aren’t they talking about the time required for switching from user code to kernel code, that used to be slow before Vista?

  4. fdsgkl

    I use OpenGL for PC always: why are you going to use a non-portable API like DirectX when you can code-one and run on multiple platforms? It’s obvious.

    However, for the XBox you’ll need DirectX or … DirectX

  5. David Jurado

    I don’t think OGL is better than D3D for those reasons.

    * OpenGL is faster than Direct3D???
    OpenGL introduced oerformance optimization extensions years and years after Direc3D did. For example Vertex and Pixel Buffers, or Frame Buffer objects. Current OGL version 3.2 is finally as capable as the older D3D 10. But D3D appeared 3 years ago.

    * New 3D features are available first in OpenGL???

    What? The only vendor that put its PROPRIETARY extensions to OGL almost up to date is nVidia. The others (including ATI) are far more lazy. The common vendor option is to wait for the ARB/Khronos to publish a standard about the extension, tipically based on other previous proprietary extension. But even in those circunstances all vendors except nVidia are very lazy to update drivers for older (and sometimes newer) GPUs.

    OpenGL hadn’t the flexibility Direct3D had. In other words Direct3D allowed more low level access to the hardware. With D3D, you could do render to texture or to frame buffer, but OGL must wait till version 2.1 or 3.0. OpenGL had to wait A LOT for using vertex/fragment programs, or for using high level shading languages, being nVidia again the first that allow them in their drivers with its proprietary extensions.

  6. Korvin77

    by the way. the new Wolfenstein 2009 by Raven Software uses an improved version of id Software’s id Tech 4. BUT OpenGL renderer used only for multiplayer. Singleplayer uses DX9. you can just install and compare OpenGL with DX9 in one game. of course OpenGL still doesn’t know about HDR and Depth of Field – probably that’s why they used weak and bloated DX9 I think…

  7. JeGX Post Author

    @Korvin77: what do you mean by “OpenGL still doesn’t know about HDR and Depth of Field” ?

  8. Korvin77

    I meant that none of serious OpenGL games based on id Tech 4 sure thing, use it, including multiplayer version of Wolfenstein 😛

  9. Mars_999

    I use OpenGL and love it. I do wish drivers would get better, as for Nvidia’s GL drivers they are top notch. ATI’s have gotten a lot better lately, but Intel’s are crap! I can verify that they have gotten GL 2.1 support lately.

    If I had a company making games and I wanted to hit all markets its a no brainer use GL, hit Win32, Mac, Linux, iPhone, consoles… I don’t like the fact that DX ties me just to windows only. I will give DX the thumbs up for having a lot of helper functions and libs that are very useful, but with 3rd party libs and GL you can get the same results.

  10. Igor

    The current quality of OpenGL drivers for Windows from the two major HW-vendors (ATi & NVidia) is just terrible.
    OpenGL is often an obstacle in the development rather than aid.
    The developer support is also leaves much to be desired.

  11. Korvin77

    lol why do you care about platforms like Linux or Mac so much? This platforms is not for gamers at all. Who wants play games – buy Win. How many can you make money from Linux or Mac gamers? in comparsion with PC&Xbox&PS

  12. Julien

    8% of desktop machines use Mac OS, about 1% of desktop machines use Linux, there is enough to earn some money and not only focus Windows. Moreover, OpenGL and OpenGL-ES can be used even on embedded systems like mobile phones.

  13. JFFulcrum

    Well-known mantras about multiplatform OpenGL, they are stuck in my teeth since 1999 i first hear them. Let see:

    Mac – rare as Tasmanian devils Mac-gamers, who payed twice for graphic card upgrade from Apple Store, use BootCamp and Windows. Even most MacOS game releases actually are just blind Windows ports, using DirectX with help of Cider and other Wine derivatives.

    Playstation 3 – you have limited by old fixed-function OpenGL ES 1.0 support, intended for use for system applets like Photo viewer and, maybe, simple casual games. You may try with NVIDIA Cg extensions, but you will stuck with another proprietary standard. Games use LibGCM. Even if you boot Linux on first versions of PS3, you will have no access for dedicated 3D graphics hardware.

    XBox – UWBFTP

    Wii – once again welcome for proprietary

    Windows Mobile – UWBFTP

    Symbian – well, what i said about OpenGL ES 1.0?

    iPhone – oh, finally OpenGL ES 2.0, but only on latest 3GS, older versions support only ES 1.0 and there is no backward compatibility: write code twice, guys.

    Linux. Well, you have a choice: support binary drivers from NVIDIA or ATI with latest OpenGL features to offer DirectX-level picture quality, or support lagging-miles-behind open-source drivers with, at best, ‘mostly working’ OpenGL 2.x support. Write code twice?

  14. DXL

    OpenGL is far better than Direct3D.
    Don’t believe me just dig the OpenGL programming, you will know that.

    Raw fact:

    NFS Underground using Direct3D 9.
    Same NFS Underground using OpenGL 1.4 by WINE(WINE is a direct3d layer on the top of opengl).

    NFS Underground 2 using Direct3D 9.
    Same NFS Underground 2 using OpenGL 1.4 by WINE(WINE is a direct3d layer on the top of opengl).

    So, you can do same thing by using far earlier OpenGL version!

    So, who is better, obiously, OpenGL

  15. JFFulcrum

    >you can do same thing by using far earlier OpenGL version!

    Somewhere in 2003 i ran some OpenGL 1.5 (int. 2002) applications on Direct3D 5.0 (int. 1998) hardware (that has no OpenGL support from vendor) with help of GLDirect software (OpenGL->Direct3D wrapper), so wrapping/emulator arguments just miss the point.

Comments are closed.