🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

OpenGl or D3D

Started by
19 comments, last by Lazero 24 years, 6 months ago
I am about to start programing a game which will be 3d I have learnt a bit about opengl already but before i learn more i want to know which is a better api opengl or D3D. Which is easyier to program? which is more powerful? What are the benifates of each? Please help -Nick Dinsmore
Advertisement
OpenGL is the API chosen by 3D guru, John Carmack, you''ve seen the Quake series, that''s OpenGL. However, Direct3D is updated far more often meaning that it simply beats OpenGL for functions available. It''s really up to you, they are both of pretty much equal difficulty to program, but once you''ve learnt one, you probably will only want to use that one. You''ll find all weaknesses in the other one but all strengths in the one you''re using.
I agree with that. Recently, I've been concentrating on learning D3D. I had already done quite a bit in OpenGL, but I decided to just see what the other side had to offer. The differences I've noticed is that OpenGL seems to do a lot of the setup on it's own, which often can be nice for writing a smaller app where you really don't want to worry about it, while D3D has a bit of setup required. It's not tough setup - if you have any clue as to how DirectDraw works, you'll be fine. Personally, I think I'm going to stick with Direct3D and put some faith in Microsoft's ability to continually develop new technologies and support old ones. Granted, so far Direct3D has had little support in Windows NT, and none on non-windows operating systems, but some of the advancements in the DirectX API make it worth it to me. Plus, if Win2k is as good as I've been hearing, we probably won't have to worry about it much longer. As for which to use, I can't tell you that. You'll find good tutorials and documentation on both API's all over the net. Anyway, good luck in your quest.

Edited by - Pythius on 1/4/00 3:04:53 PM
"The object of war is not to die for your country, but to make the other bastard die for his"
Direct3D is getting better and better, OGL really isn''t going anywhere. The main reason Carmack chose OGL was because back then, D3D just plain sucked.
These days it kicks ass, and because of the effort Carmack put into boycotting D3D in those days, he would look an idoit changing his mind.
Another reason is because so many engines are licensed ports of the Quake engine, they all use OGL, and most newbies starting think: "Quake uses OGL, it must be the best thing to use."

Also note that it has the backing of Microsoft, which means nothing can stop it.
It also has better driver support, and is FASTER (software and hardware) on 90% of todays 3D cards.

And don''t think OS portability is a reason to use OGL, because 97% of all the worlds computers use windows. Bwahaha.

Anyway, i don''t want to turn this into one of those long D3D vs OGL threads, because like assholes, everyone has an opinion on it.

Although, my opinion is the _RIGHT_ one.
So just use Direct3D.






Even more reasons..
1. Direct framebuffer access. (see all the glDrawPixels/glReadPixels messages floating around)
2. Very flexibe scheme for the D3D renderer. Rendering directly to a texture is absolutely no problem
3. On consumer cards (which 90% of the 3D users out there use) it is faster and better supported than OpenGL.
4. Easier to implement 2D stuff through DirectDraw. (game development)
5. Very easy to combine with GDI graphics.
6. At least on TNT/TNT2, a far lower memory footprint.
7. Fewer driver paths that can be taken, so it''s harder to take an unoptimized path.
(such as using short ints as indexes with the TNT drivers and vertex arrays)
8. D3D is NOT harder to program than OpenGL, IF you want high-speed code. Writing efficient, high-speed code is difficult with both OpenGL and D3D. I even tend to say that D3D pushes you more in the right direction. Getting up and running is simpler with OpenGL, which is a big drawing point for clueless newbies, but there a a lot of D3D examples to serve as a start.
9. OpenGL drivers are not guaranteed to deliver the desired result, while Direct3D can be queried whether it support a feature or not. (And the fact that OpenGL API advancements are years behind Direct3D).
Dont argue with me, i can back everything i said up. But i ain''t gonna bother.


Sounds like you want someone to argue with (not me :)). I''m just starting to look at D3D (I admit it, I''m a D3D newbie), but while D3D is certainly being developed faster than OGL, some of the features still look like things OGL already has (DX7 says it added user clipping planes, which is in OGL, and state-block changes, which seems to be like OGL display lists. Or are state-blocks just an updated version of D3D''s old display lists?).

Also, the API is constantly changing, sometimes fundamentaly. D3D7 is quite different than DX6, requiring pretty much re-learning the API from what I''ve seen. Nobody ever seems to mention this. The core OGL API is pretty much set in stone.

