Getting back into it....

While I was at uni I did a fair bit of OpenGL coding culminating in my third year project which was a realtime particle simulation for a virtual environment. Although nothing particularly amazing, I know my way around OpenGL (or at least would if I dug out my copy of the Red Book :) )

Anyways - I want to get back into the game and I'm thinking of defecting to Direct3D. The way I see it, (and please inform me if I'm wrong) OpenGL requires loads of extensions (a lot of which are vendor specific) in order to do any of the shader stuff. This is something I'd really like to get into and it just seems like Direct3D presents a more unified 'ready-to-go' API.

I DO NOT WANT TO START A DIRECT3D vs OPENGL POST. We've all seen plenty :D

As I'm already comfortable with OpenGL, I'd rather not learn a whole new API, but I wanted some opinions from coders before I start. I'm planning on working primarily on Windows, but another draw of OpenGL is its platform independent nature.

Thanks,

Stephen
 
You might want to figure out what specific things you're going to be doing, it could be that OGL will suit your needs without resorting to various vendor specific code paths. In which case it doesn't seem worth going to DX9, since you'll be taking the overhead in time of learning it and you'll lose platform independence -- Wine doesn't count ;).
 
Did you primary used glBegin()/glEnd() or glDrawElements() (Vertex Arrays).

If you are comfortable with vertex arrays, you might find out that D3D is not very hard to learn - just different syntax. (The other form is absent from D3D.)

Sometimes D3D is more cumbersome, say:
Code:
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

pDev->SetRenderState(D3DRS_ALPHABLENDENABLE, true);
pDev->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
pDev->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);

Sometimes GL is more complicated, usually when extensions are involved:
Code:
glActiveTextureARB(GL_TEXTURE2_ARB);
glBindTexture(GL_TEXTURE_2D, TexureID);
glEnable(GL_TEXTURE_2D);

pDev->SetTexture(2, pTexture);

As for shaders it depends, Vertex shaders are quite well supported in GL.

Pixel shaders OTOH is a mess of vendor-specific extensions, and altough there is a standard for floating-point pixel shaders, one of the vendors doesn't (currently) fully support it, while it's way too slow at the other vendor.

Also when basic functionality like vertex buffers took more than 3 (!) years to appear as GL standard after it became part of D3D (DX7), (and there's still no official drivers to support it) one can't help but worry about the future-proofness of the API.
 
Cheers for the replies

I am used to using glBegin/glEnd but that's something that needs changing anyway. The more I think about it the more I'm looking at going to Direct3D. The linux dev stuff I think will have to take a back seat. The only stuff I'm coding under linux is Maya plugins; these are not really graphical so I'm sure I could scrape by with the GL I'll remember should I need it.

I do feel kinda bad about abondoning such a fantastic API, and before I do, I think I'll try writing some basic shader stuff in GL, just to see how much the extension lark is held together with sticky tape. Bring on GL2 :)

Stephen
 
Back
Top