Live data from Hacker News

Why you should use OpenGL and not DirectX

blog.wolfire.com

121–130 of 187 posts

Re: Why you should use OpenGL and not DirectX

#121

Earlier quoted context omitted.

Is PS3/PS4 development OGL or a proprietary API? Because if it is OGL then yes that makes said API far more useful for sheer amount of access to hardware.

The PS4 uses OpenGL (4.4?). The PS3 used a proprietary API based on OpenGL 1.0.

So yeah, OGL grows more useful as the PS4 grows its user base. Thanks for the info

Re: Why you should use OpenGL and not DirectX

#122
post #100

Earlier quoted context omitted.

Actually, RTS games are also a hard problem for engines because they require a lockstep shared-state for multiplayer. This means you need a very high level control of the language your game-logic is built in to make sure your floating-point calculations are identical across all devices and everything is perfectly deterministic. This is a problem for "complete-platform" cross-platform engines like Unity.

Lockstep simulation isn't required--though it was a popular solution.

What is the alternative and more popular solution used now?

Re: Why you should use OpenGL and not DirectX

#124

Earlier quoted context omitted.

Not really 'legacy' per se either... good luck running OpenGL on Microsoft's consoles or as a ModernUI application! DirectX being a broader and, in my opinion, better designed API certainly doesn't hurt it's adoption either.

Yeah, don't worry about those mobile devices. We've got plenty of directx support for those too. What are they again? Surface? Windows phone? I think I know one guy who has one.

Not an Apple or Google product? Gotta be awful! Love how people treat competition as something awful when it doesn't follow their own brand loyalty.

Edit: It looks like the authors snark isn't as obvious to others as it was to me. I'm all for cross platform development and doing whatever makes sense your company/brand in terms of development, all my side projects use tools that make them as portable as possible.

Re: Why you should use OpenGL and not DirectX

#125
post #114

Could anyone recommend a book on programming shaders for OpenGL? I know the shader language is not OpenGL, but I never knew where a good point to start was.

I think any recent book on OpenGL worth its salt would cover shaders in detail. I've just picked up the OpenGL SuperBible (6th ed.) and it's got several hundred pages dedicated to shaders.

Re: Why you should use OpenGL and not DirectX

#126
post #18
post #12

Isn't this more or less a problem of the past? Today with tools like Unity3d, UDK, CryEngine, Shiva Engine, MonoGame etc, game developers are at a point where they can pretty much stop worrying about the OpenGL/DirectX layer beneath their engines. Those Engines have become so powerful and affordable that it hardly makes any sense to roll your own. In fact, imo you would need a very strong reason to build your own eng…

> Isn't this more or less a problem of the past? Yes and no. If you want to be writing a typical 3d game like an FPS, and RTS or 3rd person platformer, you can and probably should use an off the shelf 3d engine and stay away from the lower level APIs, OpenGL and d3d. However, if you want to do something more exotic, say processing your webcam input stream with your GPU, or write a space scale render of the solar syst…

I thought I'd provide an anecdotal supporting example to show that there are valid exceptional use-cases that don't practically fit into a pre-existing 3D engine -- specifically, a 3D visualization of a space-scale procedurally generated universe with trillions of stars and planets.

