OpenGL Experience

Sep 18, 2011 at 12:10am
Well I've decided to take this fine saturday and learn OpenGL. It's been great, I've learned a ton, I've run into issues (as expected) and I'm wondering, You wonderful forum members of course have experience in said specification, And I'm wondering, how much? How long have you been working with OpenGL? Any tips coming from my infinitesimally easier 2d environments?
Sep 18, 2011 at 1:21am
how much? How long have you been working with OpenGL?

I took two graphics courses, one in undergrad that taught basic OpenGL, and one at the graduate level that didn't focus on any one API at all though I used OpenGL in my project. At work, OpenGL is required every so often but not as much for me to call myself an expert. I would probably call myself "intermediate" at best.

I really should find some time/motivation to work on my hobby project:
http://www.youtube.com/watch?v=HLrF7Gsj8b0

Any tips coming from my infinitesimally easier 2d environments?

First I would say pick up GLUT and use that for windowing/keyboard/mouse handling if you're not using it already. It really helps to focus your code on the graphics vs all the extras.

Just like every other language it may seem daunting at first, but really at this point just focus on getting the little things working (getting something displayed on screen, getting multiple things displayed on screen, getting things moving around/rotating, adding basic camera movements, etc.) And don't be surprised if your code looks like a patchy mess when you're starting off (this is a C API after all). Again I would say get it to work first before prettifying it.

Usually people recommend getting at least the "Red Book" and getting the "Orange Book" for when you do shader development. I have a(n outdated) copy of the Red Book, and honestly I've barely cracked it. So far, all problems I've had have been answered by a quick (and sometimes not-so-quick) Google search. The most helpful sites for me have been OpenGL.org and GameDev.Net. The forums at OpenGL.org are great and their reference pages are invaluable. NeHe's tutorials are also very helpful.

http://www.opengl.org/sdk/docs/man/xhtml/
http://nehe.gamedev.net/
http://www.gamedev.net/forum/25-opengl/
http://www.opengl.org/discussion_boards/
http://www.opengl.org/documentation/red_book/
Last edited on Sep 18, 2011 at 1:25am
Sep 18, 2011 at 2:09am
I took two graphics courses, one in undergrad that taught basic OpenGL


Did you find the classes worth taking? I have yet to take a computer class, but I know I could learn a lot if I had a decent teacher- but my local uni has a single programming teacher who is ... not fantastic.

First I would say pick up GLUT and use that for windowing/keyboard/mouse handling if you're not using it already. It really helps to focus your code on the graphics vs all the extras.


I think that's a good idea, I'm currently using SDL as input/window handling/ texture loading and it seems to be working quite well.


Thank you for your reply, that definitely does help in the direction I'm trying to go. So far I have some simple little square/2d object creation/texture mapping and a cube creator. My camera movement is... haha crap. So far i've got my rotation set up on all three axis, however it's very cumbersome.

I got a simple tilemap set up, with some grass textures, so it's nice to have a sort of grounding (pun intended) on where I am.

I think next I'll upgrade my camera movement, and perhaps work on some matrix math (oh yay) so I can do some custom transformation stuff.

Your asteroids game looks like it has some potential, I hope you do get to work on it!

