If we want to send data from one shader to the other we'd have to declare an output in the sending shader and a similar input in the receiving shader. When the types and the names are equal on both sides OpenGL will link those variables together and then it is possible to send data between shaders — (this is done when linking a program object).
Shaders & GLSL
notes + algo + examples + experiments