I only tested with version 150. Seemed to work just fine.Originally Posted by Alfonse Reinheart
Good, I needed some arguments for the other two. With three totally different ways, it isn't so easy. I don't like matching arbitrary numbers between the main program and shaders, variable names are more descriptive, but I consider all options.It also means that you can't share VAOs and attribute bindings among different shaders. So if you have a mesh that gets rendered with two or more shaders (very possible. Multi-pass techniques often do it. Shadow map pass and lighting pass are both two separate programs), you have to have two separate sets of attribute bindings. Even though they may use the exact same vertex inputs.I go for getting locations, that feels best clean to me since it doesn't require me to break in with application specific code in my shader loader, and keeps the shaders clean.
The inability to mix and match shaders with meshes is not what I would call "clean". So I would suggest either explicitly binding attribute locations to known values with `glBindAttribLocation`, or use explicit attribute locations within shaders. The latter is what I do, and ever since that extension came out, I have never wanted to do anything else again.
Do you mean that calls like glEnableVertexAttribArray or glVertexAttribPointer will require me to bind the attributes to different values? But can't I just switch shader and rebind? I havn't tried multi-pass rendering under 3.2 yet, so maybe the problems will surface when I do. (I must port my shadow mapping examples anyway.)