Sign in to follow this  
JosephParrilla

OpenGL Best openGL resource

Recommended Posts

JosephParrilla    171
Hey Guys,

So I know that the NeHe website is very popular for learning openGL. Ive done some reading and it seems like there were major changes regarding a fixed function pipeline vs shaders, etc. Im not exactly sure of the details. My question is, is the info on NeHe up to date for the version of openGL I should be focusing on, or is there a better resource? I am eventually accessing openGL thorugh LWJGL, but I am probably going to learn through C++ since its easier to find examples in it. I can always use Java and LWJGL later, its basically the same. I am basically looking for beginner tutorials, which are easy to find, but I dont know enough about what version of openGL I should find tutorials on. I wouldnt even know if I was using the right one or not since I really dont know the difference.

Share this post


Link to post
Share on other sites
fluffybeast    132
NeHe is deprecated, in newer OpenGL you have no fixed function pipeline and have to write shaders yourself. A lot of the old API calls are removed in OpenGL 3/4, which means that you have to do more of the work yourself, like creating your own matrices etc...

There is a large tutorial on it [url="http://arcsynthesis.org/gltut/"]here[/url] (haven't checked it out myself, though. ) You should also check out the [url="http://www.opengl.org/sdk/docs/man4/"]OpenGL documentation[/url], which I use a lot myself since it tells you what the different API calls do.

Share this post


Link to post
Share on other sites
JosephParrilla    171
[quote name='fluffybeast' timestamp='1310505287' post='4834508']
NeHe is deprecated, in newer OpenGL you have no fixed function pipeline and have to write shaders yourself. A lot of the old API calls are removed in OpenGL 3/4, which means that you have to do more of the work yourself, like creating your own matrices etc...

There is a large tutorial on it [url="http://arcsynthesis.org/gltut/"]here[/url] (haven't checked it out myself, though. ) You should also check out the [url="http://www.opengl.org/sdk/docs/man4/"]OpenGL documentation[/url], which I use a lot myself since it tells you what the different API calls do.
[/quote]

Ahh I figured that much, the dates on the articles are really old. I cant get that link to work, are theyre any books/tutorials that cover the new stuff? I dont want to learn information that isnt up to date. What about those big openGl bibles on Amazon?

I must say Im going to need more than just the API documentation. Im really new to graphics programming so I would prefer some explanations. I dont need my hand held, but a nice organized tutorial with examples and explanations would really help.

I can probably find this stuff myself, so what exactly is the difference between the old and new openGL? If I know the difference, I will have an easier time knowing if a particular tutorial I find is outdated. Im sure there are a ton out there, I just dont want to use an old one.

EDIT: That link is fine, just blocked at my job.. its categorized under PORN lol... strange.

Share this post


Link to post
Share on other sites
mhagain    13430
A general rule of thumb is that if a tutorial contains calls to glBegin, glEnd and/or any of the glTexEnv functions then it's old and you should avoid it. There's a slight grey area where OpenGL made a transition from old to new (1.5 with extensions, 2.0, 2.1) which can muddy things a little. A danger is that you may find a few such tutorials or resources and end up using a somewhat outdated API that looks on the surface as if it [i]could[/i] be new-style, but in reality has since been superseded. Have a read of the arcsynthesis link posted above; it is really quite good and gives some background info which is written a lot better than I could do. Specific details on differences in how old vs new operate probably won't make sense to you right now as you'll need some grounding in 3D graphics terminology to understand such an explanation.

Share this post


Link to post
Share on other sites
PrestoChung    334
Wiki it

[url="http://www.opengl.org/wiki/Main_Page"]http://www.opengl.org/wiki/Main_Page[/url]

Here's the reference pages

[url="http://www.opengl.org/sdk/docs/"]http://www.opengl.org/sdk/docs/[/url]

Cheers

Share this post


Link to post
Share on other sites
V-man    813
[quote name='mhagain' timestamp='1310508670' post='4834538']
A general rule of thumb is that if a tutorial contains calls to glBegin, glEnd and/or any of the glTexEnv functions then it's old and you should avoid it. There's a slight grey area where OpenGL made a transition from old to new (1.5 with extensions, 2.0, 2.1) which can muddy things a little. A danger is that you may find a few such tutorials or resources and end up using a somewhat outdated API that looks on the surface as if it [i]could[/i] be new-style, but in reality has since been superseded. Have a read of the arcsynthesis link posted above; it is really quite good and gives some background info which is written a lot better than I could do. Specific details on differences in how old vs new operate probably won't make sense to you right now as you'll need some grounding in 3D graphics terminology to understand such an explanation.
[/quote]

Yes, but even when you reach shader land (GL2.0 and above), there are some big differences.
With GL 2, you can use built-in attributes, built-in varyings, built-in variables and with fixed function parallels like glLoadMatrix and other matrix calls and glTexGen, glLight, glTexEnv, glMaterial, glColor.
With GL 3.0, 3.1, 3.2, 3.3, further changes came along. You have "core context" and "forward compatible context".
GL is a rather complex beast. Try to find some GL 3.3 tutorials which cover "forward compatible context".GL 3.2 would be fine as well as long as you use VAO everywhere. GL is pretty much stabilized now.
Let's hope they get rid of the bind to modify issue in GL 4.2

Share this post


Link to post
Share on other sites
Aks9    1499
Friendly advice: Take a look at proposed tutorial, or even better - grab some good book!

- OpenGL ES 2 Programming Guide is an excellent one.

- OpenGL Superbible 5th Edition is also great (but with too many basic stuff for my taste).

- OpenGL Shading Language 3rd Edition - great book but not for beginners.

Share this post


Link to post
Share on other sites
JosephParrilla    171
[quote name='Aks9' timestamp='1310587793' post='4834971']
Friendly advice: Take a look at proposed tutorial, or even better - grab some good book!

- OpenGL ES 2 Programming Guide is an excellent one.

- OpenGL Superbible 5th Edition is also great (but with too many basic stuff for my taste).

- OpenGL Shading Language 3rd Edition - great book but not for beginners.


[/quote]

The superbible was the book I was considering. It says it covers up until version 3.3, is that up to date enough?

Share this post


Link to post
Share on other sites
Butabah    100
Avoid deprecated functionality.

One thing that will make everything easier is if you try and create a framework as you move along,

i.e.

I created an object with hard code,
Then I created code to make the object for me,
Now I can have hundreds of objects on screen.

I created a shader\program object with hard code,
Then I created code to do all the compiling, linking, for me.
Now it's much easier for me to make shaders.


Just START SLOW, Don't move on until you understand something.

Share this post


Link to post
Share on other sites
Aks9    1499
[quote name='joeparrilla' timestamp='1310588819' post='4834979']
The superbible was the book I was considering. It says it covers up until version 3.3, is that up to date enough?
[/quote]

Yes!


The only "fancy" thing that is missing is - the tessellation shaders (OpenGL 4.0).

There is also some other stuff in GL 4.0/4.1 but they are not crucial for understanding main concepts.

Share this post


Link to post
Share on other sites
JosephParrilla    171
[quote name='Aks9' timestamp='1310589420' post='4834983']
[quote name='joeparrilla' timestamp='1310588819' post='4834979']
The superbible was the book I was considering. It says it covers up until version 3.3, is that up to date enough?
[/quote]

Yes!


The only "fancy" thing that is missing is - the tessellation shaders (OpenGL 4.0).

There is also some other stuff in GL 4.0/4.1 but they are not crucial for understanding main concepts.


[/quote]

Gotcha, I think thats gonna be the one then. It got pretty good Amazon reviews.

Share this post


Link to post
Share on other sites
enunes    123
I like this one:

http://duriansoftware.com/joe/An-intro-to-modern-OpenGL.-Table-of-Contents.html

It was quite easy to follow, though I had already used some fixed functionality before.
I'm not sure if it's easy to catch for a starter, but at least it states no previous OpenGL experience is required...

Share this post


Link to post
Share on other sites
bluntman    255
If I can just add a two bits of info that could help you greatly while trying to understand what is wrong with the programs you are going to make:
1) OpenGL is a state machine. Always keep this in mind, remember to bind objects before you attempt modify them, and don't bother trying to use OpenGL across multiple threads (single thread for all OpenGL operations).
2) Use gDEbugger to quickly identify errors in your OpenGL calls, and to easily view the current OpenGL state (textures, shaders, variables, bound objects etc.)