(Oh and as a sidenote, I love openGL, seriously, I didn't realize how much I was missing out on)


Sep 18, 2011 at 6:41pm
Did you find the classes worth taking?

The undergrad course was definitely worth taking. The prof essentially gave us a skeleton game engine (C++) and the assignments were to fill it in. The first assignment was to load and display a "level". The second assignment was to add a sky box in our level and to make it move when the player stepped in trigger boxes. The third assignment was loading and displaying a height map. The fourth assignment was to add static collision detection and gravity into our level, and the last assignment was to add a neat feature of our choosing to the engine. Before I took the class I knew how to program in C++, but I didn't know a thing about OpenGL and I had no idea where to start programming a game engine. That course filled in the gap for me.

The grad course I found was not worth taking unfortunately. All our assignments except the last one were to pick a research paper on some area of graphics, disseminate and summarize it and then present our summary to the class. Our last assignment was just to pick something advanced and to program it. The whole thing felt pretty ad-hoc. I don't know if it was because my school was more research oriented but I felt this class should have focused more towards latest advancements (and implementing them) as opposed to focusing on well-established theory and research-based assignments.

So far I have some simple little square/2d object creation/texture mapping and a cube creator. My camera movement is... haha crap...I got a simple tilemap set up, with some grass textures

This is really good progress for just starting out. Good luck on this and your future OpenGL projects.
Sep 20, 2011 at 1:17pm
Oh I do have a question, when you started with your class, were you initially taught immediate mode? Or did they delve into vertex arrays / VBOs?

I was told to look into this documentation:
http://arcsynthesis.org/gltut/index.html

And it was super helpful. Essentially everything being stored in video card memory, and after reading this post:
With the array in GPU memory, vertices can be read at full framebuffer bandwidth (> 100 GB/sec on high-end GPUs). Without this, you're limited to PCI-e 16x, which is ~2.5 GB/sec.


I've decided that 40x faster read times are well worth learning to use all of the tools available.

At the moment I'm learning matrices so I can freely transform/rotate/scale/skew my objects, once that's done I plan on making some extremely simple environments and test my polygon limit, then I want to make some interactive environments to play with. I also have plans of using some extremely simple openglES 2d ortho views for some advanced IOS programming. Exciting times.
Sep 21, 2011 at 1:23am
when you started with your class, were you initially taught immediate mode? Or did they delve into vertex arrays / VBOs?

The class focused on graphics concepts and OpenGL was mostly an afterthought, unfortunately. They taught us about the matrix stack, the state machine, etc. but most of the nitty gritty was up to us for when we filled out the "engine". I don't recall any slides showing actual drawing code if you believe it, though if there were any they would've been all immediate mode (easy to teach and to get started with). Nothing in the course slides or the engine touched vertex arrays / VBOs (and there was not even a peep about shaders).

I've decided that 40x faster read times are well worth learning to use all of the tools available.

They're a must learn. Immediate mode is only good for falling back in case of crappy hardware and for when real time is not an issue. Though frankly, targeting old hardware is rarely a necessity and when is real time not an issue?

Exciting times.

Sounds like you have a lot of fun ahead of you. I should probably work on my own stuff as well and not waste so much time on these forums :p
Last edited on Sep 21, 2011 at 3:42am
Sep 21, 2011 at 3:22pm
Though frankly, targeting old hardware is rarely a necessity and when is real time not an issue?


My sentiments exactly.

The class focused on graphics concepts and OpenGL was mostly an afterthought, unfortunately.


Ah sad day, makes sense from a university's perspective to have flexible programs that won't become irrelevant. OpenGL isn't likely going anywhere but I can see some logic.

Sounds like you have a lot of fun ahead of you. I should probably work on my own stuff as well and not waste so much time on these forums :p


Haha, I'm pretty excited. Well time on these forums is occasionally wasted, but I definitely enjoy them =] What are your plans with your project? Do you have any others in mind?

Sep 22, 2011 at 2:29am
Well, right now I'm working on a programming portfolio that I'll have online to help with my chances of getting a job in the game industry. I'm working on getting a networked Tic-Tac-Toe game (written in Java for a senior undergrad course) camera ready so I can add that (executable and source) to the portfolio. I'm hand-coding the portfolio's HTML/CSS/JavaScript.

The 3D Asteroids game will also be part of the portfolio. For now, I feel the video is enough to warrant its inclusion but I will work on sprucing it up and adding its executable and source as well. I'm not going to try to sell it. My plans for the game itself are, in order of importance, (1) adding particle and lighting effects, (2) adding multiple weapons/power ups, (3) adding sound effects, and (4) making it "playable", i.e. start menu, levels, transitions, game over, high score. Whenever I make enough progress, I plan to update its page(s) in the portfolio and add new videos. I'll probably add its executable/source as I go as opposed to when it's "done". Oh yeah, I plan to target both Windows and Linux.

After that, who knows. Programming an FPS seems like it could be a lot of fun. I'm not looking to make a bonafide engine though I'm hoping my code will be re-usable enough. Of course the obstacle to all this is I have a full-time job and programming all day saps my at-home programming energy most days.
Sep 22, 2011 at 3:28am
closed account (1yR4jE8b)
I'm hand-coding the portfolio's HTML/CSS/JavaScript.


sounds painful...you should invest some time in learning Django or Rails. It will make your web-development life much easier.
Sep 23, 2011 at 12:07am
It's essentially going to be my answer for the "Do you know HTML?" interview question. I've been asked if I knew HTML at the hand-code level before and it probably will happen again. I will look into those frameworks for future development, though.
Topic archived. No new replies allowed.