In fact this is just the preparation for the tutorials that will follow. If you have any suggestions or think that some of the tutorials (that follows) can also be posted on OpenGL/wiki, just say it.
I have to excuse for the bad design of the pages, but everything will be fixed up soon (I hope).
Unfortunately, I have to announce that my next OpenGL 3.2 tutorial (Tutorial 02 - GLSL 1.5 and the Input Blocks) will have to wait the release of new drivers. Current NV 190.56 beta drivers do not support many of the OpenGL 3.2 built-in functionalities. It will be useless to expose only theory without chance to execute a peace of code.
Current GLSL implementation generates a compilation error if blocks are used. It claims that NV_gpu_shader5 extension should be enabled, but the current drivers do not support that extension.
gl_FragColor is deprecated built-in variable (since GLSL 1.3). As I have defined that I want only “core” functionality (#version 150 core), GLSL should generate an error if gl_FragColor is used. I know that NVidia’s drivers will accept mixing up of various versions of GLSL and currently ignore profile definition (although anything else than core and compatibility cannot be used as the profile), we should be prepare for the time when profile settings will be obeyed more strictly.
Yes, that means GLSL 1.5 is in use.
Thank you for the questions! They are very useful for updating the tutorial. Obviously I forgot to explicitly state some facts.
change minimal.frag to minimal.vert in your toturial:
And the shaders are exactly the same as in previous tutorial.
// minimal.frag
#version 150 core
in vec3 in_Position;
in vec3 in_Color;
out vec3 ex_Color;
void main(void)
{
gl_Position = vec4(in_Position, 1.0);
ex_Color = in_Color;
}
Well, it could be the solution. But now you can use all versions in the same time (I can claim that only for NVidia’s drivers). The other way is to use compatibility profile. As its name implies this mode enables all deprecated functionality and is fully backward compatible. Of course, you cannot use new features that are not implemented in drivers. For example, you can not use input blocks in versions previous to GLSL 1.5. (In fact it cannot be use either in current implementation of GLSL 1.5 but that is another (painful) story.)
Thank you for the correction! It was a copy/paste error.
(It is already corrected on Google-sites. Currently, I cannot login on wikiscripts. But when the site start working it will be corrected too.)
Been looking over your demos and have noticed something.
in the OGL 3.2 version tutorial you never bind a Vertex Array Object.
Now reading through this I find on page 397 it states:
Client vertex and index arrays - all vertex array attribute and element array
index pointers must refer to buffer objects. The default vertex array object
(the name zero) is also deprecated. Calling VertexAttribPointer when no
buffer object or no vertex array object is bound will generate an INVALID_-
OPERATION error, as will calling any array drawing command when no vertex
array object is bound.
I have tested this on my machine (ATI 5870) on a 4.0 context (With shaders disabled) and it works as expected, results are in screenshots, please explain if I am missing something!
Clarification: First screenshot is binding a VAO, second is without.