Mobile's not much better: OpenGL ES for Android (which is a far cry from real desktop OpenGL - to the point that I consider it a completely different graphics API that just happens to confusingly reuse the names of some functions.) Maybe Metal for iOS.
Real desktop OpenGL is one of the few graphics APIs I've never been forced to use - so why spend even a single dev-month porting to it? Even games with OpenGL render paths may work better using their Direct3D renderers on Linux via Wine!
Even counting Linux/OS X, at this point I'm not even convinced OpenGL is actually the more portable API...
Even your bread and butter - functions like glUniformMatrix3fv do things like just outright ignore the transpose parameter. This is extremely well documented: "Specifies whether to transpose the matrix as the values are loaded into the uniform variable. Must be GL_FALSE." ( https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml... )
I swear I've reused more code between D3D11 and PS4 codepaths than between OpenGL ES and OpenGL codepaths, and the d3d11 and ps4 APIs don't share a single common function name betwixt them!
I must assume going from OpenGL ES 2 to real OpenGL a bit easier - even if you're probably giving all the fast paths in the latter a wide berth in doing so. Or maybe OpenGL ES 3 is a bit closer to real OpenGL. But OpenGL ES 2 vs desktop OpenGL? They both render triangles, but beyond that, it's a crap-shot, and a lot of #ifdefs in my experience. Separate files, even. Not just a few.
EDIT: s/codepaths/apis/, finish summarizing my thoughts.
(replied to my own comment by accident first)
At the end of the day, the code paths, extension support and driver workarounds are so many that one could just be coding against multiple APIs anyway.
Also it is stuck in a C world API, with each binding being a third party library with different degrees of coverage.
As developers put it here[1]: "Don't make a game that depends on Direct3D. All the hard hard work is getting the thing to run with OpenGL".
1. https://www.gamingonlinux.com/articles/about-linux-games-bei...
Metal is Apple's lame attempt to tax cross platform graphics developers. That's exactly what is emphasized there.
Linux gaming market is growing. Not sure about other commercial software in this context, but I'd guess it can indirectly be affected too, since bigger gaming market makes Linux desktop usage grow in general.
I mean, I'm all for OpenGL. I use OpenGL. Hell, I develop OpenGL games on Linux and then port them to Windows afterwards (released ~10 made that way so far). But the choice to use it depends on what market you're going after.
https://en.wikipedia.org/wiki/List_of_games_with_Vulkan_supp...
https://en.wikipedia.org/wiki/List_of_games_with_DirectX_12_...
Of course the tax on development imposed by lock-in freaks translates into that slowness. I.e. as you said, need for engines to support many balkanized APIs means slower releases to the market.
OpenGL gets you desktop and mobile all in one fell swoop (well, with a lot of tinkering and hard work). If that's your market, sure, go ahead. If you're writing a higher-end game targeting consoles and PC, then you'll end up doing a lot of extra work porting your engine to consoles and in return have access to a much larger market. Those consoles don't really support OpenGL, at least not as a first-class citizen, but one of them does support Direct3D. Direct3D also has excellent developer support.
Given the good support, good tool integration, and the fact that Direct3D runs on, say, two of your three most important platforms, it's a good choice.
Switch supports it now as first class citizen, and Vulkan as well. Nintendo were first to straighten this up. MS and Sony are still in the dark ages.
To clarify, yes, I was talking about PS4 and Xbox One. Those two systems, plus Windows, are the primary market for most AAA games. Just do a search for "2017 video games" and you'll see a big chunk of games that only run on those three systems. OpenGL isn't a very compelling choice there.
I'm calling it what it is. Their refusal to support Vulkan shows they intend to remain in the dark ages, and continue forcing developers to operate with balkanized non portable APIs. It's like some browser maker would refuse to support HTML and would require you to use ActiveX, Flash or whatever.
Meanwhile, Microsoft is managing their profitable Windows business by supporting key app developers, including game studios, who are already happily using Direct3D. Are they going to axe it and piss off a valuable segment of developers? No.
The analogy with Flash is a pretty good one. Flash was used everywhere on the web for years and years. Then the iPhone sucked all the oxygen out of the room and Flash died.
Just like everyone switched from Flash to JavaScript so they could get their websites to run on the iPhone, maybe everyone will switch from Direct3D to Vulkan for the same reason. Flash took a long time to die. After Apple announced the iPhone would not support flash, it was five years later that YouTube stopped using it for video. And yes, there were a lot of good reasons to require Flash in the meantime, until the open web caught up.
Dark ages were long and historic too, which doesn't mean they didn't have a lot of problems :) So I find it a proper comparison. Those who insist on keeping things balkanized today (MS, Sony and Co), are slowing down the progress.
> maybe everyone will switch from Direct3D to Vulkan for the same reason.
I definitely hope so. Current messed up state shouldn't exist forever.
I kind of wish consoles would just go away, so we could focus on PCs.
Switch first class citizen is called NVN.
https://blogs.nvidia.com/blog/2016/10/20/nintendo-switch
Also, MonoGame, Unreal and Unity are official supported middleware.
OpenGL 3.3 is a pretty nice target. It's easy to port an OpenGL 3.3 game to a lot of systems, including mobile, since OpenGL ES 2.1 is pretty similar, and Windows XP, which cannot run DirectX 10. (This matters less as time goes on, but it's been an important point in certain markets in Asia.) So you can write the graphics code once, more or less, and run it everywhere, more or less.
The idea that somebody who chooses to do this is therefore not "competent" just boggles the mind. No point in deriding engineers who decide not to use the latest bells and whistles in the graphics pipeline. Maybe they just have other priorities.
(To clarify: the recommendation that everyone should just use OpenGL regardless of situation is, in fact, stupid. So I agree with that part. But it's equally stupid to say that everyone should use D3D12 / Metal regardless of circumstance.)
Intel HD 3000 (6 years old, much newer then Windows XP) only supports OpenGL 3.1 on Windows.
VmWare workstation only supports OpenGL 3.0 for Win7 guests.
Direct3D 11 works flawlessly on both of them.
I don't think you need to worry about that when gaming is concerned though. It's too old and below minimum requirements of huge amount of games already.
The hardware fully supports DX 10.1. DX 11 API works fine on that, with feature level 10.1.
> I don't think you need to worry about that when gaming is concerned though
That’s correct for AAA titles. Casual gamers however often play on PCs without a dedicated GPU.
Even in such case, they wouldn't commonly use Sandy Bridge generation GPU. And those who use it, aren't expecting recent games to support it (whether they are demanding or not). Increasing number of games already require OpenGL 4.x, even if they are not very demanding in practice. And now with Vulkan, older Intel GPUs simply won't cut it anymore.
Choose Direct3D 11, you’ll loose Linux gamers.
Are you sure in absolute numbers, there’re more people in the second group?
Before it happened, software developers need to choose whichever GPU API works best for their particular project.
Personally, I have not developed games for several years.
For the last 1.5 years, I’ve been working on a CAD/CAM software. Traditionally people use OpenGL for this area. I have picked D3D 11 instead. The renderer is reasonably sophisticated; there are many complex shaders in there. The software is now used by thousands customers worldwide, and yet there were very few rendering-related bugs so far.
I obviously mean DX11 on Linux for running Windows games, not DX11 on Sandy Bridge.
More like compatibility and stability fetishism. nVidia and AMD can't even agree on how to compile the same GLSL shader - I'm much more confident about my ability to ship working D3D9 or D3D11 than OpenGL without a QA team with a wide range of hardware and driver revisions. D3D? Uniform bytecode. Uniform debug layers. Nice. Being indie just makes it easier - simpler rendering pipelines, easier to port.
For Android dev, where I have no choice about using e.g. OpenGL ES 2, the compatability mess is so bad that even for solo dev, I've been eyeing AWS Device Farm and Xamarin Test Cloud. Maybe AAA studios can afford the QA time - but I can't even afford enough phones to test to my satisfaction. And in my heart of hearts, I blame OpenGL, even if it's really the fault of mobile GPU vendors. I have a much weaker urge for a PC device farm, where D3D mostly just works. It'd be a much stronger urge if you threatened me with the prospect of supporting desktop OpenGL.
Biggest company I've worked for had about 50 people, usually on a much smaller team. I don't think that's AAA. Wasting milliseconds left and right, we didn't need much per-platform tuning - still lower hanging fruit around. Still almost agree with euos. Aside from compat - getting OpenGL working on a console or in the WinRT sandbox is probably more work and worse results than just doing a straight up port. Worst of all worlds.
> The idea that somebody who chooses to do this is therefore not "competent" just boggles the mind. No point in deriding engineers who decide not to use the latest bells and whistles in the graphics pipeline. Maybe they just have other priorities.
Agreed - competent engineers and managers may decide that competent 3d support not worth their time. I welcome this restraint when it comes to Excel's pie charts and the good fight against scope creep. If you're targeting the holy trifecta of Windows, Linux, OS X, and little else - OpenGL might be right for your MVP and your launch window.
Yet I'd still be eyeing that OpenGL on Windows as possible technical debt. Hell, I basically look at OpenGL ES on Android as unsolvable technical debt. I'd have a hard time labeling it "competent 3d". And I'd be wondering if it was really better than D3D9 + Wine.
Metal might be a little flavor-of-the minute. I need to give it a shot sometime...
If you write an app based on Direct3D 9 or 11, it usually just works on any supported version of Windows.
I once wrote an app that uses OpenGL 4.0 (this one: https://github.com/Const-me/GL3Windows), and it only worked on half of my PCs. To make it work everywhere, I had to downgrade to OpenGL 3.0, and also implement S3 texture decompression on the CPU.