Direct3d Or Opengl

SidSid Corwid of the Free Join Date: 2003-01-28 Member: 12903Members, Constellation
<div class="IPBDescription">Never really did understand...</div> Hello -

I'm a bit confused.

Ever since I started gaming, I noticed Half-Life looked a lot better in OpenGL - so that is what I stuck with for the rest of my days.
But now, reading the features of DirectX 9.0b, I have a few questions:

What is the difference between Direct3D, and Open GL?
Which one is better?
And, finally, does DirectX apply to both?


And to top it off... you might aswell explain "T&L, Glide, 3Dfx..." -Those are all old, right?
I find this sad - I have been gaming, and upgrading, for most of my life - and yet I do not know what makes these games look the way they do.

Thanks for your time,
-Sid

Comments

  • GlissGliss Join Date: 2003-03-23 Member: 14800Members, Constellation, NS2 Map Tester
    I, myself, do not notice the difference. Same thing for no vsync. Along with having a super-high resolution and low hertz (is that what they are called?). I think my eyes need some working-on.
  • [WHO]Them[WHO]Them You can call me Dave Join Date: 2002-12-11 Member: 10593Members, Constellation
    they are essentially the same at their core. A way to draw triangles at an intensly fast rate.

    But they implement their methods in different ways. So nomatter how hard you try you'll always get slightly different results from one than you'll get from the other for various speed/quality reasons.

    Sort of like when you run an irc program written in java vs one that was written in C, they do the same thing but flow/work in a vastly different way.

    So in short, I think opengl has the upperhand mainly because it's being developed by a committee/board/whatever as opposed to direct3d which is only being developed by microsoft.


    That and I'm pretty sure that opengl has supported 3d for a longer period of time than directx has
  • Dr_ShaggyDr_Shaggy Join Date: 2002-09-26 Member: 1340Members, Constellation
    edited November 2003
    Actually, directx has the upper hand now. The people overseeing openGL bicker too much on specific issues and are slow to upgrade relative to dx. Thats why Doom III and Half Life 2 both use DX9 techniques for shading/lighting and those other fancy new 3d tricks that openGL has yet to set a standard for.

    I'm learning openGL now at school, it basically fits right into my c++ code to manage all the 3d stuff that i want to display. So the c++ stuff manages the logic behind the display which is handled with openGL calls.

    Very simply I can display a triangle with this bit of code (probably doesn't work on its own, theres a bunch of other code needed to show a window):

    glBegin( GL_POLYGON );
    glVertex3f( -1.0, 0.0, 0.0 ); // this defines a vertex at the given x, y, z coordinates.
    glVertex3f( 0.0, 1.0, 0.0 );
    glVertex3f( 1.0, 0.0, 0.0 );
    glEnd();

    using some variables/conditionals I can do stuff with that triangle, say change the size if you click on it (this is a <i>very</i> oversimplified example, again it doesnt really work on its own):

    if( mousePressed )
    {
    size = 2.0;
    }
    else
    {
    size = 1.0;
    }
    glBegin( GL_POLYGON );
    glVertex3f( -1.0 * size, 0.0, 0.0 );
    glVertex3f( 0.0, size, 0.0 );
    glVertex3f( size, 0.0, 0.0 );
    glEnd();

    So that cheesy example would double the size of the triangle when the mouse was pressed.
    OpenGL programming (or any 3d graphics programming) gets very complicated very fast, thats why I have huge respect for guys like Max (who codes for Flayra and is a graphics programmer i hear).

    I imagine that directx has similar calls to openGL and you could perform my dumb examples in a similar manner using it.

    T&L stands for Transforming and Lighting I believe and mostly applies to changing the position/size and lighting properties of 3d objects, also used to describe the ability of a 3d card to do this automatically in hardware (and therefor very quickly).

    I'm not sure now, but I believe Glide was a 3d standard that was used by 3Dfx, and 3Dfx was a company similar to nVidia or ATi, who were eventually bought out by nVidia.

    Hope that helps.
  • SkulkBaitSkulkBait Join Date: 2003-02-11 Member: 13423Members
    edited November 2003
    DirectX - Suite of APIs (Application Interfaces) for game and multimedia programs. Microsoft Proprietary.
    Direct3D - 3D rendering API, part of DirectX. Microsoft Proprietary.
    OpenGL - 3D rendering API. Open Standard, controlled by the OpenGL ARB.
    Glide - 3D rendering API with similarities to OpenGL. 3DFX proprietary. *Only worked on 3DFX cards*

    T&L, as mentioned above, is an acronym for Textures & Lighting.

    As for which one is better, well, that depends on what you want. If you are Microsoft's **** and/or need the absolute bleeding edge of accelerated graphics then D3D is 'better'. If you wan't a (IMHO) cleaner and easier API, that is industry standard, and is cross platform, but don't need support for the buzzword 3D effect of the week, then go with OpenGL.

    Or from the user perspective: Whichever one looks prettier.
  • redeemed_darknessredeemed_darkness Join Date: 2003-01-21 Member: 12565Members
    Open GL can be used on non Microsoft OS (ie Linux)

    Direct X you have to have windows to use it
  • DOOManiacDOOManiac Worst. Critic. Ever. Join Date: 2002-04-17 Member: 462Members, NS1 Playtester
    Most everything about the issue has already been covered by other peeps, but I got a little bit more to add:

    While in the earlier days of low res textures and models (including Half-Life, which remember is 5 years old), OpenGL had a bit of 'blurring' to it and that's what made it look so much sexier. But now that textures are high res and and we have bump mapping and shaders and all these other special things, DirectX now looks really good too. If I have a choice, I still go w/ OpenGL though as it tends to be quite a bit faster than D3D at rendering and still looks a little bit better.

    At the risk of being called an MS lover, due to Direct3D there have been numerous standardizations in areas where before the implementation of something would be different on a per card level, but now everything is much more standardized (which helps devs make stuff faster and also makes stuff more reliable, meaning we get a more solid product). I still think more dev's should go w/ OpenGL though since its multiplatform though.

    Some people think that OpenGL will be completely dead and unused very soon, but I don't think that's gonna happen as long as John Carmack has blood pumping through his body. :P
  • enf0rcerenf0rcer intrigued... Join Date: 2003-03-16 Member: 14584Members
    <!--QuoteBegin--DOOManiac+Nov 25 2003, 09:52 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (DOOManiac @ Nov 25 2003, 09:52 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> as long as John Carmack has blood pumping through his body. <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif'><!--endemo--> <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
    *giggles* /me runs of screeching loudly
  • Dr_ShaggyDr_Shaggy Join Date: 2002-09-26 Member: 1340Members, Constellation
    edited November 2003
    Yeah, I find it strange that an open format evolves so much slower than a closed one. I've found that for the most part, open projects (like say, Mozilla and its children) move <i>much</i> faster than their closed counterparts (IE) due to constant revision and submission of code from the community. If I'm not mistaken, openGL is pretty far behind DX. I suppose thats the problem with a committee ruling its progress. Too much beaurocracy and nothing gets done.

    Hey, is Carmack doing Doom III in openGL? If so, he's insane! Well thats not true, he'll probably end up defining most of the functions for openGL 2.0.
  • [WHO]Them[WHO]Them You can call me Dave Join Date: 2002-12-11 Member: 10593Members, Constellation
    <!--QuoteBegin--Dr_Shaggy+Nov 25 2003, 06:11 PM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Dr_Shaggy @ Nov 25 2003, 06:11 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> OpenGL programming (or any 3d graphics programming) gets very complicated very fast. <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
    amen to that.

    It took me the better part of a year to create a fully fledged Direct3D based rendering engine/wrapper. But now my team's games get 3d models, meshes, and lights on the screen in a snap <!--emo&:p--><img src='http://www.unknownworlds.com/forums/html/emoticons/tounge.gif' border='0' style='vertical-align:middle' alt='tounge.gif'><!--endemo-->
  • DOOManiacDOOManiac Worst. Critic. Ever. Join Date: 2002-04-17 Member: 462Members, NS1 Playtester
    DOOM 3 is indeed OpenGL, otherwise it wouldn't be ported to Linux now would it? :P

    And Carmack is on both the DirectX and OpenGL design boards, as well as several boards for graphics card manufactors. He's very much responsible for a lot of the good things (especially standardizations, which are part of his little soap box) that happen w/ graphics advancements.
  • SkulkBaitSkulkBait Join Date: 2003-02-11 Member: 13423Members
    With any luck cards will start supporting OpenGL 2.0 sometime... well, sometime. For those who don't know OpenGL 2.0 will make OpenGL easier (it removes the nessesity for most extentions, amoung other things), and will add pretty much every feature its currently lacking. Unfortunatly the only company on the ARB thats really pushing for it is 3DLabs (IIRC).
  • JammerJammer Join Date: 2002-06-03 Member: 728Members, Constellation
    I find it rather ironic that MS is on the OpenGL board.

    As for a bit of Direct X history:
    Direct X 1 came out around 95-96. It was more or less a sprite display set. It was so bad MS more or denied its exsistence. DX slowly advanced, it was actually usable by Dx 4 or so. It really took off with verison 5, and by version 6 it was a common standard.
  • SoulSkorpionSoulSkorpion Join Date: 2002-04-12 Member: 423Members
    Also, OpenGL is a damn sight easier to work with than D3D. It's also C, whereas D3D is COM (I think). Not that is the slightest bit helpful <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html/emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif'><!--endemo-->.

    It might be worth noting that Direct X is likely to be a bit shinier than OpenGL under Windows because MS have a habit of doing a crappy job of implementing others' standards. Yes, I know they don't do a great job of implementing their <i>own</i> stuff, but even moreso the competition.

    There's also the fact that OpenGL's development is stagnating somewhat, whereas MS are going to great pains to advance Direct X. As far as I understand, OpenGL made some very smart moves early on in the game, and Direct X made some bad ones. So OpenGL was ahead of its time. Unfortunately that time has arrived, so it's starting to slip a bit.
  • Soylent_greenSoylent_green Join Date: 2002-12-20 Member: 11220Members, Reinforced - Shadow
    Half-life was made with an Open-GL based engine(quake 2) and I think Valve themselves implemented the direct 3d mode as I'm pretty sure quake 2 doesn't support direct 3d(unless it was implemented but never used and was not 'exposed' to the user so you could switch it on but that seems kind of pointless).

    This was back when direct x was at version 5 or 6 or something, direct x is backwards compatible so this is still what HL uses when you try to play with direct x, hence any new cool features(or optimizations) in more recent versions of direct x are not useable in Half-life unless VALVe does some very significant reworking of the engine.
  • ParasiteParasite Join Date: 2002-04-13 Member: 431Members
    iirc OpenGL never created a standard for developing and implementing Pixel Shaders, even though that was clearly the next trend, so they kinda got pushed aside.
  • Soylent_greenSoylent_green Join Date: 2002-12-20 Member: 11220Members, Reinforced - Shadow
    <!--QuoteBegin--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> </td></tr><tr><td id='QUOTE'><!--QuoteEBegin-->It might be worth noting that Direct X is likely to be a bit shinier than OpenGL under Windows because MS have a habit of doing a crappy job of implementing others' standards<!--QuoteEnd--></td></tr></table><span class='postcolor'><!--QuoteEEnd-->

    Yeah, just look how windows xp/2000/NT tries to switch to 60 Hz in openGL and used to switch to 75 Hz in direct3d. They fixed the problem for direct 3D, it now tries to default to your desktop refresh rate, if it does not appear to be available it goes to 75 Hz. The 60 Hz refresh rate in openGL bug is still there allthough some graphics card drivers seem to be able to fix the problem(allthough they shouldn't have to).
  • SidSid Corwid of the Free Join Date: 2003-01-28 Member: 12903Members, Constellation
    Thanks guys - this helps a lot! <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html/emoticons/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif'><!--endemo-->
  • RobRob Unknown Enemy Join Date: 2002-01-24 Member: 25Members, NS1 Playtester
    To reiterated something doom said. DirectX was one of the best things to happen for game programmers. As he said, before you had to write your program for all hardware instances (the game would contain code specific to ATI, nVidia, Voodoo (hypothetically), etc). Now you can just use this nice set of APIs.

    But while DX is COM base, OpenGL is made to fit smoothly into C++ code.
  • DOOManiacDOOManiac Worst. Critic. Ever. Join Date: 2002-04-17 Member: 462Members, NS1 Playtester
    <!--QuoteBegin--Soylent green+Nov 26 2003, 09:20 AM--></span><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Soylent green @ Nov 26 2003, 09:20 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Half-life was made with an Open-GL based engine(quake 2) and I think Valve themselves implemented the direct 3d mode as I'm pretty sure quake 2 doesn't support direct 3d(unless it was implemented but never used and was not 'exposed' to the user so you could switch it on but that seems kind of pointless).

    This was back when direct x was at version 5 or 6 or something, direct x is backwards compatible so this is still what HL uses when you try to play with direct x, hence any new cool features(or optimizations) in more recent versions of direct x are not useable in Half-life unless VALVe does some very significant reworking of the engine. <!--QuoteEnd--> </td></tr></table><span class='postcolor'> <!--QuoteEEnd-->
    Correct.

    Although i think HL was actually DX3 or 4... I know it wasn't 5, as 5 is much newer than HL...
Sign In or Register to comment.