Jump to content

3D games programming, OpenGL vs DirectX

manon_gfx

Hello LTT forum members,

 

Ik have been programming 2D games (with allegro 5) for almost a year now and I want to start learning 3D. I have no idea if I should start with using openGL or DirectX. I am using windows 7 and I am currently not interested in selling any of my games, I am currently only interested in learning.

 

The basic difference that I know is that openGL can be used in linux, OS X and windows. While DirectX can only be used in Windows.

I program in C++ and I use visual studio 2010 as my IDE.

 

If anyone could tell me the key differences between OpenGL and DirectX. And what is the best to learn, I would be very greatful.

Link to comment
Share on other sites

Link to post
Share on other sites

I don't exactly know how both work, but I do know this:

 

Gabe Newell (CEO at Valve/ Steam I think) and his company will release a steambox (mini-gaming pc) that is running Linux, and he says there are 3 reasons for this:

-He openly detests Windows 8 as a gaming platform
-No licences have to be paid to produce computers running Linux and you can always install windows yourself if you prefer that

-Linux runs on OpenGL instead of DirectX for Windows, and the guys from Valve say that they could improve the framerate by up to 20% with OpenGL compared to DirectX

 

Also, Linux supporting OpenGL means that android supports it.

 

I won't tell you what to choose as this is actually the only thing about the subject I know, but this bit of information might help you decide :)

Cooler Master 690 II Advanced - I5 2500K @ 4.5Ghz - Geil Enhance Plus 1750Mhz 8Gb - ASUS ENGTX 570 DCUII - MSI Z68aGD65 - Scythe Mugen 2 Rev. B - Samsung 830 128gb and Crucial m4 128gb - much other stuff not worth mentioning

Link to comment
Share on other sites

Link to post
Share on other sites

OpenGL is a universal standard with computers, DirectX is Windows based.

DirectX gives better results visualy, and isnt  that hard to programe with, however is takes its time and can be frustrating at times.

OpenGL is a tad harder and gives a lesser visual result, it is however more complicated to learn but is less frustrating in the futures.

 

the 3d game engine im working on at the moment is using OpenGL as the base programing for the graphics, but i am working on intergrating DirectX at some point soon, i used Python and C to get the framework of things together and its going well but im having mental issues when it comes to light Physics and simulations... im trying to do a sidestep using a mix mash of Havok and PhysX... no easy task but what i have so far is real nice with it

Character artist in the Games industry.

Link to comment
Share on other sites

Link to post
Share on other sites

Soo to be future proof OpenGL is the best. I think I will just start with that so I don't have to relearn everything.

Link to comment
Share on other sites

Link to post
Share on other sites

DirectX gives better results visualy, and isnt  that hard to programe with, however is takes its time and can be frustrating at times.

OpenGL is a tad harder and gives a lesser visual result, it is however more complicated to learn but is less frustrating in the futures.

 

That's peculiar. What makes DirectX give better results? That's the first time I ever heard of it.

 

I think a large issue with OpenGL is that it's easier to find good learning resources for modern Direct3D, but it's more difficult for OpenGL. I still stumble upon very old-fashioned OpenGL tutorials quite often. In the end, the principles are very similar, as the hardware is of course the same, they just have their own quirks. OpenGL has a very wide applicability when compared to Direct3D and it's become a more viable option nowadays, so if you can find good resources, then I'd say learn OpenGL.

Link to comment
Share on other sites

Link to post
Share on other sites

OpenGL is gaining a lot of speed so personally I would use that if possible. Cross platform support is often really important and you can always reach wider audiences. However there is a lot of specified support for DirectX which might make production more efficient.

 

http://blog.wolfire.com/2010/01/Why-you-should-use-OpenGL-and-not-DirectX

Link to comment
Share on other sites

Link to post
Share on other sites

If you want to start 3D, you can get Ogre3D engine based on OpenGL - it's open source. It supports PhysX, it is compatible with VS 2010 (I tried it myself). They have loads of tutorials, and it's not that hard I think.

 

On top of that get yourself a student version of 3DS Max from here. You have to register, but its worth it ;) Just remember it's for non-commercial use. Also, you can get PhysX development tools from nVidia for 3DS Max from nvidia's website (you have to apply for it, but I got accepted after a few hours).

Link to comment
Share on other sites

Link to post
Share on other sites

That's peculiar. What makes DirectX give better results? That's the first time I ever heard of it.

 

