After starting the shader editor, you can the editor window with some source code in it. There is one window for each shader type: the vertex shader, the fragment shader and (if your OpenGL implementation supports it) the geometry shader. In this tutorial you can learn how to write vertex and fragment shader. Geometry shaders are handled in a separate tutorial.
After a quick look at the vertex shader, you will realize that this shader does nothing taht's very intresting, it simply passes trough it's input an transforms the vertex poisition.
If you replace the line
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
with
gl_Position = gl_Vertex;
then you should see that this transformation is quite important. But wait, you see no changes, right? That's because you actually didn't change the current program object! Whenever you think you are ready to test your shader, you must first compile and link your source code by clicking the 'Compile and Link' button ( or hit F5 ) to update the program object. Simply remember 'hit F5 before testing'.
As another example you can compute gl_FrontColor with:
gl_FrontColor = vec4( 1.0, 1.0, 1.0, 0.0 ) - gl_Color;
Now you should see the model with inverse colors.
When you make a mistake and try to compile your code, then the editor switches to the 'Log' tab. Here you can find informations about the compile and link process and read error messages. When compilation succeeds, you can also find a list of active uniforms and vertex attributes. This is mainly for informational purpose, but might be useful in some situations.
Now let's go on to the fragment shader. Here you can compute a pixel color by processing the fragment's attributes. The initial fragment shader passes through the interpolated results of the vertex shader. To get an idea what the fragment does, try the following:
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
Now you should the the test model in red, without any lighting, etc. The next example darkens the test model:
gl_FragColor = gl_Color * 0.5;
To see the differences between the original color an the darkened color, you can uncheck the 'Attach to program' check-box ( and then recompile the program ). With this check box, you can (de-)activate shaders that you do not need in you program. For example, the geometry shader is always deactivated this way by default.
If you want do develop your program with a separate window for each shader type, you can use the menu element 'View -> Switch to SDI view'. Note that you must save your work before using this option.
The next step is to learn Texturing.