OpenGL and only OpenGL!

A place for Ogre users to discuss non-Ogre subjects with friends from the community.
Post Reply
TG_Jones
Halfling
Posts: 53
Joined: Thu May 29, 2008 4:05 pm

OpenGL and only OpenGL!

Post by TG_Jones »

First of all, I want to make it clear that I'm by no means anti-MS. On the contrary I have been and still fond of MS great first class products from their operating systems to development tools to productivity and office suites. Anyway...

I have written a graphics program using DirectX 9, and it worked like a charm. Very consistent results across different windows platforms, it just runs smooth and fast. However, most of my code and the robustness there was for lost device handling and resource management. Now with DirectX 10 we don;t have to worry about resetting and restoring devices unless something disastrous happens which in this case all you need is to restart the machine. But again anyway, is not this simplicity already there in OpenGL since a decade? And now DirectX is catching with how things should work.

Many developers think the new DirectX is the way hardware operates and that it reelects the recent changes in how accelerators internally work.
Simply put not true. Both APIs support shaders and with OpenGL 3.0 forthcoming it will support more shader features besides the internals of video cards by extensions, a capability never existed din DX, and now they just removed the Caps bits queries where we used to claim it's very important feature of DX that distinguishes it from OGL.

The need of immediate mode. Yes. OpenGL should keep on supporting this native feature, which I consider the straight to the metal triangle command. Yes. Most decent hardwares are designed to work this way, you just fill up registers and that's it. Nothing must travel across physically distant memories (video and system) to draw a few triangles.
Buffering is the old way indeed, what about punching cards then? :D

I see here OpenGL is old but evolving and was designed by mathematicians, so it can fit there easily, and it's the standard.

Regretfully one of the 3D modeling program vendors say the opposite.

Myself I dropped all my DX project and now switched to OGL. It just rocks! :wink:
User avatar
pekar
Halfling
Posts: 92
Joined: Sun Mar 04, 2007 2:56 pm
Location: Belgium

Post by pekar »

You should consider owning a blog. Ogre forums ain't it , it's a place for discussion and questions.
User avatar
Evak
Orc Shaman
Posts: 707
Joined: Sun Apr 02, 2006 7:51 pm
Location: Sacramento, CA
x 1
Contact:

Post by Evak »

This is the off topic forum, so I don't see why the OP can't discuss GL and his experience if he wants.

I'm only interested in the API that has the best artist tool support. Especially where shaders are concerned. And GL doesn't get much in the way of artist tools. Almost everything is HLSL these days and all the 3D apps support DX for shaders and barely any shader functionality in GL.
TG_Jones
Halfling
Posts: 53
Joined: Thu May 29, 2008 4:05 pm

Post by TG_Jones »

The big question why? What makes HLSL distinct?
User avatar
pekar
Halfling
Posts: 92
Joined: Sun Mar 04, 2007 2:56 pm
Location: Belgium

Post by pekar »

You're absolutely right, my reaction was too harsh. This post just seemed too much like all of those x vs y or x is crap threads that really don't contribute anything to the community, and these are explicitly forbidden for the lounge forum. But anyway, let me make up by enumerating my own experiences.

Professionally, I work on a video rendering product, and due to performance requirements we have to work with DXVA for hardware acellerated video decoding. DirectX's resource management system is also a big plus.

Aside from work, I enjoy using OpenGL for it's immediate mode, like the poster said. And if you have to develop for non win32 platforms, you don't really have a choice of course...

