Yes, at least sort of (though, of course, in modern code, you handle most of that computation in shaders).
One typical possibility is to use uniform
s for your ambient color(s), light position(s), eye position, etc. Then set up a couple of varying
s that will be used to pass a diffuse color and specular color from your vertex shader to your fragment shader. Your vertex shader computes values for those varying
s based on the uniform
inputs.
The fragment shader then receives (for example) a texture and the varying
s mentioned above, and combines them together (along with any other inputs you might want) to produce a final color for the fragment (which it assigns to gl_FragColor
).