public void DrawBack(GraphicsDevice graphics, SpriteBatch spriteBatch, Camera cam) { float brightness = MathHelper.Clamp(1.1f + (cam.Position.Y - Size.Y) / 100000.0f, 0.1f, 1.0f); var lightColorHLS = GenerationParams.AmbientLightColor.RgbToHLS(); lightColorHLS.Y *= brightness; GameMain.LightManager.AmbientLight = ToolBox.HLSToRGB(lightColorHLS); graphics.Clear(BackgroundColor); renderer?.DrawBackground(spriteBatch, cam, LevelObjectManager, backgroundCreatureManager); }
public void DrawBack(GraphicsDevice graphics, SpriteBatch spriteBatch, Camera cam) { float brightness = MathHelper.Clamp(1.1f + (cam.Position.Y - Size.Y) / 100000.0f, 0.1f, 1.0f); GameMain.LightManager.AmbientLight = new Color(backgroundColor * brightness, 1.0f); graphics.Clear(backgroundColor); if (renderer == null) { return; } renderer.DrawBackground(spriteBatch, cam, backgroundSpriteManager, backgroundCreatureManager); }
public void DrawBack(GraphicsDevice graphics, SpriteBatch spriteBatch, Camera cam, BackgroundCreatureManager backgroundSpriteManager = null) { float brightness = MathHelper.Clamp(50.0f + (cam.Position.Y - Size.Y) / 2000.0f, 10.0f, 40.0f); float avgValue = (backgroundColor.R + backgroundColor.G + backgroundColor.G) / 3; GameMain.LightManager.AmbientLight = new Color(backgroundColor * (brightness / avgValue), 1.0f); graphics.Clear(backgroundColor); if (renderer == null) { return; } renderer.DrawBackground(spriteBatch, cam, backgroundSpriteManager); }