I completely agree with Evak on the tool side though. I'm not quite convinced that the difference lies in HLSL as a shader language, as translating a HLSL shader to Cg is pretty straightforward (both teams had a lot of collaboration when developing their implementation. Here's one of those annoying coincides of life though: I prefer CG as a language and RenderMonkey as IDE :? ). I've also heard some good things about HLSL2GLSL, but haven't found the time to play with it myself. I think the 2 big difference for shader development are the support for real-preview in the popular modeling applications (although I'm pretty stoked by the advances in Blender by the Apricot team), and the .fx file format. A simple example would be preshaders, that actually analyse your shader code for calculations that only depend on uniform variables, and automatically perform this once per batch on the CPU, removing a lot of tedious work from shader optimization.

All I'm trying to say is that it's not all that clear cut, and often your decision will be made on factors different from the stock api (familiarity, supported OS'es, libs and all that).

But as we are all Ogre users here, we have the amazing possibility to defer this decision till runtime, and have an excellent material framework. So we can have our cake and eat it too!

PS The cake is a lie .
TG_Jones
Halfling
Posts: 53
Joined: Thu May 29, 2008 4:05 pm

Post by TG_Jones »

Hmmm what I was trying to say is this: why do professional developers from gaming to CAD software are now appreciating DirectX and losing interest in OpenGL for features that have been present in OpenGL since it was born, and now DirectX adopting them. While DirectX is approaching OpenGL in many ways, OpenGL is keep moving forward. So far nothing can be done in Direct3D that cannot be with OpenGL. It's only the hardware that allows for such features...Not to mention that D3D is now OS version specific, not only OS specific as it used to be. So it's worse.
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Post by Klaim »

I may be wrong but it seems it's more a support problem than a feature problem : lot of OpenGL driver implementations just sucks, most games target windows because the market is there so they often use DX because it seems to be better driver support and stability (am i wrong? i'm not a specialist of the subject...).

In the game industry, the impact of the XBox compatibility could maybe push the devs to use mainly DirectX but you could arg that the PS3 support OpenGL-ES (but is less a console of choice).
TG_Jones
Halfling
Posts: 53
Joined: Thu May 29, 2008 4:05 pm

Post by TG_Jones »

True. Then the source of the problem is IHVs. DirectX being used by XBox enforces a computability issue! Accordingly we have a few, or to be more realistic, 2 major cards: ATI and NV. One's GL implantation sucks for sure but not on every hardware series and for every platform/OS. And now PS is losing in front of XBox, Wow! I cannot argue more but to dream of DirectGL instead, an MS adopted implementation of GL. But anyway I'm sticking to GL and only GL, and will never recommend DX. :D
jjp
Silver Sponsor
Silver Sponsor
Posts: 597
Joined: Sun Jan 07, 2007 11:55 pm
Location: Cologne, Germany
Contact:

Post by jjp »

I don't think what APIs the consoles use is really a factor here. For game development I see:

- D3D drivers get a lot more care
- OpenGL standartisation lags behind, using new features is easier with D3D
- For PC games Windows really is the only interesting market
- For myself I can't say anything because I have never used these APIs directly but from developer comments I read D3D10 seems to be a very decent API

So really no reason to go for OpenGL when developing games. Unless you have a reason to support any other PC OS.

But why bother at all? Neither API will go away anytime soon. Both can and will coexist nicely.

EDIT: one reason for using OpenGL with games comes to mind - eventually one will be able to access features with WinXP that are now exclusive to Vista. But I doubt this is very relevant. The number of people who own "D3D10" hardware and will still be using WinXP at the time a game that could make use of this would be released should be rather small.
Last edited by jjp on Fri Jun 20, 2008 10:56 pm, edited 2 times in total.
Enough is never enough.
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Post by Klaim »

But why bother at all? Neither API will go away anytime soon. Both can and will coexist nicely.
++
User avatar
volca
Gnome
Posts: 393
Joined: Thu Dec 08, 2005 9:57 pm
x 1
Contact:

Post by volca »

jjp wrote:EDIT: one reason for using OpenGL with games comes to mind - eventually one will be able to access features with WinXP that are now exclusive to Vista. But I doubt this is very relevant. The number of people who own "D3D10" hardware and will still be using WinXP at the time a game that could make use of this would be released should be rather small.
I don't see a massive migration to Vista anywhere. To say the truth, I personally think a big part of windows users think Vista is a disapointment (can't comment, I only used vista for about 10 minutes so far). It seems the migration will likely happen to the Vista successor, or be forced with a PC upgrade to Vista (which is not a nice enforcement). Now I don't want to convert this to Vista hatered thread, so my point can be that it seems much more interesting for developers to either do DX9+DX10 combo release, or wait for OGL 3.0 and see what it's like.

Sure, I don't know what the details are, but saying that DX10 can't be ported to XP seems to be a marketing movement, rather than something enforced by a technical limitation of XP kernel/driver subsystem. It seems to me OGL 3.0 driver release for XP will reveal this fact.

