OpenGL or DirectX

Stop!

Understand I am not trying to open a can of worms here, I am NOT asking which one is better.


I am asking, from the point of view from someone that has dabbled in both, which one was easier to bed into. The reason I ask is because of 2 things:

College will mainly be using C# and C++ with DirectX.
I am more fluent in Java currently, OpenGL is more beneficial to me now.

However, it is not a case of what is more beneficial but a case of what criteria I need to actually pass the course.

I would like to learn both, however I am not quite sure just how different they are and anything that pops on Google is complete gobblytgook to my eyes.

Is one easier than the other? Are they quite similar in terms of difficulty? Is the transition from DirectX to OpenGL or vice versa fairly straight forward? If so, which transition would most likely be easier on my poor brain?

To clarify I am talking about the lower level binding code and the higher level shading language that belongs to each language.

Hopefully not a terribly vague question, asking my tutor just yields the answer “learn DirectX” due to experience in the industry.

Hi,

if you are going to go to college, which I assume is an university? in your country, I reckon you have some higher standards to approaching rendering than just learning to use some graphics API, such as OpenGL or Direct3D.

So, I guess the focus will be more towards the principles and fundamentals than to the mechanics of an API as in “do I use immediate mode, VBO or whatnot to throw my triangles onto the screen”.
At least it was for me in my university years.

If the course applies DirectX, then do go with DirectX.
Starting with modern OpenGL 4, OpenGL and DirectX now have very little differences to them, as both now try to approach the least possible driver overhead, which eventually will result in both APIs reflecting the graphics devices as close as possible and converge each other.

But like said before, do not concern yourself too much with the mechanics of some particular graphics API. If you are new to both of them, there is no particular reason for one over the other anymore (disregarding cross-platform concerns or programming languages and other not so important factors when learning about computer graphics).

So, enjoy learning either of them! Learning Direct3D is hell of a lot of fun, just like OpenGL! :wink:

Regards,
Kai

Depends on what you need.

DirectX is tailored towards game dev as OpenGL is not.

Plus, you will have an easy time with C# as is it extremely similiar to Java.

Thank you for both replies!

Kind of, College is like the step between school and university. However by the time next year comes, I will be doing a 2nd year equivalent course to that of a 2nd year University course. If that makes sense, think of College as places for people to go that didn’t do to well in school and can’t get into university right off the bat.

So learn how to use the API to do things, as opposed to learn how the API actually does them? That makes sense if so, given the API’s have been written to abstract and cover up the boilerplate low level binding code that no one (not even the person that wrote it) ever wants to see.

Good to hear they are not terribly different then. Won’t be long though until someone starts a discussion in here regarding that…prepare :stuck_out_tongue:

I will :smiley: Thanks!

Right, at the risk of derailing the thread could you summarise why they differ in their intended purpose?

No kidding, it took me less than a week to grasp it, I have already written a tower defence game for my college project which turned out rather nice!

Again, thanks for input.

[quote]So learn how to use the API to do things, as opposed to learn how the API actually does them?
[/quote]
Yeah, in a way like so, that is, to know what those things really are, like “synthesizing real-world light phenomena”.
You see, OpenGL and Direct3D provide you with a very specific approach to rendering which is called rasterization to do rendering in real-time.
But there are other approaches to do rendering, such as ray tracing.

Once you grasp how rasterization works, you will begin to see beyond OpenGL and Direct3D and it won’t matter anymore which API you use. Because all of them feature basics things such as textures, shaders and data/vertex buffers.

