Archived

This topic is now archived and is closed to further replies.

Dont flame me!

This topic is 5572 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

Ok, no matter how much I say I''m not trying to start a flame war I''m afriad I''m about to. I have been using DirectX for some time now and think I have a pretty good grasp of 3D concepts and what is going on behind the scenes, etc. But before I delve any deeper into DX I have one question that keeps popping up. Why not OpenGL? It seems to be just as widely respected as DX, and plus its cross-platform. The only reason I''ve heard thus far is that because OpenGL is "committee driven" that it may not implement new features exposed by graphics cards as quickly as DX. So, for those of you that have used both... which do you prefer (I assume DX since this is the DX forum) and WHY? Again, this is not a pissing contest between DX and OpenGL. But if I''m going to invest a significant amount of time learning something I want to be sure it is the right technology.

Share this post


Link to post
Share on other sites
Just by the nature of even asking "which should I learn" you''re still playing with fire. Danger:highly flamable.


quote:
Why not OpenGL? It seems to be just as widely respected as DX, and plus its cross-platform.


Cross platform amongst "computer" type platforms. If you need to support Windows PC, Linux, Macintosh, SGI, with the same code then OpenGL may be a better choice than D3D.

Do be aware that much of the other code in say game applications is still platform dependent so don''t expect it to be as easy as ANSI C where you write what you want and do a simple recompile to get multiple versions. [Though things like Glut, OpenAL etc help somewhat].


quote:
The only reason I''ve heard thus far is that because OpenGL is "committee driven" that it may not implement new features exposed by graphics cards as quickly as DX


Almost.

The OpenGL ARB (Architecture Review Board) decide on features which make it into the "official", pure OpenGL. Since there are many companies involved in the ARB and many opinions, it can be slow for some features to make it into the standard. [Remember OpenGL is more of a standard than a specific thing].

However to counteract the time it takes for new features to appear, OpenGL has an extension mechanism whereby extensions can be added to the API. There are two common categories are general extensions which work across a number of pieces of hardware, but haven''t yet been authorised by the ARB and specific extensions which only work on specific chips.

Checking to see whether a graphics card supports a particular extension is a analogous to checking caps flags in D3D.

Contrary to popular misconception, D3D does have an equivilent of the ARB and it isn''t just formed of Microsoft people. New D3D features are planned and reviewed by a combination of MS, all the PC hardware manufacturers and a few representatives from the games and other industries.
One big difference though is that D3D sets out to support all the features on a particular set of hardware which the hardware people say will be released within a set timeframe. Only the subset of those features which is of most use to developers will actually make it into the API. The D3D caps checking mechanism is then used to determine which of these features is available.

The advantages of OpenGLs extensions is that features thought up after the API was defined can be added at a later date, and hardware manufacturers can expose chip specific features.
This can be a disadvantage for the same reasons! - you spend more time checking for extensions, and having manufacturer specific extensions means that those companies deliberately expose and encourage people to use features which only work on their range of chips... Extensions kind of go against the "platform independent" ideal.


Be aware that on the Windows PC, device driver quality has a big part to play in which API will work best.

PC D3D drivers go from reasonable to pretty good .
PC OpenGL drivers go from terrible to excellent .

i.e. a D3D app will run reasonably on ALL Windows PC hardware and well on some. An OpenGL app will run well on most PCs, brilliantly on some and not at all on others. [Matrox, 3Dfx and PowerVR drivers tend to have quite a bad reputation amongst many OpenGL people, 3DLabs, ATI and nVidia have a much better reputation].


quote:
But if I''m going to invest a significant amount of time learning something I want to be sure it is the right technology.


The whole point, and what the conclusions of any flame war would be is that BOTH are the "right" technology. Which is right for YOU depends entirely on YOU , YOUR tastes, and which platforms/hardware YOU want to support.

Some similar decisions people are faced with in life:

Coke or Pepsi, which is better.

Spanish or French, which is better to learn to speak [if you''re in France, then French is probably more suitable -- i.e. akin to which platforms you need to support]