Edit: Which means that there can be a group of people, indeed even atractive from the marketing view, that own DX10 HW but still use XP.
Image
jjp
Silver Sponsor
Silver Sponsor
Posts: 597
Joined: Sun Jan 07, 2007 11:55 pm
Location: Cologne, Germany
Contact:

Post by jjp »

The point is that we have a lot of conditions: games that really need "D3D10-features" and a OpenGL 3.0 release. And decent driver support from both ATI and NVidia for it. And users who have upgraded their hardware but have not moved to Vista or it's successor in like 2 years from now. Then we might have an attractive market segment. I am not saying it can't or won't happen. But I wouldn't bet on it :)
Enough is never enough.
User avatar
nullsquared
Old One
Posts: 3245
Joined: Tue Apr 24, 2007 8:23 pm
Location: NY, NY, USA
x 11

Post by nullsquared »

Two words: Windows 7
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 538

Post by Kojack »

Don't forget that OpenGL 3.0 doesn't have DX10 features (geometry shader, etc). Those are in Mt Evans, the codename for the update after 3.0. Considering 3.0 is already 9 months overdue, who knows when Mt Evans will come out. It was going to be half a year after 3.0.
User avatar
Klaim
Old One
Posts: 2565
Joined: Sun Sep 11, 2005 1:04 am
Location: Paris, France
x 56
Contact:

Post by Klaim »

Yeah OpenGL3.0 will come too late and will have to run faster to get up to date. :/
User avatar
Halifax
Halfling
Posts: 49
Joined: Sun Nov 18, 2007 10:30 pm

Post by Halifax »

Kojack wrote:Don't forget that OpenGL 3.0 doesn't have DX10 features (geometry shader, etc). Those are in Mt Evans, the codename for the update after 3.0. Considering 3.0 is already 9 months overdue, who knows when Mt Evans will come out. It was going to be half a year after 3.0.
Yes that is true, but geometry shader functionality is already exposed by GL_NV_geometry_program4 and GL_EXT_geometry_shader4 for OpenGL 2.0. The fact that it hasn't been passed by ARB, or standardized yet, doesn't mean that it isn't there.

And I would say that consoles definitely do have an effect on what API some PC games use. The main reason being that to port from 360 to PC isn't really that hard at all, and console games that get ported are obviously not going to rewrite their codebase just for OpenGL.

At any rate, I think the philosophy of OpenGL is better, as a whole, than D3D9/10. That doesn't mean I'm not just going to deny support for D3D9/10 though, even if the OpenGL API is better.
TG_Jones
Halfling
Posts: 53
Joined: Thu May 29, 2008 4:05 pm

Post by TG_Jones »

Exactly. OpenGL looks better, Direct3D works better. :)

I think I should go for both, create 3 paths :lol: so that I can support Mac, Linux, Windows XP, and Windows Vista. Sounds reasonable and affordable to you guys? It's not even computer science.

But anyway, since I'm an anti-free/opensource software, I beleive in market and it's the way to go, because this is what pays our bills programmers. :lol:
User avatar
Halifax
Halfling
Posts: 49
Joined: Sun Nov 18, 2007 10:30 pm

Post by Halifax »

If you are looking for cash flow, then why are you creating your own engine anyways? Your not going to be paying bills anytime soon, or breaking into the market.
User avatar
volca
Gnome
Posts: 393
Joined: Thu Dec 08, 2005 9:57 pm
x 1
Contact:

Post by volca »

jjp wrote:The point is that we have a lot of conditions: games that really need "D3D10-features" and a OpenGL 3.0 release. And decent driver support from both ATI and NVidia for it. And users who have upgraded their hardware but have not moved to Vista or it's successor in like 2 years from now. Then we might have an attractive market segment. I am not saying it can't or won't happen. But I wouldn't bet on it :)
Those are valid points, sir.

There are some statistics programmers tend to lean away from Vista coding to linux coding, but this still is a small fraction of the whole.

Maybe wine project can change this DX10(/Windows) only situation, then GL will matter much more than it does now.

Well see in a few years...
Image
Post Reply