Most of such build in variables have been deprecated. Might want to avoid using them (and use generic ones with whatever qualifiers make sense for your specific case). Also, yes, you can redeclare them with your own qualifiers too.1. /.../ built-in variables such gl_fragColor and so on. /.../
A few quick reference cards (always worth spreading around):
www.khronos.org/files/opengl-quick-reference-card.pdf
www.khronos.org/files/opengl4-quick-reference-card.pdf
/.../
Blocks are used to communicate between shader stages and with them (just convenience or efficiency [uniform blocks with std memory layout instead of separate uniforms]). A struct is just a sctuct as in any other programming language. Not sure what the confusion is :/3. I am trying to understand the difference between a struct and an interface block( in/out/uniform ).
I guess you can just create one instance of an interface so they will be just a set of global variables ?
------
Edit: wait, what!? I must have been blind. "out struct test" !? You are mixing structs with interface blocks - they are not the same. Remove the struct part. (Do you have an nvidia card by any chance?)
Edit2: went to refresh my memory about "struct" usage/syntax, but realized another oddity: "layout location" does not really make any sense with centroid. Also, readding the note that: block is defined as "out", but the "red" with centroid qualifier in it is "in" - they should agree with each other.