Specular lighting not working correctly
I have lighting working and am getting correct shading of triangles, but for some reason when I use specular lighting the highlight doesn't react correctly.
If the view is looking directly at the light I get the specular highlight on the surface in front of me, where it should be, but if I turn the camera to the right, the highlight moves to the left, and vice-versa for right, and it shouldn't even move at all. Also, again looking directly at the light, if I then strafe the camera to the left or right, the highlight SHOULD move then, but doesn't.
This is really confusing me as the rest of the lighting calculations are working perfectly well.
Any help is appreciated. Thanks.
---When I'm in command, every mission's a suicide mission!
i had the same problem at one time. every frame you need to restate the light's position ie glLightfv(GL_LIGHT, GL_POSITION, lightPosition);
try that and see how it works
try that and see how it works
I'm already doing that, and it doesn't seem to matter where I put that code. I find it very strange that the rest of the lighting works fine, but specular does not.
---When I'm in command, every mission's a suicide mission!
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement