I've found tons of tutorials, with lots of example shader files, with descriptions of what the files do, but I don't understand the specifics of exactly how they work. Here is an example from one of swiftless's tutorials:
#version 150 core
uniform mat4 projectionMatrix;
uniform mat4 viewMatrix;
uniform mat4 modelMatrix;
in vec3 in_Position;
in vec3 in_Color;
out vec3 pass_Color;
void main(void)
{
gl_Position = projectionMatrix * viewMatrix * modelMatrix * vec4(in_Position, 1.0);
pass_Color = in_Color;
}
I don't understand how the engine knows what to do with what. From what I can see, apart from the keyword 'in/out/uniform' this defines some variables, and initializes 2 of them on shader creation. I just don't understand how that, translates to gl shader calculations. Anyone know any good resources that focus specifically on line by line shader creation? (Preferably at a more fundamental level)






