//Draw a Shadow Map for a Spot Light void DrawShadowMap(GraphicsDevice GraphicsDevice, SpotLight Light, List <Model> Models) { //Set Light's Target onto the Graphics Device GraphicsDevice.SetRenderTarget(Light.getShadowMap()); //Clear Target GraphicsDevice.Clear(Color.Transparent); //Set global Effect parameters depthWriter.Parameters["View"].SetValue(Light.getView()); depthWriter.Parameters["Projection"].SetValue(Light.getProjection()); depthWriter.Parameters["LightPosition"].SetValue(Light.getPosition()); depthWriter.Parameters["DepthPrecision"].SetValue(Light.getFarPlane()); //Draw Models DrawModels(GraphicsDevice, Models); }
//Remove a Spot Light public void RemoveLight(SpotLight Light) { spotLights.Remove(Light); }
//Add a Spot Light public void AddLight(SpotLight Light) { spotLights.Add(Light); }