How to learn OpenGL 3.0? [closed] - opengl

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Is there a good book that focuses on the programmable aspect of OpenGL 3.0
I want something like the OpenGL Super Bible, but focusing solely on the "new testament" part -- the programmable rather than the fixed pipeline.

The Orange Book: http://books.google.it/books?id=kDXOXv_GeswC&dq=opengl+shading+language&printsec=frontcover&source=bn&hl=it&ei=KChiS7-_Ityi_QarxsyMDA&sa=X&oi=book_result&ct=result&resnum=4&ved=0CB4Q6AEwAw#v=onepage&q=&f=false

The latest 5th edition of the OpenGL SuperBible does focus only on the core profile. Unfortunately it includes it's own gltools library so most of the start of the book is really more teaching that toolkit rather than the core profile itself, of course it covers the basic overall layout of a modern opengl program and does seem to fill in the harder stuff later. As you progress though it seems you reimplement the crutch library.
The OpenGL Programming Guide (The Red Book) 7th edition, unfortunately seems to be rather dated. They have marked everything that is in the compatibility profile rather than the core, but thats about it.
There is an 8th edition being released in December 2012 that is apparently a rewrite teaching modern approaches.
Realistically it would be best to learn the specific areas on the compatibility profile/OpenGL 2.1 then combine them all together into something that is core profile. Doing it all at once is just too much at once.
First learn Vertex Buffer Objects (and ditch glBegin/glEnd and anything that goes in between).
Learn manual Matrix operations and stack, or an appropriate library (ditch glPushMatrix/glTranslate/glRotate/glOrthagonal/gluLookAt/glFrustum, you may need to use some compatibility stuff to bind your manually processed marices at this stage but you can ditch them with the shader next step)
Learn Vertex & Fragment shaders
Learn how to set the OpenGL context to 3.1+ (Dependant on your windowing system).

The book OpenGL Programming Guide: The Official Guide to Learning OpenGL, Versions 3.0 and 3.1 (7th Edition) was updated and explains the new features of OpenGL 3.0.

If you want a shorter, simpler OpenGL book that covers just the programmable pipeline, I'm going out on limb and recommending OpenGL ES 2.0 Programming Guide. OpenGL ES 2 is a subset of OpenGL, to make it simpler for embedded systems. For most situations where there is more than one way of doing something in OpenGL, the OpenGL ES standard includes only one way. Version 2 of OpenGL ES is for programmable hardware, and therefore includes just the programmable pipeline stuff. Since OpenGL ES is a subset of OpenGL, everything in OpenGL ES will work on an OpenGL implementation. Whereas the "OpenGL Programming Guide" is 936 pages long, the "OpenGL ES 2.0 Programming Guide" is merely 480 pages long.

"The Red Book" was the openGl book when i was studying it, but that was long ago, you'd have to find out if they've continued to update it as far as v3.

Related

