private void DrawLightScene() { GraphicsDevice.SetRenderTarget(RTLights); GraphicsDevice.Clear(Color.Lerp(Color.Black, Color.White, globalBrightness)); if (renderShadows) { FXApplyShadowsToLights.Parameters["Zoom"].SetValue(camera.zoom); FXApplyShadowsToLights.Parameters["CameraX"].SetValue(camera.Position.X); FXApplyShadowsToLights.Parameters["CameraY"].SetValue(camera.Position.Y); FXApplyShadowsToLights.Parameters["Mask"].SetValue((Texture2D)RTDepthMask); FXApplyShadowsToLights.Parameters["MaskWidth"].SetValue((float)RTDepthMask.Width); FXApplyShadowsToLights.Parameters["MaskHeight"].SetValue((float)RTDepthMask.Height); spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, FXApplyShadowsToLights, camera.get_transformation(GraphicsDevice)); } else { spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, camera.get_transformation(GraphicsDevice)); } drawBatch.DrawSceneLights(spriteBatch); spriteBatch.End(); }