Possible Duplicate:
Should I continue studying OpenGL or just switch to DirectX to give me a better chance of landing a job in the game industry?

I tried Google but found quite old articles, so I am in search of an answer in context to year 2012.

Hi all, I don't know if you will consider this question appropriate for this community but I am constantly searching for a perfect answer. What I have seen is that most of the games that are released these days are DirectX 1x based. Except for few games like Starcraft or Diablo which don't have high end graphics are using OpenGL. So I have few questions to ask.

The platforms i would like to target are PC (windows), Xbox 360 and PS3 (must).

  1. Should I go with learning OpenGL to see my future in game development industry? Or should I shift to Directx?
  2. If I learn OpenGL first, will it be difficult to learn direcx then?
  3. Which API is most suitable for indie development?
  4. Which one of the two API's are better from coder's (programmer's) point of view? Like OOP and style of coding.

Is openGL being cross platform should be the only reason to choose it over Directx? Even when vendors are not providing enough stable drivers for it.

Thanks in advance.

I have read this post, but I have few questions. Should I continue studying OpenGL or just switch to DirectX to give me a better chance of landing a job in the game industry?


Firstly, if your making games, are you sure you want to be making game engines from scratch rather than using something like Unity, Unreal's engine and so on?

  1. OpenGL is needed on Mobile phones, OSX and every console other than the X-Box (well the other console use their own thing thats a stripped down OpenGL similar to OpenGL ES since ES 2.0 wasn't out back then). So you will definitely need it in the games industry. You will probably also need DirectX. Having said that I think most game devs now program using premade off the shelf engines and don't worry about the graphics API (other than possibly things like shaders).

  2. I don't know much DirectX (being a Linux user myself) but I can't see learning 1 really causing you problems learning the other. They should bother share similar underlying concepts. The main thing would be the coordinate system.

  3. For an indie game developer it can depend. Indie games are niche products. Having support for other platforms such as OSX can give you a large number of extra sales as the number of game available on the platform is fairly limited and there more likely wanting to boost support for their platforms. You can also throw in Linux support for little extra and get some good PR (the main hassle is building for a whole bunch of different targets). Mobile phones are also something to look at as they all use OpenGL ES. Porting to WebGL is also another possibility with things like Google's Nativeclient and emscripten (Compiles code to JavaScript) or just redoing it in JavaScript (or even using JavaScript across the board the desktop, web and mobile).

Having said that, many indie devs make stuff using XNA and sell through the Xbox store. Since it's built right into the Xbox they get some good sales and XNA seems like a good platform.

4) Once again I'm not that familiar with DirectX.

I've heard John Carmack prefers DirectX and I also saw the dev working on the infinity universe engine say similar things (But they went to DX11 from whatever OGL version they where targeting, Carmack would probably have been using an older OpenGL version). But OpenGL has had massive changes recently, many of which have made coding in it much easier (uniform buffer objects, GLSL uniform routines). Those changes will take a while to roll out.

OpenGL doesn't have much OOP. It does however refer to things as 'Objects' (VertexBufferObjects, VertexArrayObjects, TextureObjects, FrameBufferObjects). Those things are fairly easy to wrap in a class for whatever language your using. You don't need to implement the whole API just the parts you want. There is a C++ binding called OGLplus although it's newish and not widely used.

From what I can see from Googling DirectX also requires similar OOP frameworks to be produced.

If they both need the frameworks then the coding probably doesn't matter to much since you should only be using it in the framework.

Finally OpenGL gets some flac for having broken implementation on some system (Such as netbooks with Intel chipsets, even the ones that do work are often only OpenGL 2.x).

Or being out of date on many system (The latest version of OSX 10.7.x has 3.2, the previous version 10.6.x was 3.0, then 10.5.x is either 2.0, 1.5 or 1.3 depending on the video card (Minecraft sticks to 1.3 as it's render target for basically this reason), those systems are going to be stuck at that OpenGL version forever unless the users pay for an upgrade and 10.5 was only released in 2007 so you will have to live with it for a while longer). One good thing is you can just target what extensions you want and make your framework support fallbacks (For example you can make a VertexBufferObject class that will use the 1 vertex at a time fixed pipeline functionality if the VBO extension is missing). Also remember OSX doesn't support DirectX at all.

| improve this answer | |
  • \$\begingroup\$ I'm going to say that you nailed the right answer in your first sentence. Don't bother with OpenGL/DirectX/Whatever. Just use something like Unity. \$\endgroup\$ – Tim Holt Mar 18 '12 at 17:44
  • \$\begingroup\$ First thanks for such a detailed answer. The only problem I am facing in choosing OpenGL is that it does not have good tools to work on. Even I thought to go with Unity3D at first but I wanted to get a good hold on 3D programming first before stepping out and learning other software. \$\endgroup\$ – user14498 Mar 18 '12 at 18:13
  • \$\begingroup\$ also if you could tell me a good way to learn OpenGL. If you could suggest me few books that would be great. And how about SuperBible covering 3.x. Will it be difficult to learn 4.x if I start with SuperBible covering 3.x? \$\endgroup\$ – user14498 Mar 18 '12 at 18:35
  • \$\begingroup\$ @TimHolt If the intended position is a gameplay programmer or level designer, then yes, learning Unity or UDK is very appropriate. However, if the intention is to work on an engine, then every gritty low-level detail should be examined, even compilers :) \$\endgroup\$ – kevintodisco Mar 18 '12 at 19:45
  • \$\begingroup\$ @Priyank: OpenGL 3.x and 4.x are very similar. In fact if you use shaders and Vertex Buffer Objects (VBOs), you can make programs that work with OpenGL 1.5+ while still being similar in overall design to 3.x/4.x programs. But newer versions of OpenGL make code a lot simpler. For example you don't have to bind uniform variables to specific ids as you can do it in your GLSL code using the layout keyword. You can store all your uniforms in a shared uniform buffer object rather than upload one at a time to each shader. You can use uniform routines to shrink the number of shaders you need. \$\endgroup\$ – David C. Bishop Mar 19 '12 at 6:45

The answer whenever a beginner asks 'should I learn this or that' is always: Learn everything you can. Honestly, I don't understand why people would think they can only possibly learn one of the alternatives.

And yes, your chances of getting a job writing rendering code as your first games industry job are slim unless you are so into rendering that you write some amazing demos, in which case you'd probably not be asking this question. And even if you did get hired to work on rendering it's most likely to be working on modifications to an existing engine where the knowlege of maths related to graphics and the skill of being able to read and understand other people's code is worth 100x the knowlege of any particular API.

For all those reasons I'd suggest writing as much code as you can as early as you can and to do that in OpenGL, simply because it's a 'C' style API and thus easier for a beginner to get to grips with.

btw. I have to correct the myth that comes up time and time again whenever OpenGL vs. DirectX is discussed, to paraphrase "that DirectX is used on Windows and XBox and OpenGL is used everywhere else". This is not true. OpenGL is useful for MacOS or Linux development, although neither are big games platforms. And OpenGL in it's ES form is most widely used on mobiles and tables these days. But NO current generation games console uses OpenGL, in fact the only games console I'm aware of that ever used it was the N64. PS3 and Wii developers post commands buffers directly the GPU using libraries supplied by the platform and Xbox 360 uses a modified form of DirectX.

| improve this answer | |
  • \$\begingroup\$ I think you said absolutely correct that one should learn everything or at least try. Even I too want to do this. But I just want to know that learning which one of the two API's would help me understand the basics of 3D programming easily and in a better way. and I think that PS3 uses OpenGL ES with Sony's extensions. \$\endgroup\$ – user14498 Mar 18 '12 at 18:33

As a beginner, I think shooting for cross-platform is a huge mistake. It's just adding an extra layer of complexity that you don't need right now; what you need is to focus on learning core concepts and how they fit in to the overall flow of a graphics pipeline and structure of a program.

Either of OpenGL or Direct3D will give you that.

I have to admit right now that I'm biased so take the next two points with an appropriately sized grain of salt.

  • Driver quality is hugely important and even more so for a beginner. If something goes wrong you need a fairly reasonable reassurance that it's due to a problem in your own code and not a driver bug. Direct3D drivers are just so much higher quality, owing to not needing to support decades of accumulated legacy, having a simpler driver model and a tighter certification process.

  • Tools, documentation, examples, etc tend to be better for Direct3D. In particular you get the debug runtimes and PIX, both of which are extremely valuable for hunting down problems in your code.

U62's final paragraph is correct - OpenGL is not as portable as it is often made out to be. You can achieve a certain level of portability by restricting youself to a common subset of full OpenGL and OpenGL ES, but again with the extra layer of complexity thing. It's most definitely not a simple "recompile and off you go" however, and even if it were you would still have to deal with other platform-specific subsystems (sound, memory, input, file access, threading, networking, windowing, etc) - the code for which may even dwarf the rendering code.

| improve this answer | |