Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / DirectX vs. OpenGL

Author
Message
Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 10th Feb 2011 07:34
So what is better for game making? I hear OpenGL has better performance. But DirectX is what most people use, as i hear. I know DX provides things like sound, input, etc. I am having a hard time deciding whether or not to use OpenGL. Im currently leaning towards OpenGL. Thanks for ye replies on my everlasting supply of new threads

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Fatal Berserker
14
Years of Service
User Offline
Joined: 2nd Jul 2010
Location:
Posted: 10th Feb 2011 12:21
the latest directx is usually 1 step a head of opengl. But the difference in reality is minimal. OpenGL (kinda) works cross OS, but like DX its latest version isnt supported on mac (and hasnt for years).

Neuro Fuzzy
17
Years of Service
User Offline
Joined: 11th Jun 2007
Location:
Posted: 10th Feb 2011 13:38
whaaaaat? OpenGL updates aren't supported on mac? What version is it supported up to??? Are you sure? Minecraft uses LWJGL which uses what I'd assume to be the latest version of OpenGL... o.o

plz elaborate ._.

kaedroho
17
Years of Service
User Offline
Joined: 21st Aug 2007
Location: Oxford,UK
Posted: 10th Feb 2011 16:52 Edited at: 10th Feb 2011 16:57
Minecraft uses OpenGL 1.1. (Thats if the yellow text by the logo in the menu is correct). Mac supports OpenGL up to 2.1, which is better than DirectX which has no support for mac at all.

I would recomend that you learn OpenGL. From what I've seen its a lot better than DirectX.

Diggsey
19
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 10th Feb 2011 18:01 Edited at: 10th Feb 2011 18:01
A good programmer will get about the same speed from both OpenGL and Direct3D, but it is harder to get that speed in OpenGL than it is in Direct3D, due to the fact that OpenGL abstracts the hardware more, so there are many features of OpenGL that end up being run in software because the hardware doesn't support them, and that people seem determined to post tutorials showing the slowest possible way to do things in OpenGL.

OpenGL or OpenGL ES is supported almost everywhere, whereas Direct3D is only supported on Windows and XBOX.

I've found that keeping track of state information in Direct3D is also much easier than in OpenGL, since Direct3D has only a few places where states are set (SetRenderState, SetMaterial, etc.) whereas OpenGL seems to have an endless number of different states and functions to get/set them.

[b]
Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 11th Feb 2011 00:48
Ok, so it seems like the reason for OpenGL is for cross platforming, but lets say i didnt care about anything but windows, would DX be the best option then? See im thinking OGL does have some performance issues, as Minecraft runs very laggy on my laptop, and Flight Simulator X runs awesome on my laptop. Thanks for the answers!

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
AutoBot
15
Years of Service
User Offline
Joined: 25th Sep 2009
Location: Everywhere
Posted: 11th Feb 2011 01:59 Edited at: 11th Feb 2011 02:02
Hey, I haven't read this book yet, but I just ordered it. Looks really good: http://www.amazon.com/OpenGL-SuperBible-Comprehensive-Tutorial-Reference/dp/0321712617
I believe it's based on the OpenGL 3 platform though, so you may have some compatability problems there. Apparently this book is one of the best ways to learn it, though.


Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 11th Feb 2011 02:51
Interesting...

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 11th Feb 2011 03:05 Edited at: 11th Feb 2011 03:05
Quote: "DirectX vs. OpenGL"


You can't compare them, since while OpenGL handles graphics DirectX handles a whole lot more.

http://en.wikipedia.org/wiki/DirectX



