Hello,
I’ve been starting with GLSL, using it for per-pixel lighting in my own engine. I’ve read through Lighthouse3d tutorial and used the shader examples for lighting (I intend to extend the shaders for shadow mapping later). But I cannot get my flashlight to work correctly. I set flashlight by loading identity into modelview matrix, setting position to 0.0, 0.0, 0.0 and direction to 0.0 0.0 -1.0. This seems to work with OGL fixed pipeline (as far as I can see, it’s hard to see exactly where the light shines with per-vertex lighting :-)). With shaders, the light seems to work fine if I’m centered in my world (0.0, 0.0, 0.0), it also seems to work sorta ok for vertical walls, but it breaks on the floor. It looks like the light isn’t positioned properly. What am I missing?
(the black part on the floor is intentional as I’ve made the center tile somewhat smaller then it should be for testing)