Quote:Original post by knighty
Hi,
The lights seems to move with the camera w.r.t. the geometry. Maybe the problem is the way the geometry itself is transformed.
What is the worldmatrix used with the geometry (the scene)? is it an identity matrix or do you perform some scaling?
In your vertex shader try to replace worldviewmatrix by viewmatrix or worldmatrix and let us see what happens :)
It seems to me that your scene is transformed by the view matrix then scaled.Maybe you are interverting the view and the world matrices.
I partially fixed the problem ! The problem was in the far plane :D ! In the very beginning I was doing some different test with different depth range and I forgot to update the zFar value...
I was passing zFar = 1000 to the shader while I was building the projection matrix with 3000.f.
Ok that fix the problem if I use white colored lights, yellow lights ...
Now it's happening something weird and without any reason. If I change de color of one light from white to red everything is fine. If I change that color to green ... the light is moving again from its location ... GOOOD what.. :((((
I tot it was fixed ...
However I think this problem is different from the one that I had before (which is actually fixed)...
partially fixed version (white lights). Every light is in place ... Cool !!! :
http://img827.imageshack.us/img827/8161/movinglightpartiallyfix.mp4
BUT !!!!
I change one color of one light to... say green ... that light is moving instead of staying in its location and the others white lights are fine:
http://img38.imageshack.us/img38/4733/greenlightmoving.mp4
If I change the color of that same light to red and it's fine (the other unchanged lights are fine too)!!!!! WHAT THE ... :D
http://img517.imageshack.us/img517/2507/redlightstill.mp4
...
someone tell me where is the logic reason to that !!! I tot that passing the right far plane fixed the problem but it fixes it just partially ... ie only if I put specific colors.... it doesn't sound logic ...
Duh ! :(