Ok, total newbie here.
I have a really simple (and I mean really simple) test code (using GLUT only, no shaders yet) where I draw a teapot and have a light rotating around it. In fact, here’s the code snippet of my main display routine:
glEnable (GL_LIGHTING);
glEnable (GL_LIGHT0);
glLightfv(GL_LIGHT0, GL_POSITION, light_pos);
glPointSize (5.0);
glColor3f (1.0, 1.0, 1.0);
glBegin (GL_POINTS);
glVertex3f (light_pos[0], light_pos[1], light_pos[2]);
glEnd ();
glColor3f (.5., .5., .5);
glutSolidTeapot(10.0);
glDisable (GL_LIGHTING);
So, what I see is my little white dot rotating around my teapot, where my light is acting like a point light. My eye position (via gluLookAt()) is on the positive Z looking down negative Z. So, when the light goes behind the teapot, the side of the teapot I’m viewing goes dark (as expected).
I don’t set any light or material properties. What you see above are the only light-related routines that I call.
Now, I tried using the vertex/fragment shader code from http://www.clockworkcoders.com/oglsl/ for per-vertex lighting and what I get is not what I expect.
In order to duplicate using shaders what I did without using shaders, do I have to setup all the light and material properties? According to the code from clockworkcoders.com, it looks like a bunch of these are set in DefaultLighting().
I’m confused how to simulate the lighting I did with the fixed-pipeline (the code was really simple) when using GLSL.
What I see is the teapot already lit with what appears to be a directional light? Is this what I’m seeing?