Ok, I found the problem. In the diffuse term computation, the normal has to be in world space: Out.Normal.xyz

Quote
why do you use float instead of int for the 'for' loop where you cycle through all lights?

I once read somewhere that graphic cards overwork with integers. I don't really know why, even if it's true.