I have read the shadow mapping tutorial (the one there is a link to in the documentation section :
www.paulsprojects.net/tutorials/smt/smt.html (http://www.paulsprojects.net/tutorials/smt/smt.html) ).
I am interested in extending that progrma to multiple light sources. So I began with 2 light sources , located in different positions and now I get z-fighting and only the last shadow (the one casted from the 2nd light) is valid.

What is the correct method to cast shadows using shadow maps for multiple lights ?

I used 3 passes as suggested in that tutorial:
1. Render hte scene from the light(s) pov.
2. Render the scene from the eye pov (ambient light only)
3. Rendering the shadows.
Here is the code of the 3rd pass :