views:

3025

answers:

8

The standard model has been that OpenGL is for professional apps (CAD) and Direct3D is for games.

With the debacle of openGL 3.0, is openGl still the natural choice for technical 3D apps (cad/GIS)?
Are there scenegraph libraries for Direct3D?

(Of course Direct3D is windows only.)

+2  A: 

Direct3D is only available on Windows and XBox. If you plan on targeting Unix or Mac, in addition to Windows, OpenGL is a good choice.

jwfearn
Or equally importantly, if you eventually decide to target Unix and Mac you should choose OpenGL to minimize conversions needed to support them.
Guvante
@Guvante: Sorry but no. Minimizing conversions is not the point at all in this business. It's all about reliability of graphics drivers / time you spend on dealing with their issues.
Stringer Bell
+16  A: 

Like always, this depends on your situation.

In my experience, currently (2008) OpenGL driver quality on Windows is much worse than Direct3D driver quality. If your situation is such that you can't reasonably demand your customers to always have up-to-date drivers, or tell them to change their graphics cards to the ones that have better OpenGL drivers, then OpenGL is a pretty bad choice. In this case, I'd go for D3D renderer on Windows, and OpenGL renderer on OS X/Linux (if you have to support those platforms, that is).

Having two renderers is not that hard; in my experience working around driver bugs takes much more time than writing and supporting the rendering code paths.

Of course, there are some (specific) situations where D3D just does not have the features needed, e.g. quad-buffered genlocked output; or geometry shader support on Windows XP.

So in short: if you want better drivers on Windows, use D3D. If you don't care about driver quality much, or need features that are in OpenGL but not in D3D, then use OpenGL.

NeARAZ
How do you rate driver quality? Any examples?
Jon Cage
@Jon: One data point: have your product be used by millions of people. Compare number of crash submissions that crash in the driver DLLs when using GL vs D3D. Another data point: write workarounds for known broken driver features. Compare number of workarounds needed on GL vs. D3D.
NeARAZ
@Jon: D3D has a reference device, GL hasn't. Reference device allow you to check if issues you have are on application or on IHV side. This is a huge benefit since you can detect issues earlier in the process.
Stringer Bell
+2  A: 

Not an answer as such but is interesting to note the latest versions of AutoCAD give you a choice between using OpenGL or Direct3D drivers in the "3dconfig" setup option. Fundamentally, AutoCAD is a Windows-only app so it made sense for them to (finally) support Direct3D. See page 15 of this Whitepaper from AutoDesk for more info.

CAD bloke
Interesting article, especially where it claims that OpenGL compatible cards start at $500 - I suspect it was written by an ad dept in Redmond.
Martin Beckett
They probably mean "workstation certified" OGL cards, as those tend to be much more expensive.
Donnie
+10  A: 

Perhaps you should try an abstraction layer such as OGRE, which lets you switch between DirectX and OpenGL without having to rewrite anything? It also adds a lot of functionality, and isn't game-oriented, but pretty generic.

Samir Talwar
+3  A: 

This doesn't directly answer your question (sorry), but I was one of the original guys working on Direct3D and hehe:

Are there scenegraph libraries for Direct3D?

Direct3D (nee Reality Lab) used to just be a scenegraph library :-)

Shame that Direct3D Retained Mode isn't shipped anymore...

Steve Lacey
I could never understand why retained mode was dropped. It seemed like such a good thing.
Guge
+22  A: 

D3D makes you pay the Microsoft "strategy tax." That is, D3D serves two masters. One is giving you features and performance. The other is to ensure lock-in to other MS products and the Windows platform generally. This has some consequences for you:

  1. A D3D app won't run on anything but Windows (including Xbox). Maybe you don't think that's important now. But if, down the road, you want to run on Mac, Linux, PS3, future consoles, etc., you may be glad you chose the platform-independent choice.

  2. MS can make some arbitrary decisions. Will the next version of D3D only run on an OS that requires new hardware, is expensive, and lots of people don't want to upgrade to? Will they make some other future decision you don't agree with?

  3. Historically, OpenGL has led D3D in quick exposure of new HW features. This is because there's a mechanism in the standard for vendors to add their own extensions, and for those extensions to eventually be folded into the main spec. D3D is whatever MS wants it to be, with input from vendors to be sure, but MS gets veto power. You could easily be in a situation like with Vista, where MS decided not to expose new HW features to the old DX, and only make the new DX available on Vista. This was quite a headache for game developers.