--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
OpenGL SUCKZZZ!
D3D RULZZZZ!
*lol*
I was just kidding.
I have been working with DirectX for a while now but have also tried OpenGL a few times.
I do not exactly have a reason for staying with DX and not moving to OpenGL.
If you want an easy answer:
1. I do not want to learn again all the basics again (though this is a minor matter)
2. In my opinion there are more good books on DX (at least I found more )
3. The strangest reason of mine is that I have an awkward feeling when thinking of doing something complex with OpenGL.
Although this is rubbish I cannot imagine how to do complicated things with OpenGL. Perhaps because it is more simple to learn and to use than DX.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I plan to never support anything other than the Windows and the X-Box operating systems/platforms. Why?

Goto Wal-Mart, goto Electronics Boutique. What OSs do they sell software for?

I really love this work and it would tear me apart if I were forced into another field. Developing for systems where the only people who will see my work are a small target audience will not support me in my creative efforts.

"Cash is the fuel for everyone."-Carnal Forge

Share this post


Link to post
Share on other sites
Use the one thats suits your needs or the one you like. If you want to make your game etc cross platform then I would say use OGL to start with (unless you want to rewrite you engine to use DirectX).

If you learn DirectX and you find you need OGL for something then you can always learn it or vise versa.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I''m always amazed at these stupid posts. Design your game engine correctly and you won''t need to choose between the two. A good game engine will encapsulate the needed code, and provide cross platform capability without being reliant on code you have no control over such as DirectX or OpenGL. If your asking what you should learn your answer is 3d theory! Why? because if you know the theory you can use either API effectively.

Bottom line write a rendering library for directx and opengl. Add that into your game engine and unless you want to support the newest API version you''ll never have to touch DirectX or OpenGL specific code again! Q: So what should you learn? A: How to code a good game engine without having to consistantly deal with DirectX or OpenGL specific code!

Share this post


Link to post
Share on other sites
Hi

I few years ago I begun with 3d, and so I tryed D3D, OGL, and writng my own software renderer at the same time. (All with a lot of trial and error). DX just happens to work the most early. Right now I am verry happy with it, and when I look at an OpenGL program I don''t like the style with all that shitty functions, However I want to learn ogl, because dx totaly sucks in a window (non fullscreen mode) because you have te release everything, and than recreate everything when the window is resized. I''ve heard this is much easier in ogl. But for me ogl doesn''t work. Whatever I try, the ChoosePixelFormat always returns an error.

Btw I don''t think using ogl or dx makes much difference, it is only used for drawing the polygons, and they both do their job well, and a program that only renders some polygons is written in a few hours. the main hard part of writing an engine is de lighting, fysics, collision, ai etc.

Share this post


Link to post
Share on other sites
quote:
I'm always amazed at these stupid posts.


I'm always amazed at the superiority complex some people get when others dare to try and expand their knowledge by asking a question.

quote:
A good game engine will encapsulate the needed code...


Agreed. But since most of us cannot learn two APIs concurrently, either due to lack of time or money (books do cost money you know), it seems prudent to focus on the one that will benefit you the most out of the gate. Of course you always have to choose the one that is best for your project, as others here have stated. But if you don't ask what the pros and cons of each are how can you possibly make that assesment?

quote:
what you should learn your answer is 3d theory!


Again, agreed. But did I say anything that led you to believe I was not or had not already learned 3D theory? It is time to put that theory into practice and if there were any obvious reasons to favor one technology over the other I simply wanted to know them.

My thanks to those of you who actually spent the time to write a useful answer to my post. I think I'm going to stick with DX right now just because that is where I'm most comfortable. But I am using ANSI compliant code and encapsulating all DirectX specific functions in classes so that I have the option of adding OpenGL support later.

P.S. I'm not sure if the comment about not bumping was directed to me specifically or not but just in case... I didn't do it. Anything I do on the board is done under my username, not anonymously.



[edited by - l99057j on September 11, 2002 4:35:50 PM]

