Jump to content
  • Advertisement
Sign in to follow this  
Nairou

OpenGL API comparison: Direct3D and OpenGL

This topic is 4984 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Do there exist any detailed comparisons of D3D and OGL, from a game programmer's perspective? I know very little about OpenGL other than what I pick up here, having mostly stuck with Direct3D for my development, but I'm now interested in designing my engine to be portable across both APIs (i.e. via a generalized API with D3D and OGL DLLs). There have been many occasions when designing the internal API that I didn't know if a particular feature or method was used by OpenGL. I've heard its easier to make the OpenGL API act like Direct3D than the other way around, but I still don't want to build it up and later find it to be totally unacceptable for the way OpenGL functions. Ignoring the fact that some believe this portable-API to be a waste of time, are there any comparisons or references from people who have already dealt with these problems, without having to fully learn OpenGL for myself before I continue? Perhaps tips that any of you have, having dealt with both?

Share this post


Link to post
Share on other sites
Advertisement
OpenGL is a breeze to learn. With that said, so is BrainFuck, but it's not something that one wants to apply;)

OpenGL is much more intuitive, but also more tedious (these are opinions, much like assholes), repetitive, etc.

I hadn't done anything in OGL for ~1.5yrs, picked up Beginning Game Programming with OpenGL(something like that) and picked it all up in a heartbeat (so far that I've read, anyway).

Learning OGL isn't that hard. To me, it's harder to learn the concepts than the API, APIs are created around the concepts anyhow.

Share this post


Link to post
Share on other sites
If you use render-to-texture or switchable render targets/depth buffers, you're in for some rough water, because the pbuffer and render-to-texture capabilities of OpenGL are not at all as nice as in D3D.

All resources (vertex buffers, textures, etc) behave as if they were MANAGED in OpenGL, no need to keep backup copies yourself (unless you need them for other reasons).

OpenGL has the awesome QUADS primitive, which is great for particles or easy heightfields; D3D does not. However, OpenGL point sprite support is spotty, and only available on the latest cards, at best.

If you use .fx files, there's nothing quite as comprehensive on OpenGL. However, the GL shading language, GLSL, is at least as nice as, if not nicer than, HLSL.

There is only a combined MODELVIEW matrix in GL, as opposed to the WORLD and VIEW matrices in D3D. You have to concatenate these yourself. Typically, that's what you want, anyway. Or you can write it up in a shader instead.

GL is right-handed (Z goes out of the screen) and uses counter-clockwise front facing rules by default; D3D is left-handed and uses clockwise. These can be changed if you want.

GL support for reading the depth buffer is better than D3D; similarly, GL support for depth textures (for shadow maps) is better than most D3D cards/drivers.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!