And then comes the time when you learn about all those nifty little tricks (so to call) that people invented over time in order to render real-world phenomena in real-time with rasterization, such as shadows with shadow mapping. Just have a look at the fantastic GPU Gems (http://http.developer.nvidia.com/GPUGems/gpugems_part01.html) series, which is a compilation of some of the best SIGGRAPH and Eurographics papers.

While looking at those things, you then realize that you need some grasp on mathematics (really easy maths, though), such as linear algebra with vectors and matrices.

And that’s basically it. Anything further beyond that concerns itself with the mentioned nifty little tricks to quinch the last frames per second out of rasterization.

Hope that helped! :wink:

OpenGL:
Is an API that facilitates interaction with the GPU. Allowing for hardware accelerated rendering. You do what you please with it.

DirectX:
Since many more games (if not most) are created with DirectX the API is in turn tailored towards game dev. There is more support, lots of documentation, and is much easier to understand

I believe that OpenGL has progressed to the point where performance differences are negligible.

Good OpenGL series:

DirectX: Microsoft-developed API that does basically the same things as OpenGL now, but is a Windows and XBox exclusive.

OpenGL: API that renders 2D and 3D graphics using the GPU and hardware acceleration, but differs from DirectX as it is avalible for most operating systems and programming languages.

OpenGL should be compared to Direct3D, not to DirectX as DirectX is rather a collection of APIs (Direct3D, DirectDraw, DirectMusic, DirectPlay, DirectSound, DirectCompute, …). DirectX should be compared to OpenKode.

According to Nvidia, OpenGL is a bit faster (about 10%) than Direct3D.

I advise the original poster to understand the concepts so that it will be possible to switch from/to OpenGL.

Don’t even bother with DirectX unless you plan on working for a gamedev company that makes Windows/Xbox exclusives.

Assuming that the ARB, Nvidia, and AMD get their crap together (I’m not holding my breath yet), DirectX is most likely going to become rather irrelevant.

I hope you’re right.

Annnnd just like that I am indifferent again.

I am not quite sure what I should do here, the reason the course teaches DirectX is due to the universities ties with Rockstar and Microsoft (MS has established partnerships with Edinburgh’s education system), students tend to get work placements and/or jobs there once graduating (not everyone of course).

DirectX isn’t going anywhere. I’ve never used it but I sort of wish I had as it’d be another string to my bow etc. but OpenGL is doing fine for me for now.

Cas :slight_smile:

Okay, my final advice to you would be, don’t let you get insecure here, really.

From the point of where you stand currently, it makes no difference whichever you learn first.
And it’s not like it’s a decision for life, that, once you start with Direct3D you’re bound to it forever.

Of course, it will take some good amount of time to understand and get comfortable with the API, but it is really not so much about the API as also stated by others here.
Instead it is about the principles of computer graphics.

But any arguing about it here is really going ahead of your time.
You will make no mistake by just delving into Direct3D.

And please do not get carried away by any prejudices that may or may not be attached to the company Microsoft or Direct3D. Any prejudices will just be in your way of learning things.
My opinion.
Be open to everything.

Regards,
Kai

Whatever the future holds for GPU APIs…direct x is a better starting place than OpenGL. So if learning is the only factor…do dx.

One thing to keep in mind, DirectX is for Windows only (and other Microsoft platforms).

OpenGL is supported on a lot more platforms (including Windows). The tech landscape has changed a lot in the last few years, so if you intend to also target growing platforms such as Mac, Linux/SteamOS, Mobile/Tablet (e.g iOS, Android), WebGL, etc OpenGL may be the better and future proof choice.

Sure, but for a learning experience dx is a better match to the current state of CPUs & GPUs. OpenGL Next should be closer to DX than the current OpenGL. But really, are either really what you want? A mid-level API would be a better choice to start understanding “graphics”. And high level API if you want to concentrate on higher-things than abstracted primitiveness. Of course low/mid/high get all kinda mixed-up in most APIs that one can choose from.

[quote=“Roquen,post:16,topic:52871”]
Want? Not 100%, need? most likely. I am the kind of person that likes to get a head start. I am not quite sure how directly the course interacts with low level DirectX API or if there is an abstraction layer in between. Regardless, what “mid” level API would you reccommend for OpenGL (LWJGL?) and/or DirectX and I can have a look at it and see what it is like?

If you just want a head start of the course then you should be able to find out what it’s going to cover. As far as mid-level APIs, that’s not something that I pay attention to, so I can’t really recommend anything. I know that some game programming folks (don’t remember a list), have on occasion pointed to https://github.com/bkaradzic/bgfx