OpenGL worth the try?

Started by
25 comments, last by Myopic Rhino 12 years, 10 months ago
As usual, thanks for all your opinions around this subject, I've been educating myself in order to understand some of the advices, now that I read a little bit I got some of your points, As I said before I will start with OpenGL mainly because I'm targeting my 2nd game to android and/or iphone, and both use OpenGL as core graphics API,

It's a little bit overwhelming that most of the tutorials I found are very old... 2005 or older, and most of the tutorials I found about OpenGL ES are written from people who read someone else tutorials and made a new one... with a LOT of mistakes and misleadings, I also looked around and found a lot of books with the same copycat techniques... the documentation found at OpenGL.org is a little bit cryptic and not newbie friendly,

The other thing that was "funny" (lack of a better term) is that the OpenGL ES samples does not run within the emulator provided with Android SDK, after several hours of changing the code and putting some debug messages (and loosing some hairs) I found a forum which claims that emulator does not support OpenGL ES... what a mess... how can I create a game that I need to deploy at my phone every time I need a test? is there a way to create an API abstraction layer to run code in OpenGL at desktop and then port it to OpenGL ES without rewriting all the code again?

Do you have a GOOD tutorial, a proven tutorial that has a NEHE like experience but with a newer versions of OpenGL?

Thanks for your support.
Advertisement
This page is something of a goldmine when it comes to dealing with OpenGL tutorials: http://www.opengl.org/wiki/Common_Mistakes (yes, even the NeHe tutorials are guilty of many of the mistakes here). By all means follow a tutorial, but keep that to hand a reference for correcting things as you go.

For modern OpenGL it doesn't get much better than this: http://www.arcsynthesis.org/gltut/

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

thanks for the links, they're priceless, the common mistakes is really a very nice link to have in my bookmarks :D I think it will save me tons of hours trying to figure out what I did wrong (mainly when you check a tutorial and everything is exactly as the tutorial but you still get the error).

As usual, thanks for all your opinions around this subject, I've been educating myself in order to understand some of the advices, now that I read a little bit I got some of your points, As I said before I will start with OpenGL mainly because I'm targeting my 2nd game to android and/or iphone, and both use OpenGL as core graphics API,

It's a little bit overwhelming that most of the tutorials I found are very old... 2005 or older, and most of the tutorials I found about OpenGL ES are written from people who read someone else tutorials and made a new one... with a LOT of mistakes and misleadings, I also looked around and found a lot of books with the same copycat techniques... the documentation found at OpenGL.org is a little bit cryptic and not newbie friendly,

The other thing that was "funny" (lack of a better term) is that the OpenGL ES samples does not run within the emulator provided with Android SDK, after several hours of changing the code and putting some debug messages (and loosing some hairs) I found a forum which claims that emulator does not support OpenGL ES... what a mess... how can I create a game that I need to deploy at my phone every time I need a test? is there a way to create an API abstraction layer to run code in OpenGL at desktop and then port it to OpenGL ES without rewriting all the code again?

Do you have a GOOD tutorial, a proven tutorial that has a NEHE like experience but with a newer versions of OpenGL?

Thanks for your support.

The D3D documentation can be equally cryptic in certain situations and if you pick D3D skip everything before D3D11, if you need to target older hardware(D3D9 and up) use the feature levels in the D3D11 API this will allow you to write you D3D stuff more transparently. The graphics stuff in XNA is D3D9 based but models the D3D11 level closely as in immutable rasterisation state classes and certain other things.

The fact most games support D3D is historical as state before and pre 2005 OpenGL was lacking features that D3D9 did implement and thus most developers switched to this API, nowadays most stuff is done in shaders and HLSL and GLSL offer the same capabilities. If you wish to write shaders that are supported by both OpenGL and D3D use Nvidia's CG language it has backend hooks that make it work on both, side note HLSL and CG are more or less the same language.


Seeing that most stuff now is done in shaders you benefit far more from learning how blending operations work as you need to be able to express them in shader code in most cases.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

I wouldn't quite say "skip everything before D3D11". If you need to target Windows XP then D3D9 is still be best choice, and is a surprisingly clean and elegant API with just a few (but very few) places that make you go "WTF!" Compared to the contemporaneous OpenGL versions (2.0, 2.1) it's definitely much easier to use, more sensibly structured, and needs significantly less lines of code (compare SetVertexDeclaration with the mess of glEnableClientState/gl*Pointer calls, although the VAO extension - if available (which it may not always be at this target level) - balances things off). D3D10 is defintely one to skip though, and if needing to target XP isn't a consideration then going straight to 11 makes sense.

All assuming that one is targetting Windows only, of course.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

The [color=#1C2837][size=2]glEnableClientState/gl*Pointer calls are confusing at first, but once you have it working once, you can pretty much just copy and paste the same bit of code over and over.
[color="#1c2837"]OpenGL has a great mini unofficial SDK thing which comes in the form of code/shader samples. Can find it here: http://www.g-truc.net/
The sample pack is very easy to read and concepts can be understood within minutes.

The other thing that was "funny" (lack of a better term) is that the OpenGL ES samples does not run within the emulator provided with Android SDK, after several hours of changing the code and putting some debug messages (and loosing some hairs) I found a forum which claims that emulator does not support OpenGL ES... what a mess... how can I create a game that I need to deploy at my phone every time I need a test? is there a way to create an API abstraction layer to run code in OpenGL at desktop and then port it to OpenGL ES without rewriting all the code again?

Go here, register for a free account, and download the Adreno SDK, which includes a full OpenGL ES 1.x/2.0 layer implemented on top of desktop OpenGL, over 50 samples and tutorials, and a sample framework for building on Android and Win32. We'll soon be releasing an updated framework in which all samples will build for Android and Win32.

This topic is closed to new replies.

Advertisement