I think a large issue with OpenGL is that it's easier to find good learning resources for modern Direct3D, but it's more difficult for OpenGL. I still stumble upon very old-fashioned OpenGL tutorials quite often. In the end, the principles are very similar, as the hardware is of course the same, they just have their own quirks. OpenGL has a very wide applicability when compared to Direct3D and it's become a more viable option nowadays, so if you can find good resources, then I'd say learn OpenGL.

 

its from my experience with the programming.

by better results i mean better visualy, there is so much you can do with DirectX programming over OpenGL but it is limmited to just Windows software making it more useless over more platforms.

for example DirectX has PhysX and active tessellation support more stably than OpenGL

Character artist in the Games industry.

Link to comment
Share on other sites

Link to post
Share on other sites

As a person that played at work with both. I can say this:

 -> OpenGL works anywhere: consoles, Linux, Mac, Windows. However, documentation in comparison to DirectX is scares, especially for advance stuff.

 -> DirectX has full AMD and Nvidia support, well documented, great for getting started, and the most important thing of all: You can debug it. OpenGL shader language (GLSL) you can't. You have to do find tricks to kinda find a way to figure out what's going on and why something doesn't work. It's a serious pain. That is why developers prefer DirectX, and this also why it just took the OpenGL market.

 

Another advantages of DirectX is, as mentioned, because it is commercialized, Microsoft is pushed at releasing new features and abilities. OpenGL doesn't have that push, so development is slower.

Therefore, while OpenGL does catch up, eventually,. as it's actually not really far apart, it's about the same. Unless you want to do the latest and greatest stuff (which is very bad place to start), it won't mater to you.

 

As for performance difference, this is hard to say. Some things OpenGL does better than DirectX, others its the reverse. Also, it comes down to code optimization. DirectX can be debugged and better documented, so it can be worked on some more to get greater performance, so is DirectX really faster at doing something than OpenGL? Also a pro in OpenGL, might not be a pro in DirectX. So, it's difficult to say,

 

As for better visuals, again, some things OpenGL does better than Direct, others DirectX is better at OpenGL, and others are subjective. Also, how it was coded, is also part of it.

 

If you want to get started, I recommend to start with DirectX. You have documentation, you have examples, you have tutorials, you can debug easily. Then go with OpenGL.

Link to comment
Share on other sites

Link to post
Share on other sites

would you say that principles in using and implementing DX carry over to opengl the same way C# and java do?

Link to comment
Share on other sites

Link to post
Share on other sites

Somewhat.  They are things that are the same, and you can translate straight.. it's just named differently.

Others things requires the code to be changed. However, if you know the math that is going on for what you are trying to achieve, then it's not much a problem.

But I am, by no means experts.

Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 weeks later...

DirectX for big projects, because if used correctly your result will be light years ahead of OpenGL. DirectX also has a lot of things that you cannot find in OpenGL, which will spare you resources and development time. DirectX is more technically advanced and build generally more professional. Seen any big publishers use OpenGL or anyone use OpenGL for professional applications(with a few exceptions obviously for cross platform applications) 

 

The only thing you sacrifice is cross-platform if you use DirectX. But I wouldn't recommend DirectX for small projects because it's usually harder to get started with it, and a much more complicated introduction for 3D programming because there's a lot things you have to constantly consider.

 

EDIT: DirectX is however documented a million times better.

Link to comment
Share on other sites

Link to post
Share on other sites

OpenGL is definitely getting a lot of attentions right now as the mobile gaming is really growing.  If you do started with OpenGL, please note that there are still many OpenGL tutorial that is based on fixed pipeline.  You can basically skip them as they are based on older GPU.  Right now, you want to learn programmable pipeline.  

 

When I started I made the mistake of spending over a month learning fixed pipeline, and then realize, those API are very outdated as the GPU nowadays all prefer programmable pipeline.  

Link to comment
Share on other sites

Link to post
Share on other sites

it would be easeir in my opinion to learn directx then once you get a hang of that more to OpenGL. i want to start coding games and i will try my very best to use OpenGL as much as possible

Cpu: Intel i5- 4570 | Ram: Crucial DDR3 8GB | Video Card: Evega GTX 660 Ti 2GB Super Clocked


Monitor: Philips 24" | Keyboard: CM Storm Quickfire TK | Mouse: Logitech G700s |


Steam

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×