Lighting in OpenGL means computing vertex colors based on lighting and material state. Lighting and Material state is available in GLSL through several built-in uniform variables (like gl_LightSource and gl_FrontMaterial for example). With the 'Lighting' and the 'Material' tabs you can manipulate a subset of the OpenGL lighting and material state. These include light positions, colors, shininess and some additional flags.
To learn the purpose of every parameter, you can use the fixed function pipeline. Go to the 'Scene' tab and uncheck the 'Use GLSL progam' check-box. Then go to the 'Lighting' tab and check the 'Enable Lighting' check box. Note that this check-box only affects the fixed function pipeline. When you use the lighting related uniforms in you shaders, this flag is ignored. Now you should see the 'Plane' test model not in white but in gray, with a brighter spot in it's center.
You can see light, but you can't see where it comes from. To see that, you can check the 'Show lights' check-box. Now you should see a white sphere in the center of the plane. This sphere is drawn in the light's diffuse color (see below).
Now move around the light by manipulationg the values of GL_POSITION. As you might notice, the W component of GL_POSITION changes the lighting effect, but does not change the light position. This is caused by the way how light positions are handled in OpenGL ( see the specification for details ). The shader editor only takes the XYZ components and draws the light source at that location. But in GLSL you have access to the unchanged values you entered in the GL_POSITON fields. You should try the other test models as well, but be sure that the light source is outside the model, or you won't see anything!
The 'Lock To Camera' check-box controls the origin of the light source. If this box is unchecked, the light position is specified in world-space coordinates. That means, a position of (0,0,0) is in the center of the test model. If you rotate the test model, the light rotates with it, because it's 'locked' to the world. If you check this box, the light position is specified in eye-space coordinates. Eye space means, that the eye ( or the camera ) is located at (0,0,0) and looks along -Z. Light sources specified in eye-space coordinates are not transformed if you rotate the test model, because they are 'locked' to the camera. It is IMPORTANT to note that light sources specified in world-space are transformed by the model-view matrix and if you read the light's position is GLSL via gl_LightSource[i].position you will get the TRANSFORMED position! So you won't have to transform them 'by hand'.
If you do not want to change the light position by hand, you can check the 'Auto-rotate' check-box. This rotates the light source around the light source's origin.
The next step is to modify the light source's colors. Light sources emit ambient light, diffuse light and specular light. These light colors are multiplied with the material's light colors. You can set the colors of the light source in the 'Lighting' tab and the colors of the material in the 'Materials' tab. GL_AMBIENT colors are simple multiplied, GL_DIFFUSE colors are extra multiplied with the cosine of the angle between the light position and the vertex normal and GL_SPECULAR colors are multiplies with o coefficient depending on the view-angles ( see the OpenGL specification for details ). The easies way to find out how lighting works is to play around with it. Now you have the chance!
OpenGL supports several light sources. You can't edit two light sources at the same time, you have to select a light source to edit. The light sources are named GL_LIGHT0 to GL_LIGHT7. You can enable and disable light sources with the 'Enable' check-box. If a light source is not enabled, it won't be used in OpenGL's lighting calculations.
There are two additional notes for materials: At first, materials know a fourth color, GL_EMISSION. This color is added to the result of the lighting equation and represents a self-illumination color. Second, there is a check-box 'Use vertex color as GL_DIFFUSE'. This check box allows you to override the value of the GL_DIFFUSE material parameter with the color value in the model's vertex color. You can see the behavior with the cube or the sphere test model.
The next tutorial deals with Uniform variables.