Several times I tried expanding an existing modular 3D engine (OGRE) towards my goal of displaying a huge virtual universe of planets and stars. While I got it rendering 3D planets after some work (where I basically had to implement manual rendering code anyway, since the engine didn't support the odd use-case of spherical terrain), contorting it to support massive coordinate spaces, huge view ranges, dynamic loading/unloading etc. was just far too messy to even hope to attempt in that engine.

After several attempts to cleanly implement a space-scale engine as an extension of an existing engine, I started over from scratch using pure OpenGL (WebGL). And this time, I managed to keep the code reasonably tidy while supporting trillions of stars, planets etc. as I had originally planned [1].

Would I have been able to do the same thing in OGRE if I kept trying? Probably... but likely with far more ugly code, terrible hacks, bloated engine, and slower loading times.

To be fair, I'm not advocating always "rolling your own" 3D engine. It's usually a huge task, and using a pre-existing engine will in almost every case be the smarter choice. But with some people trying to argue "you can make it fit in [Unity/OGRE/etc]", I thought I'd provide at least one anecdotal counter-example.

1. Kosmos: A virtual 3D universe in your web browser (https://github.com/judnich/Kosmos)

Re: Why you should use OpenGL and not DirectX

#127
post #20
post #8

Again that post. Spreading the lie that all game consoles support OpenGL. Yes, OpenGL is a great API if one cares about portability and FOSS. Reality, the game industry cares about their IP and getting games released no matter what technology stack is used. Many AAA studios don't even develop for all platforms, rather target a main one, leaving the port to subcontractors. Back in the golden days of the arcades, many…

> Many AAA studios don't even develop for all platforms, rather target a main one, leaving the port to subcontractors. AAAs are one thing and are mostly based on engine technology that has been in development for years. For them D3D vs. OpenGL is a non-issue that was solved a decade ago. Or they stick to being Windows only. And they have the budget to port (or hire a subcontractor to port) one way or another. For ind…

Most successful indies worry even less about multi-platform support, and very few indie developers roll their own tech. A surprising amount of indie games start as GameMaker games requiring porting for any sort of proper commercial release. The more technically proficient indie developers hopped onto the Unity3D wagon given how that engine is general purpose enough for any type of project and had great support for indies early on.

Subcontracting to a porting house is just as common if not more common for indies. If your game is successful on one platform a porting studio will be willing to work for a revenue percentage as indies are much more willing to give away significant percentages. Furthermore publishers are fairly willing to front the money for porting if you have a fully working game already designed and playable no matter what platform it was initially developed for. Indie games rarely push the computation and memory boundaries so porting isn't particularly difficult.

The general case for Indie developers is develop for whatever you're most comfortable and worry about that other stuff once you actually have something worth worrying about. The cost of porting a game is pretty trivial if it's worth porting.

Re: Why you should use OpenGL and not DirectX

#128
post #124

Earlier quoted context omitted.

Yeah, don't worry about those mobile devices. We've got plenty of directx support for those too. What are they again? Surface? Windows phone? I think I know one guy who has one.

Not an Apple or Google product? Gotta be awful! Love how people treat competition as something awful when it doesn't follow their own brand loyalty. Edit: It looks like the authors snark isn't as obvious to others as it was to me. I'm all for cross platform development and doing whatever makes sense your company/brand in terms of development, all my side projects use tools that make them as portable as possible.

No one was making a qualitative judgement against Windows Phones, just a quantitative comment about install base.

Re: Why you should use OpenGL and not DirectX

#129
post #124

Earlier quoted context omitted.

Yeah, don't worry about those mobile devices. We've got plenty of directx support for those too. What are they again? Surface? Windows phone? I think I know one guy who has one.

Not an Apple or Google product? Gotta be awful! Love how people treat competition as something awful when it doesn't follow their own brand loyalty. Edit: It looks like the authors snark isn't as obvious to others as it was to me. I'm all for cross platform development and doing whatever makes sense your company/brand in terms of development, all my side projects use tools that make them as portable as possible.

He didn't say anything about the quality of Windows RT / Windows Phone products. Sounds like he was just implying that they have a relatively small installed base compared to iOS / Android products. That's pretty hard to argue with.

But... this is not very important anyway. There's no reason to have a "brand loyalty" flame war. Arguing and flaming about this on the internet is not productive. Let's just have a practical discussion about how to target multiple mobile platforms.

If I was serious about writing a cross-platform mobile game, I would use some middle-ware like Unity, Unreal Engine, Cocos (yes there is a version for Windows Phone), etc. This takes care of the underlying differences between OpenGL ES and Direct 3D, so the developer can focus on the game itself and not worry too much about the rendering engine or graphics API.

If I was writing some other app that used OpenGL ES, I could still make a port for Windows Phone / Windows RT by using a wrapper for the graphics-specific code. Such wrappers already exist, and it is not too terribly difficult to roll your own if you prefer.

A lot of times, when you see a big game that is available on iOS, Android, AND Windows Phone / RT, usually they have done this:

- Use middle-ware as discussed above already

AND / OR:

- Write the majority of the logic in C++ (all of these platforms have ways of utilizing C++ code), and use a graphics wrapper that isolates the rendering code, so you can work with OpenGL ES or Direct 3D interchangeably.

Re: Why you should use OpenGL and not DirectX

#130
post #108

Earlier quoted context omitted.

A Microsoft OS still runs on over 90% of the desktop market.

Right now, yes. However we do know that this has been changing quite rapidly in the past years so why fall back on the use of this argument?

    On traditional PCs and Macs, Microsoft
    still owns an overwhelming market share,
    with 91.8 percent of all traffic coming
    from Windows-based machines. Among non-
    Microsoft operating systems, both OS X
    and Linux have stalled since October
    2011, hovering around 6.9 percent and
    1.2 percent, respectively.
http://www.zdnet.com/latest-os-share-data-shows-windows-stil...
Post reply on HN