Learning Open Gl, Some Advice ?


stephen0205

Still Fresh
Joined
Oct 4, 2009
Messages
52
hi there, i recently bought a pandora, and i thought id like to make some small games or apps or just something for it. Just wanting to know the best place to start for learning open gl, or open gl es which the pandora uses i believe.

just wondering if there are any good books people can recommend, possibly for a beginner, i dont have alot of programming experience, i know some c++, javascript, html and some dark basic, mostly i know c++, well basics i made a map editor in it for my final project at college. But i never learned about api's or how to use them.

any advice would be appreciated, im sure this question has probably been asked before, so please go easy one me. Just looking to join in with the community, get into programming somemore and develop something i can use on my pandora.

A small game perhaps, doesent the iphone use opengl ????

sorry that was off topic. Anyways all help would be appreciated.

im glad to be part of the community. Thanks
 
http://lazyfoo.net/SDL_tutorials/index.php

These are some widely distributed tutorials on how to use SDL as a graphics API in C++. Lesson 36 gets you started on using OpenGL 2.1 through SDL.



Edit: I'm a beginner too, and don't know anything about OpenGL-ES yet.
 
Read the Red Book. You can read an older version (for OpenGL 1.1) online here. Once you know what you're doing, you can consider learning about what they added in later versions - the original spec is enough to get you started though.
 
I will give one piece of advice: don't worry too much about learning OpenGL. Definitely make sure you understand the basics, even read the book if you want, but I'm going to recommend not doing anything directly in OpenGL.
There are a lot of great 3D engines (of varying complexity) that handle all the specifics of rendering for you. While it's great to understand how OpenGL and other lower level tools work, it doesn't always make sense to build an engine from scratch, especially when you're just one guy who wants to make some games for fun or education. Imagine if a contractor had to build a hammer and saw from scratch every time he wanted to build a house. Find some tools that'll work for you and use those, and only when you need something specific should you really worry about OpenGL.
 
WizardStan provides you with practical advice. But, if you're a control-freak like me you'll want to know exactly what you can do with the API. There are some useful pdfs on the khronos site:

http://www.khronos.org/opengles/2_X/

Don't listen to Vorporeal :p , I prefer the opengl es 2 information. They have EGL and GLSL information there too.

edit: wrong person...
 
There are a lot of great 3D engines (of varying complexity) that handle all the specifics of rendering for you.

could someone explain that in more detail, which engine would work on the pandora which would do some specific rendering ?
 
stephen0205 said:
could someone explain that in more detail, which engine would work on the pandora which would do some specific rendering ?
A 3D rendering engine is a higher level of programming. It's like C is higher level than assembly: you could write your code in assembly, if you wanted complete control, but for 99% of what you will probably ever want to do, C is good enough (Or Java, or Python, or whatever your language of choice is)
Irrlicht and Ogre are both being ported to work on the Pandora. In fact, I'm pretty sure there's a working build of Irrlicht already.
Both are very good engines with a lot of features. For example, suppose you have a BSP (quake map) file. One command will load it, another sets the camera information, and a third says "render this scene". It's (almost) that easy. Geometry (ie, 3DS or Blender or whatever files) can be loaded, manipulated, and displayed in much the same way.
The idea behind using one of these APIs is that it's very easy to be cross platform. Write your code once, compile it with a Windows target with Windows libraries, and you get a Windows executable. Recompile the exact same code with Linux libraries and you get a Linux executable. Or so the theory goes, anyway.
I like Irrlicht, if that helps. I've also used Ogre, and it's very good and can do basically the same things, so I can't suggest not using it. Look at the syntax of both, and decide which one feels better, which is more like something you'd write.

That being said, there is something to be said for using OpenGL directly, if you want absolute control over the way everything is rendered. Sometimes the engine your using doesn't do things in quite the way you want them to in which case you have to fall back on the low level OpenGL and specify triangles and all that jazz yourself. Or maybe you're just a control freak and like the idea of controlling vertices one by one :p
 
Last edited by a moderator:
stephen0205 said:
There are a lot of great 3D engines (of varying complexity) that handle all the specifics of rendering for you.

could someone explain that in more detail, which engine would work on the pandora which would do some specific rendering ?

Well, it's like this...

The Quake engine is the engine that drove Quake I. If you want to make a low-poly shooter game that's lacking in features by modern standards, definitely go for this one.

ID Tech 1 is the engine that drove Doom and similar games. You can't even look up or down.

ID Tech 2 is the engine that drove Quake II. It's also quite obsolete IIRC.

