From 40a46f96e2ebc54366a43609e1abec76c6370a42 Mon Sep 17 00:00:00 2001 From: juanjp600 Date: Wed, 20 Dec 2017 20:47:17 -0300 Subject: [PATCH] Fixed LOS not going red + Fixed additive particles not looking right at all --- .../BarotraumaClient/Source/Map/Lights/LightManager.cs | 2 +- Barotrauma/BarotraumaClient/Source/Screens/GameScreen.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs b/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs index 1b84da7f2..38f9ef2e7 100644 --- a/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs +++ b/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs @@ -175,7 +175,7 @@ namespace Barotrauma.Lights lightEffect.World = Matrix.CreateTranslation(offset) * transform; - //GameMain.ParticleManager.Draw(spriteBatch, false, null, Particles.ParticleBlendState.Additive); + GameMain.ParticleManager.Draw(spriteBatch, false, null, Particles.ParticleBlendState.Additive); if (Character.Controlled != null) { diff --git a/Barotrauma/BarotraumaClient/Source/Screens/GameScreen.cs b/Barotrauma/BarotraumaClient/Source/Screens/GameScreen.cs index f71becd75..805a27139 100644 --- a/Barotrauma/BarotraumaClient/Source/Screens/GameScreen.cs +++ b/Barotrauma/BarotraumaClient/Source/Screens/GameScreen.cs @@ -133,7 +133,6 @@ namespace Barotrauma spriteBatch.End(); //draw additive particles that are in water and behind subs - //TODO: make these draw properly somehow, since they're not rendered into the lightmap anymore spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, DepthStencilState.None, null, null, cam.Transform); GameMain.ParticleManager.Draw(spriteBatch, true, false, Particles.ParticleBlendState.Additive); spriteBatch.End(); @@ -217,7 +216,6 @@ namespace Barotrauma spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, DepthStencilState.Default, null, null, cam.Transform); GameMain.ParticleManager.Draw(spriteBatch, true, true, Particles.ParticleBlendState.Additive); spriteBatch.End(); - if (GameMain.LightManager.LightingEnabled) { spriteBatch.Begin(SpriteSortMode.Deferred, Lights.CustomBlendStates.Multiplicative, null, DepthStencilState.None, null, null, null); @@ -235,7 +233,9 @@ namespace Barotrauma spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.Opaque, SamplerState.PointClamp, DepthStencilState.None, null, null, null); if (GameMain.LightManager.LosEnabled && Character.Controlled!=null) { - spriteBatch.Draw(renderTargetBackground, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), new Color(10, 24, 30, 255)); + float r = Math.Min(CharacterHUD.damageOverlayTimer * 0.5f, 0.5f); + spriteBatch.Draw(renderTargetBackground, new Rectangle(0, 0, GameMain.GraphicsWidth, GameMain.GraphicsHeight), + Color.Lerp(GameMain.LightManager.AmbientLight * 0.5f, Color.Red, r)); spriteBatch.End(); Hull.renderer.waterEffect.CurrentTechnique = Hull.renderer.waterEffect.Techniques["LosShader"]; Hull.renderer.waterEffect.Parameters["xLosTexture"].SetValue(GameMain.LightManager.losTexture);