PDA

View Full Version : Beginning OpenGL 3.0+ Programming (again) in OS X, targeting multiple platforms




Soulstorm
Jul 7, 2012, 12:52 PM
if this topic is a duplicate, I'm sorry, but I couldn't find the information I am asking anywhere.

I had started learning OpenGL, and I had even made a very simple game using OpenGL ES 1.1 some years ago for iOS. However, I have abandoned it in favor of other projects. The last version of OpenGL I checked out was 2.1, and frankly, I just checked it out without giving it too much attention before abandoning it for my full time iOS employment.

Now, I want to pick it up again. However, the books I have cover OpenGL 2.5 (Red Book), OpenGL ES 2.0 (I hadn't have the chance to open it) and OpenGL Shading language (I can't remember which one, but I bought it at the same time I bought the Red Book). I have read that OpenGL 3.0 and above changed dramatically the rendering pipeline making it fully programmable, and that's why it dropped support for older features, getting also rid of obsolete and bloating functions.

I have two computers with OS X 10.7.4, a Macbook with GeForce 9400M, and an iMac with ATI Radeon HD 6750 Mobility, both of which I believe are in compliance with OpenGL 3.0 (at least with most features).

Giving all this information, here are my main questions:


Are there any good start up tutorials in OpenGL 3.0+?
Are there any good start up tutorials in OpenGL 3.0 + for OS X? All I could find was outdated tutorials for fixed pipeline
Are the books I already have going to help me or will I need to buy their newest versions due to the shift in the OpenGL pipeline?
Is there something I have misunderstood or that I am missing?


My target is mainly OS X, iOS and Android, therefore I am not interested in platform-specific resources and information. I understand that every platform has its own implementation and extensions to the OpenGL API, but I wan to be as platform-independent as possible. I am not specifying any language in my question, since I am proficient in C/C++/ObjC and the Android OpenGL Java implementation is not that different from what I hear.

Time is not an issue, nor my mathematical/programming skills. And I also don't want to initially learn how to use any wrappers/frameworks around OpenGL, before I learn the basics of OpenGL before learning abstract notions and frameworks around it.

Thank in advance for all the information and directions you can give me regarding this matter.



robvas
Jul 7, 2012, 06:16 PM
Android uses OpenGL ES like iOS, right?

Regular Mac OS X uses OpenGL, not OpenGL ES

I have attached a simple Xcode project that draws a colored triangle, it doesn't use any framework like SDL.

Soulstorm
Jul 8, 2012, 04:01 AM
Android uses OpenGL ES like iOS, right?

Regular Mac OS X uses OpenGL, not OpenGL ES

I have attached a simple Xcode project that draws a colored triangle, it doesn't use any framework like SDL.

+1 for helping me with a sample project. Do you know of any good references?

robvas
Jul 8, 2012, 10:23 AM
+1 for helping me with a sample project. Do you know of any good references?

There are some pretty old tutorials at http://nehe.gamedev.net/

I also have the red OpenGL book but I honestly haven't looked through it much. Never spent the amount of time I wanted to, basically used it for drawing lines and textured polygons to make 2D game type stuff.

softwareguy256
Jul 8, 2012, 07:24 PM
go to developer.nvidia.com and read all the articles and samples.

if this topic is a duplicate, I'm sorry, but I couldn't find the information I am asking anywhere.

I had started learning OpenGL, and I had even made a very simple game using OpenGL ES 1.1 some years ago for iOS. However, I have abandoned it in favor of other projects. The last version of OpenGL I checked out was 2.1, and frankly, I just checked it out without giving it too much attention before abandoning it for my full time iOS employment.

Now, I want to pick it up again. However, the books I have cover OpenGL 2.5 (Red Book), OpenGL ES 2.0 (I hadn't have the chance to open it) and OpenGL Shading language (I can't remember which one, but I bought it at the same time I bought the Red Book). I have read that OpenGL 3.0 and above changed dramatically the rendering pipeline making it fully programmable, and that's why it dropped support for older features, getting also rid of obsolete and bloating functions.