ID Tech 3 is the engine that drives Quake III. It has some really cool features, but it only uses MD3 and BSP formats, which really limits your modelling endeavors.

Axiom is apparently a .NET binding to OGRE.

OGRE and Irrlicht are the two big rendering engines that everyone mentions when discussing cross-platform (Linux) gaming.
I haven't had good luck with either, but maybe that's just me.
They have both really cool shader stuff, and I know at least Irrlicht has an ES 1.1 renderer already, so it should work, but without shaders. OGRE might also have an ES 1.1 renderer, because I think Irrlicht and OGRE both targeted the iPhone a little while ago. I dunno, I wasn't really paying attention.

So, yeah. Download OGRE, download Irrlicht, read the tutorials, and screw around with both of them until one works. Then use that.
I got Irrlicht to do some basic stuff pretty easily, but the input system kinda confuses me. I should really get back to it. I think it misses me. :/

Yes, there is a lot to be said for using direct OpenGL. Especially if you're crazy and want to do things your way regardless of how impractical that is. For instance, I'm using direct OpenGL in SDL for SDL's straightforward input handling, and I've written my own model loader that loads Lua scripts as models. That's the kind of insanity you won't find in a graphics engine, although you could probably write that into any of the more modular ones like OGRE or Irrlicht. I just haven't bothered.
 
Last edited by a moderator:
well thanks for all the advice, ill defiantly check ogre and the other one out. anything to make life a little easier for writing a mini game is a kick in the right direction if you ask me. Thank you to everyone who helped me
 
i'm not getting the whole 'engine vs API' dilemma in this thread. at the end of the day you will want to know both (i.e. the API and then some engine).

