Saturday, January 16, 2010

OpenGL vs DirectX - Benchmark Comparison

I've done a few benchmarks to date and today I am going to add another interesting set of numbers to the list. Unigine is a cross-platform real-time 3D engine, I stumbled across awhile back on some message boards I am a part of. Since it is cross platform it offers the benchmark rendering in both OpenGL and DirectX APIs, as such I was curious as to which of the interfaces that are commonly used for 3D development offered better performance.

The Tests: Unigine offers two free benchmarks - Tropics and Sanctuary. I ran both demos using OpenGL, DirectX 9.1, and DirectX 10.0 under the 1680x1050 resolution.

The Hardware: While my hardware is not fastest in the world it is (as of posting this) relatively new and decently quick. Processor - Intel p9700 2.8ghz Dual Core, RAM - 4gigs of DDR3, Video Card: nVidia 260m with 1gig DDR3 dedicated memory (Running the latest stable nVidia driver 195.62).

The Software: Windows 7 Ultimate 64bit & Unigine Benchmarks

The Results:
Tropics -
  • OpenGL - 31.8 fps
  • DirectX 9.1 - 34.9 fps
  • DirectX 10.0 - 35.8 fps
Sanctuary -
  • OpenGL - 36.0 fps
  • DirectX 9.1 - 39.7 fps
  • DirectX 10.0 - 42.6 fps
Wrapping Up:
Clearly DirectX 10 appears to be the optimum choice performance wise. In the case of the tropics benchmark it scored about 12% higher and for Sanctuary it scored around 16% higher. Worth noting is that while running the benchmarks there really isn't truly much detail difference between the rendering in the three different selections (meaning most people would not be able to tell the difference between which of the three was is use). Also I'd like to mention for any who may not know that OpenGL as the name implies is free open source software and runs fully cross-platform (where is DirectX is locked to the MS Windows and XBox) - so if you want to develop for a wider range the slightly slower OpenGL may be the best choice of the three to use.

~Jeff Hoogland
Please note while these benchmark scores presented are accurate to the best of my abilities, they only represent my personal hardware and software configurations. Your results on your own system(s) may vary (and if they do, please share them!).

14 comments:

  1. Hi,

    thx for your tests. Looks interesting. Maybe you want to add OpenGL on Linux and Mac to the mix to see if they are faster than the Windows pendant.

    Anyway keep up the good work!
    matthias

    ReplyDelete
  2. For Linux check - http://jeffhoogland.blogspot.com/2009/12/windows-7-vs-ubuntu-910-3d-benchmarks.html

    Be sure to read the comments though as well - because there is some debate as to whether my system might have a bottle neck with these benchmarks under Linux.

    ReplyDelete
  3. This performance tests also suffers/benefits from drivers implementation.

    ReplyDelete
  4. @Anoymous - Latest nVidia drivers where used... You should always be using the latest stable drivers with any modern hardware.

    ReplyDelete
  5. not enough difference to support proprietary, closed, systems.

    ReplyDelete
  6. "OpenGL as the name implies is free open source software and runs fully cross-platform"

    That's actually not quite accurate. It's an open specification for a programming API. Mesa, is an open source OpenGL compatible API. No code is shared between this implementation and nVidia's OpenGL implementation for instance.

    Also, the benchmark may not be completely fair. Phoronix loves the Unigine engine and have wrote frequently about it. According to them, the DirectX version got a lot of care and optimizations for DirectX 10, while OpenGL was sidelined until the DX10 support was complete. That's enough for me to question how optimal both implementations. That said, it's probably about the best program to use as a benchmark in this category of comparison. So I can't really complain too much since I don't know of a better alternative.

    ReplyDelete
  7. I'm impressed with the results plp... rly, the dif betwen the market leader's API and OpenGL are almost unsignificant (considering the benefits the API Direct3D got from Microsof market leading)

    ReplyDelete
  8. I second Harley's points.

    ReplyDelete
  9. I don't believe this benchmark is entirely accurate. It relies on the engine's implementation of the renderers. This would only really be an accurate benchmark if it was done using the optimum code for each of the APIs (using VBOs in OpenGL or mesh objects in DirectX, for instance).

    ReplyDelete
  10. please add some HOW TO: for MMO game Shaiya

    ReplyDelete
  11. I would try to launch a system monitor in the background, just to have a proof if the processor does - or does not - go 100% on one/all core(s)...

    ReplyDelete
  12. whoops, the precedent comment was for this post: http://jeffhoogland.blogspot.com/2009/12/windows-7-vs-ubuntu-910-3d-benchmarks.html (sorry)

    ReplyDelete
  13. Just thought I would mention that the PS3 uses OpenGL. Also I think the drivers have a significant roll here, and I have seen some more recent benchmarks where OpenGL outperforms DirectX.

    ReplyDelete