Is OpenGL enough or should I also support DirectX?

Started by
29 comments, last by AlanWu 8 years, 9 months ago
Advertisement
Slight thread clean up; lets keep it on topic, not call other people names or drag other unrelated topics in to this thanks.

I might start handing out warnings to people otherwise...

Will be means the future. Microsoft constantly obsoletes its own APIs as well, so really it is a poor decision for anyone who is not part of a big company to bother with using it.

You will be able to use vulkan on windows systems, so really there will be no point to DirectX any more.


Everyone obsoletes APIs, however D3D sticks around - DX9 was here for a long time, DX11 was announced 7 years ago, DX12 I would expect to have a pretty long life time as well as the primary windows graphics interface.

Yes, you will be able to use Vulkan, just no one knows when.
D3D12 will be here in just over a month.
Vulkan is still MIA when it comes to anything public and was last reported as 'in flux'.

So, you can start developing with an API which works (D3D11), an API which has docs, beta drivers, good performance reports (D3D12) or you can wait around for Vulkan which is being developed by the same group who mismanaged OpenGL for over a decade.

Personally I'd go with D3D, because say what you like about MS they get shit done and with the last 3 graphics APIs they have done well (D3D10 as a good, if not doomed, API) and by all accounts D3D12 is another sound result.
Khronos and the ARB (who went on to form the Khronos group for graphics), on the other hand, have historically not managed very well and are showing worrying signs of lapsing back in to the old habits which plagued OpenGL.


Khronos and the ARB (who went on to form the Khronos group for graphics), on the other hand, have historically not managed very well and are showing worrying signs of lapsing back in to the old habits which plagued OpenGL.
As in shutting up for 8 months and then delivering OpenGL 1.1 The Reckoning 2: Stateful API Awakens Again ? :D

"I AM ZE EMPRAH OPENGL 3.3 THE CORE, I DEMAND FROM THEE ZE SHADERZ AND MATRIXEZ"

My journals: dustArtemis ECS framework and Making a Terrain Generator

Back to the OP - if I was starting a project right now that had to run everywhere, I would make a renderer with two bavk-ends initially: D3D11 using feature level 9_x, and a port of that back-end to the actual D3D9c API (avoiding all the fixed function parts, and sticking to shader model 2).

Why? Because D3D9 runs on Windows from XP onwards, and Linux via Wine. D3D9 can also be zero-effort ported to GL2 by using toGL, which gets you mac and native linux (that's how Valve ported their Source games). D3D11_FL_9 will run really efficiently and be really stable on modern versions of Windows, plus makes for a great developer environment with good tool support. And lastly, shader model 2 shader code will run on every GPU you care about.
The only missing piece ie you'll later have to write your own gl|ES port.

Microsoft constantly obsoletes its own APIs as well, so really it is a poor decision for anyone who is not part of a big company to bother with using it.

You will be able to use vulkan on windows systems, so really there will be no point to DirectX any more

MS releases new D3D versions on roughly the same schedule as new GL versions appear. D3D9~=GL2, D3D10~=GL3, D3D11~=GL4, D3D12~=Vulkan.
All those old APIs still work fine, despite being obsolete/deprecated.

You can already use GL on Windows systems (Vulkan is basically just GL5), so there should already be no point to DirectX any more... Right?

I can tell you my experience:

I thought that supporting OpenGL would be enough. It wasn't. But it depends on what you want to aim. Our goal was to keep compatibility with DX10 hardware while still taking advantage of DX11/12 hardware features.

There are several reasons GL only approach didn't work for us:

  1. Both NV & AMD stopped shipping drivers for anything below GeForce 400 / Radeon HD 5000. Their OpenGL driver versions are outdated (specially AMD's which cut off driver support 6 months sooner than NV); and if they've got a bug or don't support a specific extension you need (even extensions that would normally work on DX10 hardware); don't hope they will get fixed or added in a later release. In contrast, D3D drivers have been historically been more stable, more thoroughly tested and feature complete. As a result, supporting these cards via D3D is easy.
  2. Intel GL drivers sucked for a very long time, and their definition of "old hardware" is anything they shipped older than 1 year. Technically that's the same problem as NV & AMD just aggravated. But GL drivers have only become decent for Intel HD 4400 and newer (in a driver release that was literally... just a few months ago), some of these cards are DX11 level hardware (not just DX10) and Intel's market share is so large and their deprecation is so strict and narrow that it deserves its own point.
  3. There are so many variables that come into play, that sometimes D3D will get you higher performance, and sometimes OpenGL will get you higher performance. It depends on the driver, GPU involved, API calls you've made, and shader syntax you've used. Supporting both lets your users decide which one runs better for them.

Of course this is all about your particular case. If you don't have the resources (time) or don't feel you're experienced enough to support both APIs at the same time; or you only care about bleeding edge hardware and software; then you can focus your efforts into just one API.

Thank you for replying. So apparently drivers is an issue.

Back to the OP - if I was starting a project right now that had to run everywhere, I would make a renderer with two bavk-ends initially: D3D11 using feature level 9_x, and a port of that back-end to the actual D3D9c API (avoiding all the fixed function parts, and sticking to shader model 2).

Why? Because D3D9 runs on Windows from XP onwards, and Linux via Wine. D3D9 can also be zero-effort ported to GL2 by using toGL, which gets you mac and native linux (that's how Valve ported their Source games). D3D11_FL_9 will run really efficiently and be really stable on modern versions of Windows, plus makes for a great developer environment with good tool support. And lastly, shader model 2 shader code will run on every GPU you care about.
The only missing piece ie you'll later have to write your own gl|ES port.

Microsoft constantly obsoletes its own APIs as well, so really it is a poor decision for anyone who is not part of a big company to bother with using it.

You will be able to use vulkan on windows systems, so really there will be no point to DirectX any more

MS releases new D3D versions on roughly the same schedule as new GL versions appear. D3D9~=GL2, D3D10~=GL3, D3D11~=GL4, D3D12~=Vulkan.
All those old APIs still work fine, despite being obsolete/deprecated.

You can already use GL on Windows systems (Vulkan is basically just GL5), so there should already be no point to DirectX any more... Right?

Good idea. However, if I use toGL to change my D3D9 codes into OpenGL, will there be a big drop in performance?

This topic is closed to new replies.

Advertisement