The Jungle Of Opengl, Where To Start?


maiden

Member
Joined
Jul 28, 2009
Messages
120
Age
36
Location
Västerås Sweden
Website
mybot.se
Hello, i have been writing SDL games for about 4 years and i feel that it is finally time to take the next step to OpenGL.
I have been looking around at "PowerVR SGX SDK", nehe and several random google hits and got a hang on basic things (as in not much but still >0).

What now?, what should i be looking at? OpenglES 1.1 or OpenGlES 2.0 ? or should i first learn Opengl 2, 3 or 4 on the desktop and than look at OpenglES when i better understands the differences? (btw for some differences check this site: http://wiki.maemo.org/OpenGL-ES ).

I own an Nokia N900, an Beagleboard and i am waiting for my OpenPandora and those have support for OpenGl ES 2.0 but i also own an WIZ who only have support for 1.1.

What is the best approach of learning opengl in my case? is it worth the effort to learn opengl 2.0 and then have to update my knowlage directly to 3.0 and 4.0? or is it best to just start with opengl ES 1.1? and then update to ES 2.0?

I want to be able to code OpenGL on my computer and my mobile devices, but all those new editions gets my head spinning. Please pull me in the right direction!
 
First of all: There is no OpenGL 4 afaik.

Then: you should learn OpenGL ES 2 or OpenGL 3 first (the two are basically the same) because they represent what OpenGL is evolving into.

OpenGL ES 1 and OpenGL 1 both use what is called "the fixed-function pipeline" (at least if you don't use extensions) which is easy to learn (you basically tell GL to "draw a triangle there and then there and then there" etc...) but not very useful (if you want to do anything except drawing colored and textured triangles with basic lighting, you're out of luck).

OpenGL 2 introduces vertex and fragment shaders, which basically give you much more fine-grained control over what is being drawn. You are basically able to send code for generating materials and geometry to the graphics card, enabling you to implement a wide variety of effects. These APIs have a learning curve that is a little steeper compared to GL1. If you already know OpenGL 2, however, it is much easier to learn OpenGL 1 (because OpenGL 1 is just a limited form of OpenGL 2, lacking the shader functionality).

OpenGL 3 and OpenGL ES 2 are basically like OpenGL 2, except that all rendering *has* to happen through shaders. In OpenGL 2, you could mix-and-match fixed-function and programmable pipeline code; not so in GL3. These APIs represent the direction that OpenGL is going (→ generalization, modularity).

So, my recommendation would be to learn OpenGL 3 and OpenGL ES 2, and from there, you can check whether you need to target platforms that only support OpenGL 1.x, and then decide whether you should bother learning the limited fixed-function pipeline API.
 
You're forgetting GL 1.4 which is as easy to use as fixed function but you can use pixel/vertex shaders and the fixed function values are available in the shaders.
 
NeX-Ferret said:
You're forgetting GL 1.4 which is as easy to use as fixed function but you can use pixel/vertex shaders and the fixed function values are available in the shaders.
This is also true for OpenGL 2 as I said above. But you shouldn't use the fixed-function pipeline, it is deprecated.
 
Last edited by a moderator:
If you go ahead and dive into OpenGL ES 2.0, you're going to give up from absolute confusion, you need to start, like everybody from the start.

http://nehe.gamedev.net/lesson.asp?index=01
 
If you want to look at code, and you have a Pandora, you can download the sources to WakeBreaker and build it/run it to see how things work .. this will at least give you a good context for understanding OpenGL ES 1.1 .. which is quite an effective start, at least.

WakeBreaker has a lot of well-thought out classes that delineate the different aspects of a 'typical' approach to implementing 3D objects, and as a code base its functional and easy to understand. I found myself finally 'groking' the problems of GL-ES programming, and the effective solutions. Its all about RAM, baby!

GL2.0 requires a bit more understanding and work and can definitely be tackled in the same way - get a demo app codebase from the SGX/Khronos group collection, and try to understand whats going on. Jelly Invaders is, I think, along a similar line to WakeBreaker; both code-bases have been selected by Khronos to represent the methodology of GL-ES versions, so a bit of code reading could be good for you.

I ported WakeBreaker as an exercise yesterday, in case you missed the link for some reason: http://w1xer.at/pandora .. you can put this code on your Pandora and browse it/build it/run it to get booted up.

Pretty sure I'll have a go at JB or some other GLES2.0 demo, but if you are up for the exercise, go ahead and do a port to Pandora yourself! Having your fingers in code is a good way to start getting your questions answered about how it all works ..



(ta JFR!)
 
NeHe is outdated.


I'd recommend OGL 2.0 for now, then when you get the hang of some features get some shader editor, learn how to write shaders and start to integrate them. OR learn how to write shaders now and then start directly with OGL ES 2.0 or OGL 3.0.

OGL is not as hard as it seems, however, if you have to learn shaders too, you might end up being confused or thrown away by the complexity of shaders alone. You have no way to verify your shader or OGL code is correct.
So start with the fixed function pipeline and then move to shaders later OR learn shaders before - don't try both (shaders and OGL) at once.


//Edit: Torpor: WaveBreaker should be OGL ES 1.1, not OGL 1.1
 
dflemstr said:
First of all: There is no OpenGL 4 afaik.
Yes there is: http://en.wikipedia.org/wiki/OpenGL_4#OpenGL_4.0
 
Last edited by a moderator:
maiden, start with a good book on 3d graphics. learning the fundamentals of a discipline through APIs is not a particularly good approach to self-education.

Advanced Animation and Rendering Techniques, Watt and Watt is one such book - it starts with a couple of introductory chapters on 3d and rendering, and then moves on to discuss interesting practical problems from 3d computer graphics. while many of those are discussed from the POV of CGI production circa the early '90s, they are interesting and relevant to today's real-time graphics. also, brush up your linear algebra (in case it needs brushing up), as 3d graphics is more about spatial thinking and skills at the related math apparatus, than about programming skills.

as re getting the hang of the API - start with desktop GL, say 2.0, as it allows peaceful coexistence of fixed and programmable pipelines. universally-acclaimed texts on the API are the 'blue book' and the 'red book'.
 
I actually started reading the Red-Book (5th ed) yesterday. Thanks for the help. and Yes there are an opengl 4.0 check for your self on http://www.opengl.org/documentation/current_version/.
To start with learning Opengl 3.0 and Opengl ES 2.0 sounds good, but the current edition of the red-book will probably force me to start with OpenGl 2.0.
 
Got hold of Red-Book Seventh Edition (opengl 3.0 and 3.1) and the book "OpenGL ES 2.0 programming guide".
Already got the Hello Triangle program running on my N900 :D
 
maiden said:
Got hold of Red-Book Seventh Edition (opengl 3.0 and 3.1) and the book "OpenGL ES 2.0 programming guide".
Already got the Hello Triangle program running on my N900 :D


I'm diving in headfirst here. :D

OpenGL 3.0 and OpenGL ES 2.0 seem like where I want to start as well.

I hope my linear algebra is up to snuff.
 
Last edited by a moderator:
Lunatic said:
maiden said:
Got hold of Red-Book Seventh Edition (opengl 3.0 and 3.1) and the book "OpenGL ES 2.0 programming guide".
Already got the Hello Triangle program running on my N900 :D


I'm diving in headfirst here. :D

OpenGL 3.0 and OpenGL ES 2.0 seem like where I want to start as well.

I hope my linear algebra is up to snuff.

And if it is not: http://khanexercises.appspot.com/video?v=xyAuNHPsq-g (check the links under the video)
used this site alot when i studied Linear Algebra.
BTW if you for some idiotic reason are going to study calculus, (i have taken 2 courses, and are thinking about a third, but then, i am not sane...)
check the calculus videos on http://justmathtutoring.com/ , i do not think i would have passed without them..

I love the internetz :D
 
Last edited by a moderator:
Ok, GL 3.0 is bad, GL 3.3 is good.

glbegin etc still exists in Gl 3.0 and of course the authors of the redbook have been lazy so they still use glbegin in seventh edition even if it is deprecated.
glbegin do not exists in GL 3.3 and later, and GL ES 2.0 and later.

so redbook 7ed SUCKS. (even if it is good reading)
 
Just a general word of advice on performance-sensitive matters: don't be appalled by things like glbegin. While it's not something you'd use in production code, it's still a useful apparatus for quick-n-dirty prototyping. Sort of like python is :p Kidding there, of course. There are a gazillion ways to shoot yourself in the foot performance-wise in a modern 3d pipeline, and most of those are treacherous undersurface rocks. In comparison glbegin is the neon-sign-marked 'fix me later' benign hack.
 
darkblu said:
Just a general word of advice on performance-sensitive matters: don't be appalled by things like glbegin. While it's not something you'd use in production code, it's still a useful apparatus for quick-n-dirty prototyping. Sort of like python is :p Kidding there, of course. There are a gazillion ways to shoot yourself in the foot performance-wise in a modern 3d pipeline, and most of those are treacherous undersurface rocks. In comparison glbegin is the neon-sign-marked 'fix me later' benign hack.
I don't think there's any excuse for using glBegin in an introduction to OpenGL written in the last eight years.
Lots of 'production code' out there seems to use immediate mode exclusively, in large part due to its use being propagated through beginner's tutorials like NeHe.
 
Last edited by a moderator:
Multiplex said:
I don't think there's any excuse for using glBegin in an introduction to OpenGL written in the last eight years.
Lots of 'production code' out there seems to use immediate mode exclusively, in large part due to its use being propagated through beginner's tutorials like NeHe.
Unless the tutorial omits to mention that glbegin & co are degrading performance, I don't see why the existence of said apparatus should be hidden from the readers.

I would rather spend 1 minute to write a silly gizmo through immediate-mode GL calls, than 10 minutes through production-quality VBO'd arrays. Given, I'll either use the gizmo for a quick test and then drop it, or rewrite it later production-proper if that proved useful. Either way, I appreciate having the option to go quick-n-dirty when needed.
 
Last edited by a moderator:
Are there any NeHe-style tutorials with OGL 3.2 Core / OGLES2 compatible examples? I tried looking the other day, but came up with little more than a few scattered demos with huge leaps in complexity and required knowledge. Something starting like "Here's the simplest possible application you can make. Let's go over each part." and then adding concepts and code with minimal added complexity (focus on teaching, not function) one by one would be nice.
 
There are not much info anywhere..

what i have found so far is:
http://www.imgtec.com/powervr/insider/sdk/KhronosOpenGLES2xSGX.asp
and
http://www.g-truc.net/post-0298.html
and
http://opengles-book.com/downloads.html
and
http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=277971
 
This could be a nice topic for a community tutorial series if anyone with the necessary skills is up for it :). I suggest that making a minimal skeleton program that all (at least at first) the tutorial segments will use and commenting it as well as possible. The program only needs to draw a single static triangle or something. Then it can be further explained in more detail in the form of a tutorial. After that first part of the series is complete, others can contribute by demonstrating how to do different things using the same skeleton. Just concentrate on making the examples as simple and to the point as possible. Concentrate on showing how to do stuff instead of doing something flashy.

That is... if someone is up for it :unsure:

I probably would, but my knowledge of OGL is kind of rudimentary, so I'd like these tutorials for myself also :).
 
Back
Top