4 ms·
I was under the impression that DirectX was a more extensive API, and included support for more complex high level operations- is this untrue?
by Dilpil 17y ago
I was under the impression that DirectX was a more extensive API, and included support for more complex high level operations- is this untrue?
- psadauskas 17y agoYes, the article says this is untrue. It specifically mentions features that OpenGL has had years before DirectX.
- daeken 17y agoWell, no, the article points out a few specific cases where it's untrue, but there are a few things that need to be pointed out here. Extensions like tessellation aren't guaranteed to be there, and if they aren't you have to implement this yourself. It also ignores the shader/effect pipeline, which you effectively have to build yourself in OpenGL, unless you use Cg. As I noted in my first comment here, these are strengths of OpenGL in some cases, but are big negatives in others.
- rbanffy 17y ago"and if they aren't you have to implement this yourself." Either that or offer a slightly degraded gaming experience according to what the OpenGL system exposes. Nobody cares that much if their phone can't show the same tessellation glory their kid's dual-GPU oil-cooled deskside monster can.
- ajross 17y agoTesselation is a hardware feature. It's not an API extension. It's not "guaranteed to be there" ever. Any app that wants to use it needs to test for its presence. How are the D3D and OpenGL mechanisms not completely isomorphic? And OpenGL has had a standard shader language since v2.0, about 6-7 years ago? You don't have to "build it yourself" except in the sense of having to port DX shaders to a slightly different source language.
- astine 17y ago"DirectX" is an umbrella term that covers a lot of low level APIs. OpenGL is just a 3D graphics layer (good one) while DirectX does many things including 2D, IO and sound. Now it seems as if the author is only comparing OpenGL to Direct3D, but he doesn't make that clear.
- witten 17y agoMinor correction: OpenGL actually works great for 2D as well. There are versions of all the API functions that accept vertices with 2 dimensions instead of 3. And you can quite easily make vertex buffer objects with only 2 dimensions.
- daeken 17y agoYou have the ortho modes and all that, but that's not really 2d drawing. Doing things like concave shapes with specific line drawing (especially if you want decent anti-aliasing) is complex and expensive, since OpenGL isn't particularly well suited for it. Of course, on the DirectX side you have the DirectDraw vs Direct2D mess, not to mention that the APIs are very poorly designed (in my opinion, at least). Doing 2D stuff in OpenGL isn't terrible, but it's certainly not well suited to it. In most cases, something like SDL ends up being easier and rarely too much slower (well, unless you're scaling/rotating...).
- witten 17y agoIt's true that OpenGL doesn't have built-in support for things like concave shapes, but you can always do tessellation and feed GL triangles. (Some tessellation options were mentioned in the article.) I've found that for my particular uses, the hardware acceleration you get with GL makes it worth it for 2D, even if it's perhaps not otherwise as well-suited for that as SDL.
- daeken 17y agoYou know, this makes me think. Are there any good 2D libraries for OpenGL? I've seen a few, but they all seemed very special-purpose or were either poorly designed or just didn't work. It'd be interesting to have a nice library like SDL, but sitting on top of real hardware acceleration.
- maxklein 17y agoDirectX has a lot of sub sections - DirectShow for media playback, DirectSound for audio stuff and so on. For graphics, there is Direct3D and some other stuff I know too little about.