[edited by - l99057j on September 11, 2002 4:36:11 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It was me, I bumped it so it would be seen on the main page and maybe someone would respond to my reply. Please don''t be brash with any of these other fine gentlemen for my mistake. I understand your comment probably was directed at me, but this post is to make that clear.

Thanks...

Share this post


Link to post
Share on other sites
One thing that''s made me think is the ease of combining 2d and 3d functionality. I just wanted to add some lines to my app. The GDI is just too slow, and as far asI know I can only do very thin lines in D3D. I could do rectangles but that is silly (you can go on about it being quicker, but is the speed of drawing a few lines an issue?)
I believe that combining D3D & DDraw would be problematic at best, even if DDraw supports thick lines.
However I''m sure that OGL has support for line thickness settings - I know no OGL so how well it integrates I can''t say.
Does anyone want to comment on this issue? Please don''t say how it''s better to do rectangles in 3D because that''s so obviously just a bad solution - it works and is quick but still stupid.



Read about my game, project #1
NEW (9th September)diaries for week #5

Also I''m selling a few programming books very useful to games coders. Titles on my site.


John 3:16

Share this post


Link to post
Share on other sites
quote:
However I'm sure that OGL has support for line thickness settings - I know no OGL so how well it integrates I can't say.

Does anyone want to comment on this issue? .



Just a matter of time for D3D. (v.soon... )


quote:
Please don't say how it's better to do rectangles in 3D because that's so obviously just a bad solution - it works and is quick but still stupid


Not really. How do you think OpenGL does it when many chips don't! And how do you think the 3D chips which are purely specialised triangle renderers achieve ANY textured lines in hardware ?...

It's actually the BEST solution IMO. Try profiling across a range of 3D chips with 1 pixel thin lines versus 1 pixel thin quads/triangles. I think some of the results may surprise you!

[keep remembering that 3D chips are designed to be as efficient and cheap as possible - this also means they stay simple and specialised. Certain (many) graphics chips out there are only capable of rendering textured triangles, nothing else, no 2D, no lines etc... yet APIs expose them... how? - API emulation using tris, driver emulation using tris and hardwired on-chip primitive re-assembly into tris]


These ideas made quite an impact on some peoples way of thinking

--
Simon O'Connor
Creative Asylum Ltd
www.creative-asylum.com

[edited by - s1ca on September 11, 2002 7:17:14 PM]

Share this post


Link to post
Share on other sites
My situation is exactly the opposite than yours.
I have been using openGL for years, now I am about " to lose my faith " .
In my opinion the great advantage of openGl vs directx is its intuitive architecture , but this definitly true up to 6.0 .
I''m studying direct x 8.1 and I must admit it is rather simple even though as simple as openGl.
On the other hand the great edge of direct x is its excellent support to coders .
Using openGl you must develop everything by yourself.
In other words openGl is defintly the best choice for a beginner, who want to grasp the basic concepts of graphic programming as well as to achieve pratical results in a reasonable short time.
If you want to progress, I mean..multitexturing...skeleton animation...etc , well I don''t know which API is better...

Share this post


Link to post
Share on other sites
I tend to agree with the AP who said to focus on 3D theory, but let me expound on that a bit. If you really want to build up the skills to write cross-platform games then you don''t want to code for DX or OpenGL. Why? Because, the Playstation2, Gamecube, etc don''t use them. Nor is it gauranteed that PC''s will be completely ruled by these API''s for all of time.

So, if you want to focus on skills that you can take with you in the future then I''d suggest learning how to write your own render "engine" which completely encapsulates everything from DirectX. Write and use your own structs & functions for Vectors, Matrices, Collision, etc. Then use this in your game to do all your computations, while on the back-end you have your engine hand the final lot over to DirectX to draw. In this way, if you want to change later to use OpenGL, or move over to the Playstation, or whatever it should be much, MUCH easier to do!

Another really big upside of this, which may not seem as obvious at first, is that by coding up your own versions of these things you''ll understand more fully why and how they work. Even if you re-use or adjust bits of code that you pick up off the web, in the Gems books, etc....by implementing them yourself you will force yourself to work through them and understand how they work. This can really be a great weapon when it comes time to solve tricky problems, and can also help you to optimize your engine much more.

Oh yeah, and if you''re really not worried about any of that low-level stuff, then I''d suggest that you''d be better off spending your time learning vertex & pixel shaders rather than another API that does the same thing as the one you''re using. Afterall, you might as well aquire new skills instead of just more of the same.

....just my 2 cents

-John

Share this post


Link to post
Share on other sites
Ok granted many cards must draw lines as triangles, but it''s still pretty crappy having to do it yourself. In 2d it''s easy at least - just change x/y coords abit - but working out where the coords should go for a thick line in 3d space isn''t that easy. And Ican''t believe that all the 3d cards don''t have backwards compatibility with DDraw etc, so they can plot pixels straight to the backbuffer if they wanted to! Why cant DGraphics actually BE graphics not just D3D? 2D stuff could be drawn easily without having to write custom code - lots of people are doing 2d games in D3D with triangles when they could make it run plenty fast (and more compatibly) on DDraw 5 or whatever.



Read about my game, project #1
NEW (9th September)diaries for week #5

Also I''m selling a few programming books very useful to games coders. Titles on my site.


John 3:16

Share this post


Link to post
Share on other sites
My suggestion: Don''t learn an API, learn 3D theory.

Once you have the 3D theory down, it only takes a matter of days to pick up an API, and you start to really see how the concepts in the APIs overlap.

Share this post


Link to post
Share on other sites
quote:
Original post by d000hg
...Why cant DGraphics actually BE graphics not just D3D? 2D stuff could be drawn easily without having to write custom ...


Let''s say you are designing chips that must be made as cheaply as possible. You know that you need to implement triangle drawing in hardware. You know you have a limited number of transistors, engineers, etc. etc.

You can dedicate some of those transistors to a custom 2D blitting engine, or you can tell people to use the existing (triangle rendering) transistors in a 2D way. Doing so allows you to use the transistors for an extra texture stage or something.

You do market research to see if people are willing to pay a premium in dollars or lost functionality for those added 2D features.

What do you do?



Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces"

Share this post


Link to post
Share on other sites
yep - the best engines support either d3d or gl.
Im all gl at the moment but understanding the concepts of 3d graphics will only lend support to my education when learning d3d at some stage im sure in my coding future!

HAIL great coders!

...and wild brutal death metal...

Im just a beginner!!!

http://www.actsofgord.com

Share this post


Link to post
Share on other sites

  • Loading Textures in GL is strange

  • I dont like calling glVertex(), glColor, and glTexCoord() millions of times

  • GL is almost too high level for me.

  • Loading Textures in Direct3D is very intuitive and simple

  • Using DrawPrimitive() with VBs is very simple

  • D3D is a little more low-level, so i liek

  • Therefore, I liek DirectGraphics



p.s. COM 0wnz!

------------------------------
BASIC programmers don''t die, they just GOSUB and don''t return.

Share this post


Link to post
Share on other sites
I started with OpenGL, used it for 2 years, and thought it was a pretty decent... sometimes it felt like I wasn''t even programming though... just not a very eligant API with all the glBegins, glEnds, etc. But one thing that always pissed me off about OpenGL was that all angles are measured in degrees, and I had never figured out a way to use radians instead!! Of all the API decisions I''ve seen, I don''t think I''ve ever seen a worse one. Just the simple fact that DirectX works in radians made me want to switch and never look back.

But along with that, DirectX provides many invaluable features that I had been looking for when using OpenGL. For instance, the interface to query the video card, get its device CAPS, available resolutions, refreshrates is wonderful in DirectX. But it just isn''t that simple if you''re gonna go with OpenGL (I never found out how to atleast).

Basically, as a person whose had an equal amount of time dealing OpenGL and DirectX, I would definetely recommend DirectX if you''re not worried about compatibility with other platforms. And besides, DirectX has more support and updates sense Microsoft manages as opposed to a committee (with good intentions) that just doesn''t get the new features out quick enough.

Share this post


Link to post
Share on other sites
quote:
Original post by GarlandIX
Loading Textures in GL is strange

I disagree. It fits perfectly into the design model that all of OpenGL follows.
quote:
Original post by GarlandIX
I dont like calling glVertex(), glColor, and glTexCoord() millions of times

You shouldn''t have been. They are options, but they''re rarely what you should actually be using. You were using OpenGL incorrectly.
quote:
Original post by GarlandIX
Using DrawPrimitive() with VBs is very simple

OpenGL''s vertex arrays are almost exactly the same. It''s clear that you did not learn OpenGL completely (or maybe just not correctly).

Share this post


Link to post
Share on other sites