Share this post


Link to post
Share on other sites
MichaelDwan    322
I've read often that the SuperBible 5 is really biased toward the author's GLToolKit or whatever its called. I understand what they were going for in order to introduce graphics programming, but its an OpenGL book, I don't really see the logic in wrapping OpenGL. Unless of course the ToolKit is built and explained during the book's progression.

I think, if what I've read of the SB5 is true, that, maybe a better route (besides the two ebooks posted earlier which are very good,) is something like the Orange Book(OpenGL Shading Language) and OpenGL ES 2.0 Programming Guide.

Share this post


Link to post
Share on other sites
JosephParrilla    171
[quote name='The_Doc' timestamp='1310751549' post='4835730']
I've read often that the SuperBible 5 is really biased toward the author's GLToolKit or whatever its called. I understand what they were going for in order to introduce graphics programming, but its an OpenGL book, I don't really see the logic in wrapping OpenGL. Unless of course the ToolKit is built and explained during the book's progression.

I think, if what I've read of the SB5 is true, that, maybe a better route (besides the two ebooks posted earlier which are very good,) is something like the Orange Book(OpenGL Shading Language) and OpenGL ES 2.0 Programming Guide.
[/quote]

yes most of the negative reviews say this.... which totally confuses me. If its an openGL intro book, why in the world would they wrap openGL and teach that? It doesnt make sense to me.

