I read many articles and posts about passing values like vectors and matrices from the vertex shader stage to the fragment shader. But I'm still not sure about this: If you have some out vars in the vertex shader (I'll call him vtxs) and some in vars in the fragment shader (frgs), how does OpenGl associate them so they refer to the same value (i neglect the fact that values passing to frgs are interpolated)? Must I write them down in the some order? And how does OpenGl interpret these variables if I write:
vtxs:
out float x;
out vec4 mvp;
frgs:
in vec4 mvp;
in float x;
in double newvar;
Note: I shuffled the var types and there is 1 more in var in frgs then out vars in vtxs.
I see that location spec in the layout list is a way to assign a ... address? ... to a variable but I have an ancient netbook doesnt supporting such a variable decorator.
and as a tip: do you know some sort of debugging shaders? i mean, in cpu programs you can add some printfs but i didnt see such a func in glsl...
So, summarized, that are my questions:
What the heck do you specify with the layout(location=...) what consequences are there concerning the shader?
How does the value matching/association between various shader stages work? With and without that "location="?
debugging glsl shaders