GL has the advantage of giving you an understanding of how things work - 1.x for the fixed pipeline, and 2.x for the shader pipeline, respectively (don't assume you can be a good graphician without such an understanding). actually, knowing how things work at the back will give you a better appreciation and understanding of what a 3d engine actually does for you. so make sure you get to know the API as well - get to those tutorials, read the book. last but not least, brush up your linear algebra.
 
darkblu said:
i'm not getting the whole 'engine vs API' dilemma in this thread. at the end of the day you will want to know both (i.e. the API and then some engine).
It's not a dilemma, what you've said is exactly what I said the first time. Learn the API so that you at least understand what it's doing, but you don't need to focus on it. No harm will come if you don't know how to use OpenGL: you don't need to be able to program in assembly to be a good programmer, but it can help with some design decisions.
 
Last edited by a moderator:
WizardStan said:
you don't need to be able to program in assembly to be a good programmer, but it can help with some design decisions.
I'm sorry to read that, I think if one has no understanding of architecture and assembly language, (s)he can't be a really good programmer.

In that particular case of using a graphics engine, if you don't know how the hardware limits you (a trivial example, texture size or depth), or what requires many GL calls (hidden by your engine), you'll soon hit a performance wall.

I agree not everyone needs good knowledge of all that, but that's certainly a plus which makes a difference :)
 
Last edited by a moderator:
Laurent said:
WizardStan said:
you don't need to be able to program in assembly to be a good programmer, but it can help with some design decisions.
I'm sorry to read that, I think if one has no understanding of architecture and assembly language, (s)he can't be a really good programmer.

In that particular case of using a graphics engine, if you don't know how the hardware limits you (a trivial example, texture size or depth), or what requires many GL calls (hidden by your engine), you'll soon hit a performance wall.

I agree not everyone needs good knowledge of all that, but that's certainly a plus which makes a difference :)
You can be a good programmer without knowing assembly or even architecture if you have high quality standards from the best industry practices and you're not lazy. It just becomes too hard because you have to try things and not almost knowing already the results. The path on prediction and trying&trying can get you there, just don't expect free time and good communication with other good programmers.
If you want to be exceptional without those it's impossible. You learn architecture and assembly to save time - the fog almost disappears, without them you can barely see anything. But then again maybe you like magic too much...
 
Last edited by a moderator:
so basically if you learn the code for the engine, and not the opengl, it will still be supported but it will be easier to learn ?
 
Laurent said:
I'm sorry to read that, I think if one has no understanding of architecture and assembly language, (s)he can't be a really good programmer.
I'm sorry you think that, because there's an entire generation of programmers coming up that have no formal training in assembly, but are still taught general best practices. It wouldn't surprise me if some of your coworkers have never programmed in assembly. Ask them sometime. I know a lot of Java programmers that have never even looked at machine code. Web programmers certainly don't need to care about specific architecture: the abstraction is so great by that point that too much reliance on assembly knowledge could be a hindrance.
I stand by my statement: it's entirely possible to be a good programmer, applying best practices in everything you do, without knowing a single line of assembly.

stephen0205 said:
so basically if you learn the code for the engine, and not the opengl, it will still be supported but it will be easier to learn ?
Yes, that's the idea. Ignore the side discussion about assembly vs high level knowledge, just focus on finding the tool that works best for you.
 
Last edited by a moderator:
maybe you should take it like this:
IF you will invest a lot of time you get to chose
a. you learn the API and you'll be certain you'll understand it if the documentation+forum doesn't cover it good enough
b. you learn the engine and when you're stuck you're on hold until you understand it (& have mood & have time)

IF you don't plan to invest too much time just get to the engine if you want to make something or to the API if you want to get education.

Just looking to join in with the community, get into programming somemore and develop something i can use on my pandora.
If this is really important you already choose engines and forget books (they will not get you in communities, you will)

It's not really a question of starting, it's about what somewhat guaranteed results you want and what resources you will make available for those.

I stand by my statement: it's entirely possible to be a good programmer, applying best practices in everything you do, without knowing a single line of assembly.
This doesn't mean you will have reusable code in the sense the user/victim will enjoy your work if (s)he want to use the hardware for other tasks. You apply best practices because otherwise you will lose the chances for being possible to be a good programmer. You still need to have a serious level of math.
You need to have an understanding of architecture and assembly to have most users not feel like victims, especially power users. The rest can only say (without lying) 'it should work', 'there's no industry standard to make it better'.

just focus on finding the tool that works best for you.
I agree with only this part of that statement. It appears stephen0205 is unsure of long term commitment.

Too make sure I make it clear:
How much you're comfortable to learn/work alone? If it's a high level you should start with the API (just testing it for a week or two) and then get to 'whatever'.
 
trendy said:
This doesn't mean you will have reusable code in the sense the user/victim will enjoy your work if (s)he want to use the hardware for other tasks. You apply best practices because otherwise you will lose the chances for being possible to be a good programmer. You still need to have a serious level of math.
I don't disagree with this. You are correct: using best practices doesn't automatically make your code good, but at the same time I am saying that not knowing assembly does not automatically make your code not good.
 
Last edited by a moderator:
WizardStan said:
Laurent said:
I'm sorry to read that, I think if one has no understanding of architecture and assembly language, (s)he can't be a really good programmer.
I'm sorry you think that, because there's an entire generation of programmers coming up that have no formal training in assembly, but are still taught general best practices.
I stopped teaching at the University 8 years ago because students were not interested any more in computer architecture and low-level things. Out of 100 students I had, 3 or 4 of them showed a real interest in what I was trying to explain (basically microprocessor stuff needed to write compiler back-ends). The rest was here because there was an exam at the end of the year. Their only interest probably was to drag boxes in some Java IDE. That was very different from the courses I gave 12 years ago where more than 50% of the students were really interested because they felt the need to understand how things work at all levels.

It wouldn't surprise me if some of your coworkers have never programmed in assembly. Ask them sometime.
All my coworkers are very good at assembly programming. And they'd better be good at that, since we design CPU's ;)

I know a lot of Java programmers that have never even looked at machine code. Web programmers certainly don't need to care about specific architecture: the abstraction is so great by that point that too much reliance on assembly knowledge could be a hindrance.
I stand by my statement: it's entirely possible to be a good programmer, applying best practices in everything you do, without knowing a single line of assembly.
Ask these programmers to enter the game programming industry. I know some PS3 developers, and they all are extremely talented, with knowledge that ranges from graphics algorithm design (BTW I guess that since asm programming isn't needed, math isn't either) to tricky details of instruction scheduling and branch prediction.

Obviously my original claim was probably slightly harsh. There are many domains in CS that don't require low level knowledge. But anyway all the people I know who are considered as very good in their domains (from DB to Java) have some low level knowledge that is very needed for them, and make them different from the crowd who has no clue about how things work.

All of that is my point of view. Assembly and computer architecture knowledge certainly aren't a prerequisite to become a programmer, but I consider them as a requirement that should be learned at some point.

@stephen0205: Sorry for getting out of topic. If you want to learn the basics of game programming, you certainly should use an existing engine that will make your learning easier. When you'll feel comfortable with it, and if you like programming, you'll then have time to learn more complex things including OpenGL and, why not, assembly :)
 
Last edited by a moderator:
Back
Top