And portability DOES matter to many. Certainly to Carmack. Him not supporting D3D has nothing to do with looking like an idiot, which he wouldn''t. When he said it, D3D was garbage, and supporting other platforms is a big deal for him. D3D will never do that. That is also a reason OGL can''t progress as fast as D3D. Supporting many systems isn''t easy from a design point of view.

I''m not saying which is better, because I haven''t tried them both yet. But there are clear drawbacks to both, and rapid development of D3D is not always a good thing if the API keeps changing. (Feel free to correct any mistakes I''ve made)

Rock
I''m dissappointed in you annonymous coward! I''m not going to yell or bitch or anything, I''d just like to point out that you''re a narrow-minded idiot who is either kidding (in which case ignore this message) or is just a loser. I am obliged to agree that in many cases D3D is "faster" then OpenGL (you contradicted yourself by saying "FASTER (software and hardware) on 90% of todays 3D cards" because the entire point of a software renderer is that it does not use the 3D acceleration features of a video card) and is improved quicker, but just because D3D is good doesn''t mean OpenGL sucks. And your opinion is worthless because, as your name suggests (well mine does too, but I''m not) you''re a coward (I know it says Anonymous Poster, but it *should* be anonymous coward)who is also hypocritical (in my eyes at least). I can name to you many ways in which Linux is far superior to windows in most aspects, however I won''t, because I know it''s a dumb thing to do, people who use Linux use it because they want the constantly updated (and free) features, people who use windows want it for the easier access to games and other tasks (*generally*... please do not let this erupt into a OS war, I''m trying to nutralize the previous post here). This is much the same with OpenGL and D3D: I find OpenGL much simpler to use, and I don''t mind that it''s not constantly updated on the hardware and that it is somewhat slower, I want to be able to make my games with nice clean code. I have actually seen clean D3D code, however I cannot produce, therefore I use OGL for that reason. others use D3D because they want maximum performance and great features and whatnot.

OK, I''m very sorry for blabbing(I feel like I''m writing a book), I know I''m a horrible writer/speaker (I''m currently failing English, yay) but I''ll now sumarize the point here: "You, anonymous coward, are a narrow-minded, cold-hearted, foolish little man (or woman?)" "As for you, Lazero, I find OpenGL easier, you may not, try both, see how it turns out, if you find you need the performance or features or you like D3D, use it, if you find you don''t and you prefer OpenGL, use that instead. And most of all, don''t listen to bad people like that coward."

And they all lived happily ever after... The End
Onething which has been left out of this discussion so far, but that deserves a mention is portability. With D3D you will only be able to run on the following platforms:
Win95
Win98
Win2000

With OpenGL and a few more days development you could support:
Win95
Win98
Win2000
WinNT 4
Linux
BeOS
MacOS
SGI workstations
...just about everything ever invented

This could be important to some people and is worth mentioning
I like openGL because:

-less code needed to set it up
-less code needed to do most task
-intuitive and easy to learn interface: I learnt how to program a 3d walkaround engine in openGL from a tutorial of 20 pages and I understand every command and every parameter I use completely.
-automatic supported by many 3d cards like: tnt, tnt2 and geforche. you don''t need to add code for acceleration.
-Not much hardware bugs and bugs in general.
-If you know opengl is learning quakGL and similar game engines not difficult.


It seems that noone here knows about OpenGL''s extensions, every month when the ARB comes together they discuss on what extensions will be developed, thus you cannot say that OpenGL is going nowhere...

Drago
osu!
Perhaps I''ll share some problems I''ve had with both APIs for a change.

Starting with Direct3D, I can say it took me about a whole year of reading and re-reading documentation on the subject before I really understood how to use it. That, of course, was back in the days of execute buffers (dear god I''m glad that''s over with!) Also, the documentation really sucked back then and has been much improved. Whenever Microsoft adds new features to Direct3D they tend to stay rather obscure for an iteration of the API until Microsoft deems it necessary to actually document them.

Of the two, however, I''d have to say I had more problems getting OpenGL to work properly (a totally subjective opinion, I know). Setting it up never made as much sense as Direct3D did, at least in parts. I also always had problems with the z-buffer. At first it seems to have a much cleaner interface than Direct3D, but that''s mainly because Direct3D exposes a lot of functionality in a very direct manner.

I hope you can see from this that you''re going to have troubles no matter which API you go with. You''ll just have to work through them. If you want my personal opinion, however, I''d say Direct3D. Somebody really needs to write an article about this and put it in an obvious place...

This topic is closed to new replies.

Advertisement