Reputation: 103
So I am wanting to start playing with OpenGL with a view to implement some game ideas I have had for a long time now, but I noticed there are several versions of OpenGL.
I ideally would like to support older computers too, so I was wondering if OpenGL 2.1 would be the best version to use. OpenGL 4 doesn't even work on my desktop machine :O
The type of minimum spec for the game would be DX9 era graphics cards, so basically most modern computers would run it (even the low end onboard graphics). I would be looking at JOGL for implementation as I know Java the best (have done Java3D in the past) and I would like to deploy to all 3 major OSs.
With this in mind what kind of books would you suggest to me? Would it be pointless getting a OpenGL 3 or 4 book as I have read that there are big changes? Should I settle for an older book on 2.1 instead?
Upvotes: 6
Views: 616
Reputation: 1023
Keep in mind Old school OpenGL is still supported. You don't HAVE to use modern OpenGL, you can totally just use the fixed function pipeline if you are doing something relatively non-complex or non-specific. If you want to start doing advanced lighting or something like this that's where modern OpenGL comes in handy.
To be honest, I kind of like old school OpenGL, it's much easier and you can get things on the screen much quicker. Modern OpenGL is incredible, but it comes at the cost of being much more complex, you need so much code and you have to know so much before you even begin to start using it effectively.
The main difference since you asked is the ability to customize how shaders work. A shader is a program that runs on the GPU. In the past, these shaders were pre-programmed and so you had little control over how you wanted them to work and so you were limited with what you could do in OpenGL (it got the job done, it was just more generic and therefore less powerful). So with modern OpenGL you can customize the way you want shaders to work, for example there's something called a vertex shader, which is a shader that processes points pushed to the GPU and figures out where to position those points. In modern OpenGL you customize how these shaders work by using something called GLSL
GLSL is a C style semi-assembly language that is pushed to the GPU, and that's the main difference between old and modern OpenGL.
As far as a book to get, you are going to have to get a 2.0 book for 2.x, it's not even in the same ballpark as new OpenGL. There are general concepts that transfer to modern OpenGL but for the most part it is totally different. I ordered OpenGL game programming by Andre Lamothe for I think 5 dollars? It is a really good intro to 2.1 and the code is written with Win32 and since the Windows API has barely changed at all almost all of the code (if not all) work the same even though the book is about 12 years old (goes to show how well written it was) and it actually has really interesting projects (animated robot, spinning cubes for the first few). Anyways, best of luck to you. It's a tough and long road, but it is so rewarding.
Upvotes: 0
Reputation: 14044
Just out of curiosity, are you on Linux?
Linux is really the main bottleneck here, or rather, Linux systems running with opensource drivers are the bottle neck (systems with ATI or NVIDIA drivers are not a problem, they will support the latest and greatest). Things are shaping up on this front though, with the release of Mesa 8 earlier this year, there is finally a open source OpenGL 3 solution.
I'll certainty suggest you don't ignore shaders, if I was in your shoes, since you are using JOGL, I would consider implementing it using OpenGL ES 2 profile (since you are using java anyways, this will make everything quite easily portable to android as well if you should see fit)
Oh, and additionally, since you are shopping for books I would look at Interactive Computer Graphics: A Top-Down Approach with Shader-Based OpenGL (the 6th edition).
I went though a earlier edition of this book many moons ago for a course at uni. And recently bought the 6th edition simply because I loved the old one so much, and its quality :)
Upvotes: 3
Reputation: 1819
OpenGL 2.1 might be the best. as a comparison it has relatively the same compatibility as DirectX 9c, which is the latest Windows xp can get, and i know there are a lot of XP boxes out there. some of my friends still prefer xp.
Graphic cards that don't support these APIs at this point of time might very well be very obsolete.
If a user cannot run your game using 2.1 you might have to suggest the user to buy a newer computer. you might even want to use OpenGL 3.0, if you adopt this thinking.
In my opinion, i would try learning 2.1 first and getting some practice, and after that, start using 3.x and eventually 4.x. Big game companies usually dont care about compatibility and have the user buy new hardware.
Upvotes: 2