Share this post


Link to post
Share on other sites
MichaelDwan    322
Exactly.

I guess it may be a misunderstanding. That is, perhaps the reviewers mean that the authors spend 7 chapters DEVELOPING the GLToolKit (the ins and outs) instead of going straight to GLSL. But that would mean the tool kit has shaders in it, which leads me to think they are indeed just black boxing the whole thing. I was hoping someone here had read it and could shed some light on it.

The two ebooks linked, I think, would do a good job of filling in the holes the SB5 would inevitably leave. So, I think it would still be a safe investment, I'm just boggled as to how a thousand page book would feel the need to approach the material that way.

Share this post


Link to post
Share on other sites
arthurw    102
Nothing like suggesting something you yourself aren't willing to do, [i]but [/i]I'll go ahead and do it anyway...

It'd be great if someone went and rewrote the NeHe tutorials using only the OpenGL 3+ core profile only. I'm sure it'd immediately become a very popular site.

(By the way, I completely agree with the last couple posts. It understand why it happens, but it's frustrating when tutorials, books, lessions, etc. develop a framework or toolkit when they claim to be about learning the core API. Sure, to get to some advanced features you'll need to reuse some code, but limit it to functions, not frameworks - and write out the API calls full in when possible!)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Similar Content

    • By tyhender
      Hello, my name is Mark. I'm hobby programmer. 
      So recently,I thought that it's good idea to find people to create a full 3D engine. I'm looking for people experienced in scripting 3D shaders and implementing physics into engine(game)(we are going to use the React physics engine). 
      And,ye,no money =D I'm just looking for hobbyists that will be proud of their work. If engine(or game) will have financial succes,well,then maybe =D
      Sorry for late replies.
      I mostly give more information when people PM me,but this post is REALLY short,even for me =D
      So here's few more points:
      Engine will use openGL and SDL for graphics. It will use React3D physics library for physics simulation. Engine(most probably,atleast for the first part) won't have graphical fron-end,it will be a framework . I think final engine should be enough to set up an FPS in a couple of minutes. A bit about my self:
      I've been programming for 7 years total. I learned very slowly it as "secondary interesting thing" for like 3 years, but then began to script more seriously.  My primary language is C++,which we are going to use for the engine. Yes,I did 3D graphics with physics simulation before. No, my portfolio isn't very impressive. I'm working on that No,I wasn't employed officially. If anybody need to know more PM me. 
       
    • By Zaphyk
      I am developing my engine using the OpenGL 3.3 compatibility profile. It runs as expected on my NVIDIA card and on my Intel Card however when I tried it on an AMD setup it ran 3 times worse than on the other setups. Could this be a AMD driver thing or is this probably a problem with my OGL code? Could a different code standard create such bad performance?
    • By Kjell Andersson
      I'm trying to get some legacy OpenGL code to run with a shader pipeline,
      The legacy code uses glVertexPointer(), glColorPointer(), glNormalPointer() and glTexCoordPointer() to supply the vertex information.
      I know that it should be using setVertexAttribPointer() etc to clearly define the layout but that is not an option right now since the legacy code can't be modified to that extent.
      I've got a version 330 vertex shader to somewhat work:
      #version 330 uniform mat4 osg_ModelViewProjectionMatrix; uniform mat4 osg_ModelViewMatrix; layout(location = 0) in vec4 Vertex; layout(location = 2) in vec4 Normal; // Velocity layout(location = 3) in vec3 TexCoord; // TODO: is this the right layout location? out VertexData { vec4 color; vec3 velocity; float size; } VertexOut; void main(void) { vec4 p0 = Vertex; vec4 p1 = Vertex + vec4(Normal.x, Normal.y, Normal.z, 0.0f); vec3 velocity = (osg_ModelViewProjectionMatrix * p1 - osg_ModelViewProjectionMatrix * p0).xyz; VertexOut.velocity = velocity; VertexOut.size = TexCoord.y; gl_Position = osg_ModelViewMatrix * Vertex; } What works is the Vertex and Normal information that the legacy C++ OpenGL code seem to provide in layout location 0 and 2. This is fine.
      What I'm not getting to work is the TexCoord information that is supplied by a glTexCoordPointer() call in C++.
      Question:
      What layout location is the old standard pipeline using for glTexCoordPointer()? Or is this undefined?
       
      Side note: I'm trying to get an OpenSceneGraph 3.4.0 particle system to use custom vertex, geometry and fragment shaders for rendering the particles.
    • By markshaw001
      Hi i am new to this forum  i wanted to ask for help from all of you i want to generate real time terrain using a 32 bit heightmap i am good at c++ and have started learning Opengl as i am very interested in making landscapes in opengl i have looked around the internet for help about this topic but i am not getting the hang of the concepts and what they are doing can some here suggests me some good resources for making terrain engine please for example like tutorials,books etc so that i can understand the whole concept of terrain generation.
       
    • By KarimIO
      Hey guys. I'm trying to get my application to work on my Nvidia GTX 970 desktop. It currently works on my Intel HD 3000 laptop, but on the desktop, every bind textures specifically from framebuffers, I get half a second of lag. This is done 4 times as I have three RGBA textures and one depth 32F buffer. I tried to use debugging software for the first time - RenderDoc only shows SwapBuffers() and no OGL calls, while Nvidia Nsight crashes upon execution, so neither are helpful. Without binding it runs regularly. This does not happen with non-framebuffer binds.
      GLFramebuffer::GLFramebuffer(FramebufferCreateInfo createInfo) { glGenFramebuffers(1, &fbo); glBindFramebuffer(GL_FRAMEBUFFER, fbo); textures = new GLuint[createInfo.numColorTargets]; glGenTextures(createInfo.numColorTargets, textures); GLenum *DrawBuffers = new GLenum[createInfo.numColorTargets]; for (uint32_t i = 0; i < createInfo.numColorTargets; i++) { glBindTexture(GL_TEXTURE_2D, textures[i]); GLint internalFormat; GLenum format; TranslateFormats(createInfo.colorFormats[i], format, internalFormat); // returns GL_RGBA and GL_RGBA glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, createInfo.width, createInfo.height, 0, format, GL_FLOAT, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); DrawBuffers[i] = GL_COLOR_ATTACHMENT0 + i; glBindTexture(GL_TEXTURE_2D, 0); glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i, textures[i], 0); } if (createInfo.depthFormat != FORMAT_DEPTH_NONE) { GLenum depthFormat; switch (createInfo.depthFormat) { case FORMAT_DEPTH_16: depthFormat = GL_DEPTH_COMPONENT16; break; case FORMAT_DEPTH_24: depthFormat = GL_DEPTH_COMPONENT24; break; case FORMAT_DEPTH_32: depthFormat = GL_DEPTH_COMPONENT32; break; case FORMAT_DEPTH_24_STENCIL_8: depthFormat = GL_DEPTH24_STENCIL8; break; case FORMAT_DEPTH_32_STENCIL_8: depthFormat = GL_DEPTH32F_STENCIL8; break; } glGenTextures(1, &depthrenderbuffer); glBindTexture(GL_TEXTURE_2D, depthrenderbuffer); glTexImage2D(GL_TEXTURE_2D, 0, depthFormat, createInfo.width, createInfo.height, 0, GL_DEPTH_COMPONENT, GL_FLOAT, 0); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glBindTexture(GL_TEXTURE_2D, 0); glFramebufferTexture(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, depthrenderbuffer, 0); } if (createInfo.numColorTargets > 0) glDrawBuffers(createInfo.numColorTargets, DrawBuffers); else glDrawBuffer(GL_NONE); if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) std::cout << "Framebuffer Incomplete\n"; glBindFramebuffer(GL_FRAMEBUFFER, 0); width = createInfo.width; height = createInfo.height; } // ... // FBO Creation FramebufferCreateInfo gbufferCI; gbufferCI.colorFormats = gbufferCFs.data(); gbufferCI.depthFormat = FORMAT_DEPTH_32; gbufferCI.numColorTargets = gbufferCFs.size(); gbufferCI.width = engine.settings.resolutionX; gbufferCI.height = engine.settings.resolutionY; gbufferCI.renderPass = nullptr; gbuffer = graphicsWrapper->CreateFramebuffer(gbufferCI); // Bind glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fbo); // Draw here... // Bind to textures glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, textures[0]); glActiveTexture(GL_TEXTURE1); glBindTexture(GL_TEXTURE_2D, textures[1]); glActiveTexture(GL_TEXTURE2); glBindTexture(GL_TEXTURE_2D, textures[2]); glActiveTexture(GL_TEXTURE3); glBindTexture(GL_TEXTURE_2D, depthrenderbuffer); Here is an extract of my code. I can't think of anything else to include. I've really been butting my head into a wall trying to think of a reason but I can think of none and all my research yields nothing. Thanks in advance!
  • Popular Now