   [MDX] Some questions about Lighting with Shaders
  Hi all,I have two questions about implementing lighting with shaders:1) Must the default Direct3D fixed-function lighting be turned off?2) Right now I am using Effect.SetValue("LightPosition", ....) -- what if I have more than 1 light? What if I have no idea how many lights there might be? Do I do a single shader pass for each different light?Thanks in advance!   
  1.No as soon as you set a shader all fixed function for this part of the pipeline (pixel or vertex) will be deactivated automatically..2.This is one solution. You can although build shaders with different numbers of lights. The more advanced shader models allows you to build shaders with a dynamic number of lights.;  Getting a dynamic number of lights isn't really reliable at the moment.I think the best supported solution at the moment is to write several Techniques within the same Effect, with different numbers of lights (ie. 1, 2, 3, and 4). If you need more than that, go for more passes: 4 + 3 for 7 total lights.A good optimization is to ignore lights that have little to no effect on an object. This would seriously reduce the number of lights you use to draw an object.Lastly, you can either use several vars, like: light1pos, light2pos, light3pos, or you can use an array. The second might be more difficult to implement, but would be generally cleaner and more scalable in the long run.Hope this helps.   