• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

opengl or direct 3d what is best

Status
Not open for further replies.

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Direct3D 12 on Windows 10 running fully compliant hardware is the best for performance. Especially on AMD cards it was heavily optimized and designed around the hardware allowing kinds of graphics previously not possible due to driver overhead. It can even take advantage of NVidia and AMD cards at the same time as was demonstrated in a benchmark for extreme performance. Reality is that few games will perform that well.

OpenGL is best for general purpose use. Not only are you guaranteed that Windows, Linux and Mac will support it but you also have drivers to back that up with decades of performance optimizations. For simple Graphics OpenGL gives you very high performance thanks to commercially aimed optimizations (aimed at CAD and modelling programs) possibly better than Direct3D. Due to its parallel development it also allows you to perform some obscure tasks far more efficiently than possible with Direct3D (example being Mario Kart Wii simulated HDR filters which were unsupported by Direct3D emulators).

Ultimately both share a lot in common. Both use programmable shaders with both sharing a very similar programmable shader language. Both are aimed at providing an efficient API for accessing hardware resources. Both are capable of similar quality graphics supporting most features offered by hardware.

Direct3D has the disadvantage of it being only for Windows. This means that it will not work out of the box on any other operating system. This means that it sees very little use in commercial industry, especially since it came after OpenGL. It also means that some features are less optimized as the developers probably invest less resources optimizing them.

OpenGL has the problem that because of its wide spread use it evolves very slowly. It also performs worse for many high performance applications due to the compatibility requirements favouring accurate results instead of high performance. Support is also optional on many operating systems meaning that old implementations might exist as a result of out dated drivers or poor support.

Generally I would advise developing with OpenGL unless you are only targeting Windows in which case Direct3D is the best choice. If your program is written properly it should be easy to implement both with a little bit more work as although they are different, they are also similar in many ways as ultimately they expose the same resources to you.
 
Level 21
Joined
Mar 2, 2010
Messages
3,069
opengl is used in a lot of first person shooters. the doom series and the quake series both uses opengl. opengl works better on older monitors than direct 3d do. when i upgraded my graphics card no direct 3d games worked on the old monitor, only opengl games did. one thing i have noticed is that many games with first person mode runs in opengl. warcraft 3 supports both APIs though. first person shooters need to be rather accurate. (blood 2 used direct 3d and failed there.) according to a person i know that is a programmer, opengl is more work than direct 3d.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
opengl works better on older monitors than direct 3d do.
That makes no sense since neither deal with monitors directly.

when i upgraded my graphics card no direct 3d games worked on the old monitor, only opengl games did.
Sounds like a GPU driver bug, or the Direct3D mode was set to output at an unsupported resolution.

first person shooters need to be rather accurate.
No they do not. They need good performance as frame rate is more important.

(blood 2 used direct 3d and failed there.)
Explain?
 
Level 21
Joined
Mar 2, 2010
Messages
3,069
i changed monitor and direct 3d games worked perfectly. i had no trouble running quake 4 with everything maxed out on the old monitor. direct 3d games did not work on the old monitor. first person shooters need to be accurate because certain switches ub the games require it.(aiming also requires it as an unaccurate shooter is the differense between hitting or missing.) blood 2 have terrible scrolling that is everything but accurate.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
first person shooters need to be accurate because certain switches ub the games require it.(aiming also requires it as an unaccurate shooter is the differense between hitting or missing.) blood 2 have terrible scrolling that is everything but accurate.
What does this have to do with either OpenGL or Direct3D? Neither are involved in camera rotation or aiming, with the CPU doing all that.
 
Level 21
Joined
Mar 2, 2010
Messages
3,069
talk about a lot of off-topic stuff. time to get back on topic. opengl have the advantage of running on older monitors and does first person shooters better because it is more precise than direct 3d though it takes longer to program in it. it also works on more systems. direct 3d on the other hand can run in the background without issues. (opengl in many cases takes up the entire desktop.)
 
Level 21
Joined
Mar 2, 2010
Messages
3,069
trolling is the act of trying to make people angry. posting information a second time is not trolling. the quake series and the doom series both used opengl. the first quake used a separate executable for opengl in addition to the one for windows software rendering and the one for dos. quake 2 added opengl as a menu option but is by default running in software rendering. quake 3 and quake 4 used only opengl.(quake 4 was based on the doom 3 engine.)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
opengl have the advantage of running on older monitors
OpenGL has nothing to do with monitor support. The graphic drivers, which implement OpenGL and Direct3D, control that. As such if Direct3D does not support a monitor which OpenGL does then it is a driver bug. Additionally it can be a software bug whereby the developers have inconsistent behaviour between OpenGL and Direct3D.

does first person shooters better because it is more precise than direct 3d though it takes longer to program in it.
Both Direct3D and OpenGL allow for customization of shader precision. As such they are both equally precise. For example they both support 32 and 64 bit long floats. Actual precision comes down to the underlying hardware and its drivers as floats may be computed more or less accurately depending on if speed or precision are favoured. As far as OpenGL and Direct3D specify (which is not really much) they should be equally precise and one would imagine drivers implement their operations with the same precision. Any variance between results of an OpenGL and Direct3D implementation are either driver bugs (functionally identical shaders producing different results) or as a software bug (shaders are not functionally identical).

direct 3d on the other hand can run in the background without issues. (opengl in many cases takes up the entire desktop.)
This is just badly programmed software. Both OpenGL and Direct3D can lock a display as an output device. When a process is sent a minimize command it should free any lock over a display device. This is why if a OpenGL or Direct3D process becomes unresponsive you cannot minimize it from the screen until Windows forcefully shuts it down (and frees all locks it owns).

the quake series and the doom series both used opengl. the first quake used a separate executable for opengl in addition to the one for windows software rendering and the one for dos. quake 2 added opengl as a menu option but is by default running in software rendering. quake 3 and quake 4 used only opengl.(quake 4 was based on the doom 3 engine.)
Around the time of quake OpenGL was the go to graphics API to use which is why they choose it. Direct3D came slightly later and was not so cutting edge or portable. More modern iterations of the engine must support OpenGL so it can be ported to platforms like PS4, Wii U, Mac, Linux, Steam, Android etc. Only Microsoft products support Direct3D, which greatly limits markets seeing how most games are not played on Microsoft products.
 
Status
Not open for further replies.
Top