Should I go with directX or openGL

Started by
22 comments, last by mike4 11 years, 9 months ago

WIndows RT has full DirectX11 support, but only requires a 9_1 feature set... just to confuse. (I believe that's how Microsoft describes it). Unfortuantely, the only platform which runs both D3D and OpenGL are Windows PCs.

I'm amazed NV and AMD haven't got together to create a new, truly portable, API. It would life a gazzilion times easier for developers on non-console hardware. Even Windows RT could run it (although it would seriously piss off Microsoft!) if it were totally driver based.

AMD and Nvidia will never put there heads together to create a new API, just look at Close to Metal and Cuda, even OpenCL hasn't replaced Cuda or DirectCompute yet.
The DX 11 run time is actually pretty nifty when you think about it these feature levels make it a lot easier for people to develop on windows tbh. As long as you are running Vista or up DX 11 can now target very old DX9.0 hardware up to the newest DX11.1 hardware all from one API, there are a few features you shouldn't use but is easy to code arround.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

Advertisement
My post was more of a wishlist (or dreamlist) than a serious proposal. But a single API to target every device from desktop to phone would be rather handy..!
A single API would be nice, but in reality it's not really that big a deal. So long as the C/C++ code surrounding the API calls can be the same (or mostly the same) then the API itself tends to disappear into the background, and this is increasingly the case with modern versions of both.

A hypothetical example might be some code to add a bunch of particles to a dynamic vertex buffer and draw them when done. With D3D it's just some IASet* calls, Map, Unmap, set your shaders and Draw*. With OpenGL it's a glBindVertexArray, Map, Unmap, set your shaders and glDraw*. The big part of the code is actually setting up the particle verts and copying them in.

The bigger difference will be with shaders. Cg does exist so you can use that and compile it for either GL or D3D, but some might prefer to use the native shading language instead. But at least there is an option that can be used with both.

As for NV and AMD getting together to create one API to rule them all - I highly doubt it. The situation with OpenGL is highly relevant here - NV have created a whole bunch of extensions that only work with their hardware and drivers, ditto AMD, and each would prefer if you gave their platform a competitive advantage over the other in your program.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

Have a look at OGRE's source. It compiles for OpenGL3 and DX11.

This topic is closed to new replies.

Advertisement