Life is complex. It has real and imaginary parts.
On 24 June 2011 17:23, John Tsiombikas <email@example.com>
On Fri, Jun 24, 2011 at 11:58:18AM +0300, Matti Lehtonen wrote:I'm sorry I forgot that OpenGL 4 deprecates even the standard
> Did I said somewhere that everything must be passed to freeglut functions?
> As I said earlier, passing vertex and normal information for shader is
attributes. I thought you meant having a custom shader and telling the
user to give us all the relevant state.
Yes and no. User has responsibility to setup current shader so far that only vertex (and normal) informations are missing before rendering.
Instead of fixed vertex and normal attribute names, there could be freeglut set functions that user can use to tell freeglut, which names user has used for vertices and normals in shaders.
> val = glGetAttribLocation( p, "a_Vertex3" );
> nal = glGetAttribLocation( p, "a_Normal" );I think that it would be much more reasonable to use the standard OpenGL
2+ attribute names: gl_Vertex, gl_Normal, etc.
I believe that those standard attribute names were only introduces to get fixed pipeline to work with programmable pipeline. Both OpenGL ES 2.0 and OpenGL 4.0 don't have fixed pipeline and no standard vertex attributes except "vec4 gl_Vertex". Most likely e.g. glVertexPointer() were only a wrapper that finally
called glVertexAttribPointer() (or something similar) on those OpenGLs that mixed
fixed and programmable pipelines.
Actually I tried to use those standard names for my shaders, when I ported my application to OpenGL ES 2, but I quickly noticed that shader compiler won't allow that. And so I ended into naming scheme, where I used body of std. name and replaced "gl_" with either "a_" or "u_".