C++ OpenGL - Deprecated or not !

Started by
14 comments, last by kop0113 10 years, 1 month ago
This quickly devolves back to the old OpenGL vs Direct3D debate.

The two have different philosophies, both with their own benefits and drawbacks.

Direct3D packages features together in one era-specific bundle. Either the bundle is fully available on the machine or it is completely unavailable. Once you select the bundle you cannot move outside it. While this is great for performance generally and solves several device-specific compatibility concerns, it makes experimentation and addition of new features much more difficult.

OpenGL provides access to everything the hardware says it can do. The oldest, slowest, most unoptimized methods are available to you, as are the most cutting edge experimental features the driver provides. While it makes it very easy for you accidentally use poor performing features and means you sometimes need to be aware of platform-specific differences, it makes experimentation and addition of new features very easy.


Both solutions are valuable, depending on your project's specific needs.
Advertisement

At the hobby level, using either technology isn't all that many lines of code different so perhaps implement both ;)

I do find it a bit annoying that the semi-official DXUT has been demoted from the official Microsoft SDK. I used to teach students with that and like GLUT, I found it was a great way to skip the WinAPI / X11 cruft.

As for legacy OpenGL stuff.. who cares?, just dont use it (even on a platform that can). I find the biggest problem are all the obsolete tutorials laying around the internet. Perhaps the next OpenGL standard should be renamed KarstenGL_ to help find more directed / useful sites on the internet ;)

http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.

Well thanks for all of the replies, for which i partially understood what u guys said. Some suggest switching to Direct3D, some talking about stuff i don't even have idea what it is, since im in learning steps. I like how glfw handles windows in itself but what when it comes to audio and networking ? Direct3D seems to be more complete and i dont know why OpenGL guys are not making such complete changes but rather just updating the core. I'm tired of all those changes and deprecated stuff, libraries and whatsoever. I'm thinking of switching to Direct3D and learn something complete that is worth giving my time. Also if they decide to remove deprecated stuff from the core what will happen to old games that were developed with old OpenGL. Really im tired of all this stuff which makes it more harder for beginners to understand what is what and what to start learning.


Direct3D seems to be more complete and i dont know why OpenGL guys are not making such complete changes but rather just updating the core.

As mentioned in my post above, that is the choices the two teams have made.

Direct3D is focused around a bundle of features. If you create a Direct3D 6 interface it means you get everything from the 1998 era. Everything is designed around high performance graphics concepts at that time. If you create a Direct3D 9 interface it means you get everything from the 2002 era. Everything is designed around the high performance graphics concepts at that time. If you create a Direct3D 11.2 interface it means you get everything from last year's batch of high performance graphics concepts.

You might be thinking "Great, I'll just create an 11.2 interface and work with the modern stuff!" But it isn't that simple. It means the simple immediate-style interfaces are unavailable to you, you must develop your code around high-volume polygonal systems. It means you cannot opt out of shaders, you are required to provide default compute shaders, pixel shaders, geometry shaders, and more even though you are just learning what those means. It means you cannot opt out of any part of the rather complex rendering pipeline.

When it comes to learning how to write graphics programs you might decide that you want to leap in head-first and hope you can swim. In that case, pick up the latest round of D3D that your system supports, provide all the mandatory shaders (As a beginner you are still responsible to know how to write shaders) then properly configure all the steps of rendering (you've studied all the stages, right?) then load your meshes and textures (you aren't allowed to draw primitives since it is focused on high performance rendering; even as a beginner you must use the same types of models the professionals use) then feed in all your animation arrays (which, as a beginning programmer, you may not be comfortable creating) and otherwise do all the required steps.

If you aren't comfortable taking on EVERYTHING that is required of the latest D3D edition, you can look back and take a simpler collection of interfaces. D3D9 is relatively popular because it still includes a lot of legacy material and doesn't require the programmer to provide everything along a fully-programmable pipeline. But you still need to provide quite a lot.

The OpenGL mentality is different. The goal is not to provide a single unified interface. The goal is to provide an interface to all the functionality present on the card. You are permitted to use non-optimal functionality. If you are learning the basics of 3D mathematics you are not forced to provide a bunch of mandatory shaders. If you are learning the basics of 3D model management and manipulation, you are not forced to follow the high-performance methods of transferring them to the card and managing remote resources. You can pick and choose what features you want at any time.


Also if they decide to remove deprecated stuff from the core what will happen to old games that were developed with old OpenGL.
OpenGL code will continue to function as long as the cards and drivers are able to provide the features. Even if they are provided through slow software emulation, all that is required is that they are present.


Really im tired of all this stuff which makes it more harder for beginners to understand what is what and what to start learning.

Yes. You are not alone.

Twenty years ago when 3D graphics cards were just being introduced things were much easier.

Back then everyone was on a fairly level playing field.

Today you can start by looking at your comfort level, then deciding if you want to start learning a complete feature set (as provided by Direct3D) if you want to start learning one feature at a time (as provided by OpenGL). If you decide to learn a feature set, figure out what era of features you want to learn, and pick the corresponding set of features.

Used properly, both systems are fully capable of high-performance rendering required by modern games. Used improperly, both systems are fully capable of giving terrible performance. They are similarly powerful since they are basically just two alternate interfaces to the same underlying hardware.

This notion about GL being easier because it can hide modern hardware features is a little off since Direct3D 11 can also be used in "easy mode" via Microsoft's official DirectX Tool Kit (https://directxtk.codeplex.com/). It supports a number of pre-configured effects and render states (so no messing with shaders or figuring out the magic combination to get alpha blending to work right), efficient immediate-mode-like primitive batching, texture loading, model rendering, sprite batching, sprite fonts, a math library, and some geometry/shape factories.

Sean Middleditch – Game Systems Engineer – Join my team!

This notion about GL being easier because it can hide modern hardware features is a little off since Direct3D 11 can also be used in "easy mode" via Microsoft's official DirectX Tool Kit ...

Full stop.

Don't compare unrelated things. OpenGL is only comparable to Direct3D - nothing else.

Also, I for one would appreciate if an extra effort would be made to evade "flammatory" corners of this topic. Might be just me though :/.

There's one overwhelming reason to favor OpenGL over Direct3D: non-Windows platforms.

I would start with OpenGL ES 2 or 3. It's basically the modern subset of OpenGL. It opens the door to all kinds of mobile platforms, Raspberry Pi and such, and HTML5 WebGL (for whatever they're worth) in addition to desktop Linux, OSX, and Windows.

Disclosure: hardcore Linux user smile.png

There's one overwhelming reason to favor OpenGL over Direct3D: non-Windows platforms.

Definitely! Unfortunately many people still don't know what a Linux is.

Until Direct3D works on non-Microsoft platforms, it is still like comparing Apples and Oranges. As it stands, one works... one doesn't. Simple as that lol.

That said, the large number of ported DirectX games on the Linux version of Steam proves that migrating an existing codebase from Direct3D to OpenGL (and vise versa) isn't really that hard. Though unfortunately the recent death of Cg has complicated matters.

Disclosure: Equally hardcore BSD user smile.png

http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.

This topic is closed to new replies.

Advertisement