Now then, this is the flavor of reasons why a "professional app" (CAD, animation, scientific visualization, GIS, etc.) would favor OGL -- apps like this want to be stable for many years, need ongoing maintenance and improvement, and want to run on many platforms. This is in contrast to games, which quite frequently are only on one platform, will be released but generally not "maintained" (there likely won't be a 2.0, an update for another OS three years hence, don't need to support older HW, etc.). Games want maximum performance and only need to work for a short time window and on a fixed number of platforms. If they need to target Windows anyway and D3D is a little faster, that may be the right choice since the negative D3D consequences won't hurt them like it would for a CAD app, say.

Larry Gritz
Actually, OpenGL is not that cross platform as people tend to believe. PS3 (or any other current console)? No. Future consoles? Most likely no. Phones/handhelds? Not really (OpenGL ES is there). That leaves "PC-like platforms" only.
NeARAZ
I thought D3D would only work on Windows platforms?
Jon Cage
Actually, one article [ http://is.gd/nbHm ] says:"The 3D computer graphics API software used in the Playstation 3 is LibGCM and PSGL, based on OpenGL ES"I believe the new Android platform uses OpenGL ES as well, so if anything surely D3D is less portable?
Jon Cage
You can run D3D on Linux and MacOS X with Wine (or derivatives, such as Cedega).
Filip Navara
Counter example: 3ds max is a "professional CAD app" such as those you mention, that runs exclusively on Windows since its inception and uses D3D almost exclusively. (The OGL viewport renderer hasn't been touched for a long time).
Alex
+1  A: 

The answer everyone wants to believe is YES but the real answer is, it depends.

About 50% of all hardware out there will not run OpenGL to any reasonable level. To see an example of this read the FAQ for Google Sketchup which uses OpenGL

SketchUp's performance relies heavily the graphics card driver and it's ability to support OpenGL 1.5 or higher. Historically, people have seen problems with ATI Radeon cards and Intel based cards with SketchUp. We don't recommend using these graphics cards with SketchUp at this time. (Hardware ans software requirements for Google Sketchup

So, If you're writing a CAD app and you don't mind telling your customers, "you must have an OpenGL complient video card" then the answer is yes.

If instead you are creating an end-user app (Google Earth for example) then the sad answer is you'll have to write both a D3D and GL version of your app if you want to reach the entire market.

gman
Yes I have had problems with ATi cards and we recommend Nvidia to customers where possible. Intel embedded video chipsets are getting better, they lack performance but don't have such terrible driver bugs.Unfortunately it's not simply writing both output renderers, it's the whole scenegraph architectures which have grown up around openGL. On the good side - the iPhone/smart phones have been a big boost for openGL - if you can live with the limits of openGL-ES.
Martin Beckett
+2  A: 

To me, speaking as a graphics programmer in a large CAD company, there are currently three things that retain OpenGL of beeing dropped in favor of Direct3D (10/11) for existing CAD/DCC applications:

  1. Legacy. Most of CAD softwares are more or less hardly tight to OpenGL concepts. Rewriting everything around D3D philosophy is not always manageable (technicaly speaking and depending on the ability/willingness of the company to throw resources at it).

    Secondly it could have negative impacts if something goes wrong (functionnality speaking and/or performance wise) and company would just not take the risk of delaying a major release because of an API and architecture switch.

  2. Peoples. Peoples in those old-boy industries are fairly conservative. They prefer spending money/time on dealing with IHVs regarding all OpenGL driver issues they could have or simply won't recommend using graphics from a specific IHV (e.g. Intel or ATI).

    Plus, I believe that the automotive/aerospace industry customers like Boeing, Airbus, TMC, BMW, etc don't care that much of having Quadros only workstation. Hardware is still cheap in regard to software licence prices.

  3. Future trends. With future generation of processors like Llano, Larrabee, Fermi and products that will follow, it's definitely worth to invest R&D budgets on how to program and develop new languages / apis / frameworks for those future hardwares (in term of graphics as well as non-graphics tasks).

    CAD industry has huge cycles and won't move if not for a truly disruptive technology. So D3D might just come a bit late for big CAD players (except Autodesk of course which is a particular case).

Stringer Bell
That was pretty much my thoughts, the decider was scenegraphs for OpenGL - there is nothing much available for DX
Martin Beckett