Support a charitable indie game project!
Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 11th Feb 2011 03:24
Then we shall compare OpenGL and Direct 3D!

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
AutoBot
15
Years of Service
User Offline
Joined: 25th Sep 2009
Location: Everywhere
Posted: 11th Feb 2011 03:35 Edited at: 11th Feb 2011 03:36
Which makes me wish there were an "edit title" forum feature at the least, sure would make things easier.


Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 11th Feb 2011 04:51
That it would, instead of asking a mod...

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Math89
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 12th Feb 2011 15:12
There are no real differences in term of performances between OpenGL and Direct 3D. Maybe once you perfectly know both APIs (in like 2 or 3 years) you'll start to see some very subtle differences that won't even make a real difference anyway. The thing is, most of the tutorials you'll find on the internet about OpenGL are written by people who have absolutely no idea how things actually work, and use some completely deprecated functionalities that are not even using the GPU. That's why if you want to learn OpenGL, I'll suggest you to learn the basics of OpenGL 2 (matrices, texture buffers, vertex buffers, shaders), and then switch directly to OpenGL 3 or 4 (if your GPU supports it), as it's much cleaner and will force you to use it as efficiently s possible.
Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 13th Feb 2011 01:08
Very interesting, yah most of the OGL tutorials seem like a bunch of hot air, lol!

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Alquerian
19
Years of Service
User Offline
Joined: 29th Mar 2006
Location: Reno Nevada
Posted: 17th Feb 2011 02:06
If I were new to 3d development, I would pick a platform that worked with OpenGL over Direct3D, hands down! The reasons are multi-faceted but simple. It boils down to your target audience and where they are headed in the future, namely browser-based gaming and mobile gaming (cell phones). Direct3D just won't get acceptance in these areas, it does not rely on open standards and OpenGL/OpenGL es are already gaining traction as the standards in these areas.

It is true that Direct3D typically performs better out of the box than OpenGL, but not by much.

Ask yourself one question:

Who do you want to use your program? Windows users or the entire world?

Sure you may be able to get your direct3d app to work on other OSes out there through the use of various emulators, but then you have defeated the entire purpose of developing with direct3D in the first place.
Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 17th Feb 2011 02:12
Good points man! Haha for now i am aiming towards the Windows users, but i may have to change later on. I think one day i will write my own engine, and maybe make it compatible with Mac, etc... I dunno

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Interplanetary Funk
15
Years of Service
User Offline
Joined: 19th Apr 2010
Location: Ipswich, United Kingdom
Posted: 19th Feb 2011 19:41
as people have said, it depends on your target audience, if you want cross platform then OGL would be the obvious choice, but almost every platform now has its own 3D graphics api which runs faster on that device than OGL. As well as with OGL if you want to make it truly cross platform you need some good cross platform input and audio libs and even then, each operating system has its own WINDOW api, so you'd still have to put a lot of work into each platforms version anyway, windows has it's own api, mac has it's own api, linux has 3 or 4 possible different APIs.

And as people have said a lot of the tutorials on OGL are rubbish, there's a lot more on DX and MSDN is a very useful tool.
Personally I'd recommend sticking to windows as it is the dominant ecosystem for gamers and there are some great tutorials out there, such as www.directxtutorial.com
the first few lessons are free and give you a good understanding of how directx programming works.

Get on my level
Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 20th Feb 2011 17:19
Thank you, i have made up my mind, i will be sticking to Windows Thanks!

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 20th Feb 2011 21:49 Edited at: 20th Feb 2011 21:51
Quote: "but almost every platform now has its own 3D graphics api which runs faster on that device than OGL"


Every platform except Windows uses OGL as its sole 3D graphics API

Quote: "Mac supports OpenGL up to 2.1"


Snow Leopard (10.6.3+) supports OpenGL 3.0 and has done for about 12 months

09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0
Diggsey
19
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 21st Feb 2011 01:24 Edited at: 21st Feb 2011 01:26
Quote: "Every platform except Windows uses OGL as its sole 3D graphics API"


That's rubbish.
Almost every platform has its own graphics API, OpenGL is just a layer above that which they share, and even then it's usually OpenGL ES rather than plain OpenGL.

- PS 3 has it's own low level proprietry graphics API for its RSX GPU
- XBox 360 uses a customised version of Direct3D 9, although there may be a lower level API I don't know about?
- Most mobile phones have their own proprietry APIs, only some have an OpenGL ES implementation on top.

