12
$\begingroup$

So I was reading this, I sort of got the reason why there are a lot more games on Microsoft windows than on any other OS. The main issue presented was that Direct3D is preferred over OpenGL.

What I don't understand is why would any developer sacrifice compatibility? That is simply a financial loss to the company. I understand that OpenGL is kind of a mess, but that should hardly be a issue for experts. Even if it is, I think that people would go a extra mile than to incur a financial loss.

Also if I'm not wrong then many cross platform applications use both Direct3D and OpenGL. I think they switch between the APIs.

This is weird as they can just use OpenGL, why even care about Direct3D?

So the question is, are there any technical issues with OpenGL or is there any support that Direct3D provides that OpenGL lacks?


I am aware that this question might be closed as being off-topic or too broad, I tried my best to narrow it down.

$\endgroup$
9
  • $\begingroup$ Are you looking for something different from this? $\endgroup$ Commented Jun 28, 2016 at 19:23
  • 2
    $\begingroup$ BTW, I answered a similar question on GameDev.SE a couple years ago. $\endgroup$ Commented Jun 28, 2016 at 21:10
  • 1
    $\begingroup$ here's a good lesson of history that sorta answer your question: programmers.stackexchange.com/questions/60544/… $\endgroup$
    – darius
    Commented Jun 29, 2016 at 1:01
  • 1
    $\begingroup$ @NathanReed "So, it's possible we will see a swing back toward multi-platform developers using OpenGL on Windows." And now, 3 years later, would you say this has happened? $\endgroup$
    – Rotem
    Commented Jun 29, 2016 at 4:08
  • 2
    $\begingroup$ @Rotem I don't think so, no. OGL (and now Vulkan) today is better at maintaining feature parity with D3D than it was, but AFAICT, the GPU vendors still prioritize D3D drivers for bugfixes and perf improvements, and most games/engines still use D3D by default on Windows. A notable exception is the idTech engines, which all use OGL on Windows. $\endgroup$ Commented Jun 29, 2016 at 18:50

2 Answers 2

8
$\begingroup$

About the fact that there are more games for Windows, some reasons are

  1. Windows has the majority of the market and in the past to develop cross platform games was more complicated than it is today.
  2. DirectX comes with way better tools for developing (e.g. debugging)
  3. Big innovations are generally first created/implemented in DirectX, and then ported to/implemented in OpenGL.
  4. As for Windows vs Linux, you have to consider that when there is an actual standard due to marketing and historical reasons (for that see Why do game developers prefer Windows? | Software Engineering, as I said in the comments), it has its inertia.

The inertia thing is very important. If your team develop for DirectX, targeting 90% of the market (well... if you play games on pc you probaly have windows, so... 99% of the market?), why would you want to invest in OpenGL? If you already develop in OpenGL, again targeting 99% of the market, you will stick to it as long as you can. For exampe Id Tech by Id Software is an excellent game engine (powering the DOOM series) that uses OpenGL.

About the topic of your discussion, a comment.

As of today, there are many many APIs, and a common practice is to use a Game Engine that abstracts over them. For example, consider that

  • On most mobile platform you have to use OpenGl ES.
  • On PC you can use both DirectX and OpenGL
  • I think on XBOX you have to use DirectX.
  • I think that on PS you use their own API.
  • With old hardware you use DirectX9 or OpenGL 3, or OpenGL ES 2.
  • With more recent hardware you can (and want to) use DirectX 11, OpenGL 4, OpenGL ES 3.

Recently, with the advent of the new low overhead APIs - whch is a major turning point for graphical programming - there are DirectX 12 for Windows and XBOX, Metal for iOS and Vulkan (the new OpenGL) for Windows and Linux (including Android and Tizen).

There still are games that only target Windows and XBOX, but IMHO today that can only be marketing choice.

$\endgroup$
4
  • $\begingroup$ So there is no performance reasons to prefer Direct3D ? $\endgroup$
    – user3437
    Commented Jun 30, 2016 at 10:07
  • $\begingroup$ @ritwik sinha DirectX 11 has better support for multi threading rendering than OpenGL 4, but to my knowledge that has not resulted in any realt performance difference. On the other side, comparing Windows with DirectX 11 and Linux with OpenGL 4, the winner was Linux with OpenGL. Regarding DirectX 12 vs Vulkan, I think it is too early to know, but i don't know. $\endgroup$
    – darius
    Commented Jun 30, 2016 at 20:46
  • $\begingroup$ i never worked with Direct3D, so i don't understand what you mean by multi threading. As far as i know different threads are handled by programmers for different tasks. Does Direct3D does this under the hood ? Anyway nice answer. $\endgroup$
    – user3437
    Commented Jun 30, 2016 at 21:09
  • 1
    $\begingroup$ @ritwik sinha an application of multi threading to real time graphics is that you may use diffrent threads to allocate resoruces in the background (texture streaming, vertex buffers), wile a main thread does the draw calls. This is also possible in OpenGL, but very very tricky. In DirectX 11 you can also make draw calls, from many threads, which should improve performance, but that's not a common practice. I think that the last release of UnrealEngine4 does it. However, with DirectX 12 and Vulkan multi threading rendering is going to be a real deal. $\endgroup$
    – darius
    Commented Jun 30, 2016 at 23:59
1
$\begingroup$

A couple of possible reasons:

  • Historically, OpenGL driver quality has varied a lot, but I'm not sure that's the case any more.
  • Xbox supports D3D so porting a game between it and PC is easier.
  • Debugging tools for D3D have been better than for OpenGL. Luckily we now have RenderDoc
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.