Which is better? Starting to Allegro or OpenGL [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I want you to help me for a decision problem.
I am a newbie video game programmer. I can develop Flash, Unity, Android games, and I know a little CryEngine. Also, I want to develop 3D video games in the future.
So, I decided to learn a video game library that I can work with C/C++. But should I learn Allegro or OpenGL or a different library? Or should I directly start to learn DirectX programming? Learning Allegro programming is useful (a good basis) or just a waste of time?
But should I learn Allegro or OpenGL or a different library?
First and foremost: OpenGL is not a library! The 'L' of it once meant library, but it's better to backronym it as "layer", because that's what OpenGL really is these days: A layer between your program and the graphics hardware.
OpenGL is not a game engine, it's not a game graphics library. OpenGL is a low level drawing API. You can use it to draw points, lines and triangles in fancy ways. But there's no scene, no objects and such in OpenGL. All this must be implemented by the game engine. Writing a game engine is very hard work. If you really want to go for this, I suggest you look at the source code of Doom3, which has been released a year ago.
Allegro has almost nothing to do with OpenGL.
Allegro is a basic framework for simple game development providing rudimentary 2D graphic primitives, user input, text, sound, timers, etc... You can use OpenGL under Allegro, but there is no tight and specialized integration.
OpenGL is a low level API, specialized for graphics.
If you already know Unity and CryEngine, stick to them. It would be a tremendous difficulty to implement even a fraction of their features using OpenGL on your own. That doesn't mean you shouldn't learn some OpenGL, even for the sake of curiosity and understanding how stuff works on the low level.
DirectX is platform limited, and while it is true the majority of gaming platforms do support DX, ARM mobile platforms are on the rise, and DirectX doesn't run on them. OpenGL can match pretty much everything D3D has to offer, and it is more portable, so it is the API that is more worth investing in, unless you are centered on Windows games exclusively. Then it would make sense to learn D3D, which is a little easier to use.
Many game engines, including Unity, will abstract away from the graphics API and use the best what the target platform provides.
Also, keep in mind that OpenGL is not available on Windows 8 in "metro" mode, so you will either have to use D3D if you want advanced graphics under metro mode, or use ANGLE and stick to more basic subset of OpenGL that is emulated with ANGLE on top of D3D.

OpenGL 4.1 Learning Resources

What are some good resources for learning OpenGL 4.1 aimed at someone relatively new to graphics programming?
I'm aware that this was asked before, but I would think that ~9 months would give us more.
I know that OpenGL Programming Guide: The Official Guide to Learning OpenGL, Versions 4.1 (8th Edition) is coming out apparently in October, but is there anything else? It seems like there's been some major changes, and I'd hate to feel like my time studying until this book release was wasted. Sites can work too, provided they are focusing on 4.1.
Thank you.
If you want to learn graphics programming properly then OGL 4.1 is the place to start these days, but if as a beginner you want to hack stuff out then i'd advise you take an easier route (DirectX). Your programming skills have to up there and especially your maths skills aswell (linear algebra). Get a copy of the Spec and the Red/Orange and Blue books, a good book on mathematics for 3d graphics and prepare for alot of pain, pure 4.1 from scratch is hard.
Don't worry about not getting the latest edition of the red book, 3.3->4.1 didn't change a huge amount in terms of new features or paradigm, mainly just removing deprecated functionality.
Mesh loaders can be fulfilled by OpenCTM, GXBase is also quite good.
Don't bother learning OGL prior to 4.1, it's based on a deprecated paradigm and so you will waste time learning stuff that is officially out of date. The super bible has a good amount of code that will help you along the way.

Where can I find a good online OpenGL 3.0 tutorial that doesn't use any deprecated functionality? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I just purchased the fifth edition of the OpenGL SuperBible. I'm very pleased that they've avoided using deprecated functionality but their examples make use of GLTools. GLTools provides a slew of useful functions for rendering simple 3D objects and managing the view frustrum, camera, and transformation matrices.
This is all great but the abstraction provided hides low-level details and I'm having difficulty moving to code where I can't use GLTools -- for example, pyopengl. The vast majority of tutorials I've seen online make use of immediate mode, which I'm trying to avoid. Those that use glDrawArrays make use of glEnableClientState, which I'm also trying to avoid.
What I'm looking for is introductory tutorials that are fully OpenGL 3.x compliant. If that's too tall of an order, perhaps a laundry list good "starting point" functions would be in order.
Stay away from NeHe, the tutorials are hopelessly outdated and contain a lot of "problematic" stuff, too.
For starting with 3.x, try those, they're both up-to-date:
Aurian (Joe Groff)
Arcsynthesis (Jason L. McKesson)
Update:
Re-reading my own post almost 2 years later, I guess that one might find that it sounds a bit harsh.
This is of course not the intent. The core message (which remains valid) that I wanted to give was that NeHe still deals with OpenGL 1.x/2.x and uses some unsupported "antique" libraries.
Generally, as such, this does not mean the tutorials are necessarily bad, but starting from there will mean starting two generations behind the current state-of-the-art, and one generation behind the minimum one should learn. Learning legacy OpenGL will, at a later time, require you to forget almost everything you know and re-learn from scratch.
That said, the NeHe front page now links to a tutorial focussed on OpenGL 3.3 by Damien Mabin, which looks quite nice at first sight (though I will not have time to thoroughly read through it before new year).
https://bitbucket.org/rndblnch/opengl-programmable
a short step by step tutorial to OpenGL programmable pipeline (OpenGL / OpenGL|ES 2.x) for people already familiar with the fixed pipeline. dependencies: python 2.5+, PyOpenGL 3.0.1+
Successive versions of a small but rather complete glut/opengl program that starts from direct mode and is transformed step by step to run exclusively on the programmable pipeline.
Look at the diffs between successive version to have an highlight of the changes needed (e.g., https://bitbucket.org/rndblnch/opengl-programmable/changeset/b21131e37ed7).
Here is a serie of OpenGL 3.3 tutorials for Windows, that doesn't use any of deprecated functionality, only new stuff:
Megabyte Softworks OpenGL 3.3 Tutorials

OpenGL 4.x learning resources [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I know there are some question about learning OpenGL.
Here is what I know:
math for 3D
3D theory
Here is what I want to know:
- OpenGL 4.0 Core profile (or latter)
- Shader Language 400 (or latter)
- every part of above (if it do not work across vendors then it still do not bother me)
Here is what I DO NOT want to know
- fixed function pipeline (will not use it ever!)
- older OpenGL's
- Compatibility profile
I prefer bigger portion of info like tutorials, series of articles, books.
PS If you know resources on opengl 3.x core profile, post them too
I cordially dislike negative answers, but I'm afraid I have to give one to this question.
You are ultimately asking for beginner material that uses features unique to OpenGL version 4.0 and above. Well, let's look at some of the unique features of 4.x.
Perhaps the biggest feature is tessellation. What does that mean? It means tessellating primitives to generate more primitives. Before one can even begin to understand what that means, one must first understand how primitives get rendered at all. That uses pre-4.x level features.
But even with a firm understanding of how rendering works, there is still a problem. In order to have any meaningful discussion of tessellation shaders, one must first have a strong understanding of tessellation algorithms. And that is not a simple subject. For a tutorial to teach a user to use tessellation shaders, the tutorial will first have to introduce spline curves and patches or subdivision surfaces. Both of these are lengthy topics that have numerous white papers devoted to them. Only after detailing the algorithms would a user be ready to see how those algorithms are implemented in the tessellation shader.
Or, to put it another way, tessellation shaders are not beginner material. I wouldn't even qualify them as intermediate-level material.
Another big feature of 4.x level hardware is shader image load store (and its companion, atomic counters), core in 4.2. It allows for some very nifty things, including order-independent transparency. However, in order for a user to even begin to understand all of the quirks around it, the user needs to be intimately familiar with the deep workings of modern shader hardware. So any tutorial would first have to explain how modern VLIW/SIMD-based hardware works, as well as how shaders are used with such hardware. Again, this is not trivial material.
Another big feature of 4.x hardware is indirect rendering. That is, putting the parameters to a glDraw call in the buffer object itself. The problem is that there is really only one reason to use this functionality: because the GPU generated data directly into one or more buffers for later rendering. And doing that usually involves some form of GPGPU operation, which is very much not a beginner-level topic.
All of these features are useful and have a real purpose. But none of them should be used by beginners; in some cases, not even intermediate-level programmers should touch them.
Now to be completely fair, there are some 4.2 features that are both non-hardware-based (so they are often implemented on 3.3 and lower versions) and quite useful. Separate program objects, for example. These features hit while I was writing my 3.3-based tutorials, and I considered going back over them and incorporating this functionality. The only reason I didn't is because implementations (drivers) are still not entirely stable with regard to this functionality. But it would be useful to do.
The main point I'm getting across is this: if you are at the stage in your graphics knowledge where you are ready to take advantage of the unique features of GL 4.x hardware, then you also have enough graphics experience that you don't need an explicit step-by-step instructional material to implement features of graphics hardware. You would be the kind of person who could read the GL_ARB_tessellation_shader extension specification and understand how to make them do what you need to.
That being said, if you are interested in material that teaches OpenGL core 3.0 or better, the OpenGL Wiki has a nice collection of such links. In the interest of full disclosure, I did write one of them.
The 5th edition of OpenGL SuperBible has been recently released. This edition reflects OpenGL 3.3 which was released at the same time as OpenGL 4.0, the book only covers the core profile and assumes no prior OpenGL knowledge.
That's what I got from the book's description anyway. I have the 4th edition and it's an excellent resource for OpenGL 2.0, so I assume the new edition along with the latest OpenGL Shading Language book would be just what you're looking for.
Durian Software has an ongoing series of tutorials covering modern OpenGL. They are aimed at OpenGL 2.0 but avoid using any deprecated functionality in later versions.
There is really very little difference between OpenGL 3.0 and 4.1. If you stick to 3.0 or later core profile, you can't use the fixed function pipeline. What you're really asking for is an OpenGL tutorial that does not use the fixed function pipeline.
Jason L. McKesson's excellent tutorial "Learning Modern 3D Graphics Programming" starts out using shaders for the very earliest basics, and never touches the fixed function pipeline.
http://www.arcsynthesis.org/gltut/index.html
I highly recommend it.
I recently stumbled on this online book:
OpenGLBook.com
I haven't read it yet, but description says that it is a free OpenGL 4.0 programming resource in online book format.
Excellent question, really. As a matter of fact, documentation is sparse.
There is a good introduction here : http://sites.google.com/site/opengltutorialsbyaks/
You may also like groovounet's ogl4 samples pack : http://www.g-truc.net/post-0310.html
but I'm afraid that's pretty much it. Lurk on the opengl discussion boards for more info ...
EDIT : found a few seconds ago. Straight from SIGGRAPH http://nvidia.fullviewmedia.com/siggraph2010/02-dev-barthold-lichtenbelt-mark-kilgard.html
http://www.opengl.org/sdk/docs/man4/
There's the man pages for OpenGL 4.1, they prove to be useful when developing.
I think one of the best hopes you have is Joe's Blog. It has a few good introductory articles on modern OpenGL, with more (supposedly) on the way.
Swiftless is updating tutorials to include new context. A good starting tutorial that has been more straight-forward regarding a quick and simple VAO, VBO and render is located at swiftless.com
Have not read it, but OpenGL 4.0 Shading Language Cookbook
The major point of OpenGL 4 is tesselation so i would like to recommend to start from a standalone tutorial on OpenGL 4 tesselation, i.e: http://prideout.net/blog/?p=48
After manuals and tutorials a good follow-up is to take a look at the open-source engines out there that are based on top of "new" OpenGL 3/4. As one of the developers, I would point at Linderdaum Engine.
free resource:
http://www.arcsynthesis.org/gltut/index.html

Is there any decent OpenGL SceneGraph API/framework? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am new to OpenGL.
Wondering if there is any good Scenegraph API/framework for OpenGL.
At the moment I am using glut with a custom node based solution: I am setting children and siblings for each node the calling a traverse function.
I'd like a more flexible solution when it comes to managing dynamic elements in the scene.
SDL is a bit more up to date than glut, but you are on the right track with rolling your own graph structure to manage scenery. There are plenty of frameworks available. OpenSceneGraph, for example, has been around for quite awhile now. OGRE has a large following as well. However, it is not a strictly OpenGL library as DirectX and software renderers are also available.
You may want to look into related topics like binary space partitioning, quadtrees/octrees and kd-trees.
I agree that openscenegraph is a great scenegraph. It is written i C++ and has bindings to some other languages, but not for .NET as far as I know. We were in the situation to use something more than plain old opengl and were looking at managed directx, xna, wpf and opengl. We chose to write our own scenegraph based on Tao.OpenGL as opengl.
You can accomplish dynamic objects by having an update phases before the culling and rendering stages. If you do multi-threaded you need to be careful with the update stage.
There are plenty of libraries treating this topic. Here some of my favorites:
VTK - extremely suitable and open source
Coin3D - very good commercial scene graph
OpenSG - just for completeness :-)
I second (third?) the use of OpenSceneGraph. It is robust and cross platform, and integrates well with Qt (our application runs on MacOS, Windows, and Linux using OpenSceneGraph and Qt together). The documentation may not be as polished as a commercial option, but there's a book you can buy (and a free Quick Start Guide) that really helps.