[b]
Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 21st Feb 2011 04:09
I agree with Diggsey

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 21st Feb 2011 19:03 Edited at: 21st Feb 2011 19:06
Quote: "That's rubbish.
Almost every platform has its own graphics API, OpenGL is just a layer above that which they share, and even then it's usually OpenGL ES rather than plain OpenGL.
"


An abstraction layer atop of GL does not mean it's using a different graphics API. It's still using GL.

Also, read the end of what I was replying to:
Quote: "which runs faster on that device than OGL."


^ implies that it'll be a graphics API completely distinct from GL (which simply isn't true - sure, platforms have UI libs to support GL etc. or extra libraries but they certainly don't supplant or replace GL, let alone run faster!)


Quote: "
- PS 3 has it's own low level proprietry graphics API for its RSX GPU
"


PSGL is just a layer on GL. libgcm is distinct, I'll give you that, but PSGL apparently pipes its work through libgcm (so I'm guessing libgcm is the very very low-level hardware control of some form)

Quote: "
- XBox 360 uses a customised version of Direct3D 9, although there may be a lower level API I don't know about?
"


The 360 uses a weird mutilation of Windows, and hence this is equivalent to what I already said (It's DX / D3D in some form)

Quote: "
- Most mobile phones have their own proprietry APIs, only some have an OpenGL ES implementation on top.
"


Which is just a layer on GL

09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0
Diggsey
19
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 21st Feb 2011 20:00 Edited at: 21st Feb 2011 20:00
Please read my post

Quote: "Which is just a layer on GL"


That's exactly my point, GL is a layer on top of other APIs, not the other way around. GL is the abstraction layer, the proprietry APIs actually do the work.

[b]
Math89
21
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 21st Feb 2011 20:45
OpenGL can't run slower or faster than another API for the simple reason that it's just a specification, not an implementation. If you believe that your OpenGL is slower than Direct3D, then maybe it's about time to update your drivers.
Also, arguing about their performances is pointless as using one API or another implies that you use different ways of coding. Simple example: in OpenGL, geometry instancing is apparently almost useless because the normal drawing operation is much faster than its Direct3D counterpart (can't remember why). Does it really mean that OpenGL is better than Direct3D? Certainly not since they would be just as efficient if your framework handles this properly.
AutoBot
15
Years of Service
User Offline
Joined: 25th Sep 2009
Location: Everywhere
Posted: 21st Feb 2011 20:53
I agree with Math89


David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 21st Feb 2011 21:18 Edited at: 21st Feb 2011 21:21
Quote: "That's exactly my point, GL is a layer on top of other APIs, not the other way around. GL is the abstraction layer, the proprietry APIs actually do the work."


This is being extremely pedantic though: Yes, OGL abstracts things away from the device in use, and of course there are API calls lower down that do the real work - but this is not at all what the post I was replying to was trying to say (especially since a majority of the APIs that each platform uses to implement GL will not be accessible willy-nilly to user space applications. The PS3 seems to be the exception in this regard, but I have never ever seen any user space application directly address an OS or card-specific API to talk directly to the GPU, unless we include Glide)

09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0
Dark Java Dude 64
Community Leader
14
Years of Service
User Offline
Joined: 21st Sep 2010
Location: Neither here nor there nor anywhere
Posted: 21st Feb 2011 22:06
zkjcxhvfkjbh! So then if everything is just a layer over the API, then what API is doing all of the graphics stuff?
Quote: "That's exactly my point, GL is a layer on top of other APIs, not the other way around. GL is the abstraction layer, the proprietry APIs actually do the work."


Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
Interplanetary Funk
15
Years of Service
User Offline
Joined: 19th Apr 2010
Location: Ipswich, United Kingdom
Posted: 21st Feb 2011 22:15
I think the best thing to do would be pick a platform and then go with which ever GL has the most documentation as each platform will really need its own code at a fairly low level in a lot of places anyway, unless you go with a language such as java which has an interpreter for almost every platform.

Get on my level

Login to post a reply

Server time is: 2025-05-22 06:08:59
Your offset time is: 2025-05-22 06:08:59