I have two computers with OS X 10.7.4, a Macbook with GeForce 9400M, and an iMac with ATI Radeon HD 6750 Mobility, both of which I believe are in compliance with OpenGL 3.0 (at least with most features).

Giving all this information, here are my main questions:


Are there any good start up tutorials in OpenGL 3.0+?
Are there any good start up tutorials in OpenGL 3.0 + for OS X? All I could find was outdated tutorials for fixed pipeline
Are the books I already have going to help me or will I need to buy their newest versions due to the shift in the OpenGL pipeline?
Is there something I have misunderstood or that I am missing?


My target is mainly OS X, iOS and Android, therefore I am not interested in platform-specific resources and information. I understand that every platform has its own implementation and extensions to the OpenGL API, but I wan to be as platform-independent as possible. I am not specifying any language in my question, since I am proficient in C/C++/ObjC and the Android OpenGL Java implementation is not that different from what I hear.

Time is not an issue, nor my mathematical/programming skills. And I also don't want to initially learn how to use any wrappers/frameworks around OpenGL, before I learn the basics of OpenGL before learning abstract notions and frameworks around it.

Thank in advance for all the information and directions you can give me regarding this matter.

ArtOfWarfare
Jul 10, 2012, 09:09 AM
I know this is exactly what you think you don't want to hear, but honest to god, it's probably what you actually want to hear.

Ogre 3D

I was stuck in the same "OH MY GOD, MUST USE OPENGL, IT'S SO HARD AND THEREFORE WORTH IT" mindset. You are subjecting yourself to torture for no reason. What you're doing is like trying to write in brain**** (a language created solely for people into computer related masochism) instead of C.

If you want to actually do anything 3D related this year, use Ogre 3D.

http://www.ogre3d.org

I abandoned all attempts to learn OpenGL years ago when I learned the following few facts:

- There is no way of learning it. There are "beginner" materials on it which, though they have thousands of lines of code, don't actually teach you enough to do anything with it. There are reference materials, which are fairly useless given the lack of any material that will actually teach you anything. It's like having a dictionary to learn English with, when you're a toddler who doesn't know how to read.
- It is by no means cross platform. I know of at least 5 completely different versions of it, all of them equally impossible to learn.

So... unless you're responsible for making an engine (which you really have to ask yourself, why? There are so many already available. Many are free... what on earth do you think you can do that someone else hasn't already done as far as an engine?) - abandon learning OpenGL now. It's a complete waste of your time.

You think you want it, but you don't. You want Ogre 3D. The hard work was already done. What remains is whatever will actually be unique to your app. (Because, believe it or not, having 3D graphics stopped making you unique about 2 decades ago. Stencil shadows stopped being new a decade ago. Other 3D XYZ feature is also done. Honest to god, if people keep trying to add features to their engines, they're going to start making the real world look unrealistic.)

Soulstorm
Jul 10, 2012, 09:34 AM
You are right. That was NOT what i wanted to hear. However, not only your post was insightful, it was also actually useful. Hence the thumbs up!

I will definitely have a look at Ogre3D, no matter what I decide to do with OpenGL.

However, I should add a few things.

-- Yes, lots of tutorials and code are outdated, especially if you try to find resources for OpenGL 3.0 and above. It's as if it doesn't exist!
-- Yes, it's very difficult to write something in it. Apart from decent programming skills and too much time, you also need a solid background in linear algebra and other mathematic terms.
-- The OpenGL code is NOT COMPLETELY portable. However, the basics are the same on all platforms. Sure, some shaders will behave differently in different OS'es, and setting up an OpenGL view is inexplicably difficult and distinct from one machine to another. But the main concept is the same.

Apart from all these factors, one holds the crown: I want to learn it, even if I don't end up making a graphics engine on my own. Even when using Ogre or any other graphics framework, you still need some background in OpenGL to help you. For example, what happens when you need to use a shader not supported by the framework you are using? I don't know about Ogre3D, but in most of these cases the time you may need to implement something that doesn't come with the API almost reaches the time you will need to do it from scratch.

Besides, if I end up using something like Ogre, I want to know what I will be missing :)

Nevertheless, the information you gave was very useful, and because of you I know I am not the only one I feeling this way about OpenGL!