OpenGL worth the try?

Started by
25 comments, last by Myopic Rhino 12 years, 10 months ago
I'm starting with the game development path, I've a very good background in programming (C++, Java, C#, etc etc), not an expert but I'm sure I could manage most of them pretty good, and I'm starting right now with SDL and I'm very happy with the results, but I stopped to watch if there's a serious game development using OpenGL and found that OpenGL is used mainly as "learning" library, and some maths work,

I consider myself an Open Source lover and always try to enforce the multiple platform support in my developments, but I'm finding that the people say: "if you want to create serious game development stick with DirectX and XNA (Same thing)", that means that the game development future for apple, linux or others (based on OpenGL) is extinct?

Is it worthless to learn OpenGL if you will end up with DirectX anyway?

What about Android and iOS that are OpenGL based, are they planning to move to DirectX in the future (don't think so, but it's pretty strange that OpenGL has no really big plans for the future)?

I'm aware that this topic is going to be one of those topics where some people pull in one way while others pull to the other side of the rope, but I dont want to put all the eggs on the same basket and waste time.

Thanks for your answers.
Advertisement

I'm starting with the game development path, I've a very good background in programming (C++, Java, C#, etc etc), not an expert but I'm sure I could manage most of them pretty good, and I'm starting right now with SDL and I'm very happy with the results, but I stopped to watch if there's a serious game development using OpenGL and found that OpenGL is used mainly as "learning" library, and some maths work,

I consider myself an Open Source lover and always try to enforce the multiple platform support in my developments, but I'm finding that the people say: "if you want to create serious game development stick with DirectX and XNA (Same thing)", that means that the game development future for apple, linux or others (based on OpenGL) is extinct?

Is it worthless to learn OpenGL if you will end up with DirectX anyway?

What about Android and iOS that are OpenGL based, are they planning to move to DirectX in the future (don't think so, but it's pretty strange that OpenGL has no really big plans for the future)?

I'm aware that this topic is going to be one of those topics where some people pull in one way while others pull to the other side of the rope, but I dont want to put all the eggs on the same basket and waste time.

Thanks for your answers.


Woah woah woah! OpenGL is not a "learning" library. It's very full featured and you can make extremely high end graphics with it.

Further, DirectX is a proprietary set of libraries for Windows, so no, Apple and Google are not going to move to it. It would definitely be worth your time to learn it, I believe.

Edit: Also, DirectX and XNA are not the same thing. DirectX is a collection of multimedia libraries, one of which is Direct3D (which is what almost everyone refers to when they say DirectX). Direct3D is a low-level API that allows you to leverage GPU hardware for 3D rendering, generally providing you with a rendering pipeline and the ability to control it. XNA is a .NET library that is designed to provide a higher level API for game development. It provides functionality in addition to graphics rendering, and is designed to be used with managed code. The performance of XNA, while quite good, is unlikely to match the performance of DirectX + C++.

They differ quite a bit in design philosophy. One of the prime goals of XNA is to eliminate a lot of the boilerplate code that is involved in making games, while DirectX promises no such thing.
Thanks for your fast reply PropheticEdge, I realized that OpenGL is not a learning library as it's very powerful and complex for a none skilled developer, but I labeled as "learning" because as far as I can see most of the people use it to do some experiments and small games, but when the people comes to the big games they changed to DirectX, I'm trying to wonder why is that, as far as I can read OpenGL is easier to learn than directx because it abstracts the hardware interaction and with DirectX you need to handle a lot of things that OpenGL does for you,

From my gamer experience I found that OpenGL is far slower than DirectX but I blame the dedication that developers tend to give to DirectX because it's the higher seller, and OpenGL is for some geeks that play on weird platforms like linux (I'm this kind of geek that's why I started with OpenGL).

Sorry I now realized that I expressed my point wrong, XNA and DirectX are not the same thing, but are propietary and not multiplatform also it's one of the Microsoft's tentacles.

PropheticEdge, if someone ask you to create a new game will you take DirectX or OpenGL for that? in either case why will you choose that one over the other, I know it could be a tricky and long answer but I'm trying to understand why, if OpenGL is that good and offers multiplarform, most of developers goes to a complicated-propietary API.

Thanks for your fast reply PropheticEdge, I realized that OpenGL is not a learning library as it's very powerful and complex for a none skilled developer, but I labeled as "learning" because as far as I can see most of the people use it to do some experiments and small games, but when the people comes to the big games they changed to DirectX, I'm trying to wonder why is that, as far as I can read OpenGL is easier to learn than directx because it abstracts the hardware interaction and with DirectX you need to handle a lot of things that OpenGL does for you,

From my gamer experience I found that OpenGL is far slower than DirectX but I blame the dedication that developers tend to give to DirectX because it's the higher seller, and OpenGL is for some geeks that play on weird platforms like linux (I'm this kind of geek that's why I started with OpenGL).

Sorry I now realized that I expressed my point wrong, XNA and DirectX are not the same thing, but are propietary and not multiplatform also it's one of the Microsoft's tentacles.

PropheticEdge, if someone ask you to create a new game will you take DirectX or OpenGL for that? in either case why will you choose that one over the other, I know it could be a tricky and long answer but I'm trying to understand why, if OpenGL is that good and offers multiplarform, most of developers goes to a complicated-propietary API.


I would use DirectX simply because it's what I know better (I'm not great with DirectX to be honest, but I'm worse with OpenGL).

Honestly? I think the reason people use DirectX is because other people use DirectX. It's just really commonly known and used, so people learn it since it's the most common thing. Performance differences aren't really tied into the API itself, I don't believe, but the implementation of the graphics hardware itself and its drivers. Direct3D tends to have more robust driver support, but I think for all practical purposes you will not be hamstringed by using OpenGL and can do basically anything that DirectX can do.

It sounds to me like you want to use OpenGL, but are afraid to because you believe it will be useless. It won't be. Go ahead and learn it if you like the way the API works or want cross-platform support.

Still, I'd suggest you wait until someone else pipes up on the boards. I'm just one dude and really not the most qualified to answer these questions.
According to Wolfire Games, DirectX has a lot of propaganda tied to it and that's why people think it's what you need for serious games. I don't know much about it myself, but i found their arguments to be persuasive and you can read them here: http://blog.wolfire....and-not-DirectX

id Software is probably most notable for their use of OpenGL and for being an "early pioneer in the Linux gaming market" according to their wiki article. At one point John Carmack wrote a lengthy article/rant about why he preferred OpenGL. Doom 3, a very serious game, is offered on Linux, presumably thanks to GL. Googling "Carmack directX" today brings up a bunch of articles on why he currently ("finally", according to them) prefers DirectX.

I would say OpenGL is worth learning because the API is really clean. In contrast, DX, or Windows code in general, feels bulky, abrasive, and uninspired. I won't defend that--it's just opinion. Knowing both DX and GL would probably be best so that one could be prepared for anything on any platform.
Direct3D used to have much better support than OpenGL back in the day, so it was much easier to find good Direct3D drivers than good OpenGL drivers. That's why so many games used Direct3D. Now that situation is much better, though for some things OpenGL drivers are still rough. In any case, that's still mostly inertia these days.

Also, yes, Direct3D in DX9 and earlier was horrible in comparison to OpenGL in terms of ease of use (there were lots of things Direct3D didn't do that it should have done... context losses were the main reason several games wouldn't support alt+tab while in fullscreen actually). That got better though, so they're pretty much at the same level. I still like OpenGL more though =|

Also, if you plan to work outside Microsoft platforms, then Direct3D won't take you far... if at all, really. So as soon as you move onto a non-Microsoft platform you have to go with OpenGL or similar (e.g. OpenGL ES for mobile devices).
Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

Thanks for your fast reply PropheticEdge, I realized that OpenGL is not a learning library as it's very powerful and complex for a none skilled developer, but I labeled as "learning" because as far as I can see most of the people use it to do some experiments and small games, but when the people comes to the big games they changed to DirectX, I'm trying to wonder why is that, as far as I can read OpenGL is easier to learn than directx because it abstracts the hardware interaction and with DirectX you need to handle a lot of things that OpenGL does for you,

Not really. OpenGL and D3D offers a similar level of abstraction. The reasons why D3D is preferred in current game development has several reasons, many of them historical and logistical. As a quick and dirty summary, until a couple of years ago, OpenGL used to be very badly managed. It was not clear where OpenGL would be heading, because as the committee-driven API it used to be, everybody was pulling into a different direction. DirectX, being under sole control of Microsoft, had a clear evolutionary path. This, coupled with the fact that some hardware vendors were unable or unwilling to deliver stable OpenGL drivers (Intel and ATI before it was acquired by AMD) pushed the industry towards D3D, which was (rightfully) perceived to be more 'stable' and reliable from a vendor support point of view.

Nowadays, things have cleared up. OpenGL management has been streamlined and future development of the API is much more transparent. Except for Intel, drivers are now as good and reliable as D3D drivers. Current OpenGL has feature parity with D3D11. So all in all, one could just as well use OpenGL for a modern AAA game. It's not yet widely done because of existing D3D code bases of course. But the emerging Mac game market might partially shift development back to OpenGL (especially if/when OSX Lion is finally going to support OpenGL 3.x)

Now, even before that, OpenGL was never a 'learning API'. It has always been, and still is, the most widely used API for industrial 3D, such as CAD/CAM, medical imaging, military applications, flight simulators, etc.


From my gamer experience I found that OpenGL is far slower than DirectX but I blame the dedication that developers tend to give to DirectX because it's the higher seller, and OpenGL is for some geeks that play on weird platforms like linux (I'm this kind of geek that's why I started with OpenGL).

OpenGL code being slow is a sign of incorrect usage by the developer. Correctly written OpenGL code is just as fast as equivalent D3D code. The bottleneck is the hardware here. In fact, OpenGL is usually significantly faster than D3D9 (due to not doing the user space/kernel transitions D3D9 does). D3D10/11 have eliminated this bottleneck, making OpenGL and D3D pretty much identical performance wise.

Slow OpenGL code is probably using immediate mode, which is an 'easy' but completely obsolete (and deprecated) way of using the API.


XNA [...] Microsoft's tentacles.

DirectX and XNA are good frameworks, and so is OpenGL. You should choose your technology based on objective assessments of your requirements and your intended target audience. Don't let ideology trouble your objectivity.
Thanks for sharing your knowledge with me, basically that's what I thought, OpenGL worth the try and I will start with it, actually I'm using SDL which will bring a little bit of abstraction over OpenGL (and it will use the DirectX advantages in windows, or that's what I understood from some posts I read about SDL), that way I can start my developments faster and with less pain :D.

Eventually I will need to use OpenGL directly and start to try DirectX if I want to be a game deverloper that could manage to stay in business.
SDL is definitely a good start, as many all of the OpenGL tutorials I've run across on the Internet use it.

If you prefer a C++ equivalent, SFML is also a good option. It doesn't have the vast install base of SDL, but it's entirely hardware-accelerated (like SDL 1.3 will be).

When you're ready to take on OpenGL directly and want something small and lightweight to set up your context, I suggest GLFW (plus BASS or OpenAL for sound). It offers similar functionality to GLUT or freeglut but gives you more control over your main loop. (GLUT and friends tend to implement the main loop themselves.)

Also, to answer the original question: I think OpenGL is a good way to learn graphics programming since there are many helpful tutorials out there. Earlier versions of OpenGL (1.x and 2.x) are very easy to learn since they take care of a lot of things for you, though you wouldn't want to make a commercial game with those. Once you're comfortable with the basics, you can move on to more advanced techniques and later versions of OpenGL (3.x and 4.x). Since later versions of OpenGL and Direct3D act as relatively thin layers over the low-level graphics subsystem, they tend to work in relatively similar ways so learning one will let you pick up the other fairly quickly. It can't hurt to know both. :)
:o that really hit something important, didn't know that SDL is not hardware accelerated, I read that SDL 1.3 will use DirectX under the hood to get advantange of the hardware acceleration provided by DirectX but I thought they were talking about using the drivers provided to DirectX (which seems to be better than the OpenGL's) but did not realize that SDL 1.2 was not hardware accelerated, why is that? OpenGL is hardware accelerated too right?

This topic is closed to new replies.

Advertisement