1 and 2. That's an GLSL 1.50 shader = OpenGL 3.0 shader, so you're making this more complicated than it has to be, so point 1 and 2 are solved by switching to an older version.
3) With older versions you can actually have a vertex shader without a fragment shader, but I recommend that you do use a fragment shader anyway.
4) No, it does the same thing under the hood for all but the most ancient hardware out there. You might win some FPS on old Intel hardware or so, assuming your program doesn't crash immediately due to their drivers. It won't work in your case though, since ftransform() can only use gl_Position, and you can't use that because it only accepts floats...
5) It's easier with shaders since you don't have to bother with a shitload of texture settings. Just a few more extra shader lines, obviously assuming you know how to generate a shadow map already.
1 2 3 4 5 6 7
| attribute vec3 position; attribute vec3 normal;
void main() { gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1); gl_Normal = normalize(gl_NormalMatrix * normal); } |
This code uses the built-in matrices instead, so no need for a matrix library. One step at a time.
Now I want to make a vertex shader that simple set the attribute 0 as position of the vertex and the attribute 1 as normal.
That's not how it works, at least in older versions of GLSL. The driver specific GLSL compiler decides the attribute locations, and the OpenGL program queries the attribute locations with GL20.glGetAttribLocation(program, attribName);. In practice pretty much every driver would set position to 0 and normal to 1 in the above shader, but there's no guarantee and you could get problems on some platforms. Another important thing is that if for example position isn't used anywhere, it will be optimized away, meaning that normal would get the location 0 instead of 1. BOOOOoooooom...
I hope this gets you rolling, but feel free to ask if there's something that's unclear.