From 3bcf7a849b37745eb28328dc4ee9891be5c38508 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Wed, 7 Mar 2018 20:40:00 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20LOS=20effect=20on=20linux.=20Not=20sure?= =?UTF-8?q?=20why=20the=20parameter=20names=20are=20different=20in=20the?= =?UTF-8?q?=20OpenGL=20shader=20but=20this=20seems=20to=20work=20=C2=AF\?= =?UTF-8?q?=5F(=E3=83=84)=5F/=C2=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BarotraumaClient/Source/Map/Lights/LightManager.cs | 2 +- Barotrauma/BarotraumaClient/Source/Screens/GameScreen.cs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs b/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs index d8405163e..e17aca912 100644 --- a/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs +++ b/Barotrauma/BarotraumaClient/Source/Map/Lights/LightManager.cs @@ -82,7 +82,7 @@ namespace Barotrauma.Lights #if WINDOWS LosEffect = content.Load("losshader"); #else - losEffect = content.Load("losshader_opengl"); + LosEffect = content.Load("losshader_opengl"); #endif if (lightEffect == null) diff --git a/Barotrauma/BarotraumaClient/Source/Screens/GameScreen.cs b/Barotrauma/BarotraumaClient/Source/Screens/GameScreen.cs index 3c66a302b..e78de2f5b 100644 --- a/Barotrauma/BarotraumaClient/Source/Screens/GameScreen.cs +++ b/Barotrauma/BarotraumaClient/Source/Screens/GameScreen.cs @@ -237,8 +237,14 @@ namespace Barotrauma if (GameMain.LightManager.LosEnabled && Character.Controlled!=null) { GameMain.LightManager.LosEffect.CurrentTechnique = GameMain.LightManager.LosEffect.Techniques["LosShader"]; +#if LINUX + GameMain.LightManager.LosEffect.Parameters["TextureSampler+xTexture"].SetValue(renderTargetBackground); + GameMain.LightManager.LosEffect.Parameters["LosSampler+xLosTexture"].SetValue(GameMain.LightManager.losTexture); +#else GameMain.LightManager.LosEffect.Parameters["xTexture"].SetValue(renderTargetBackground); GameMain.LightManager.LosEffect.Parameters["xLosTexture"].SetValue(GameMain.LightManager.losTexture); +#endif + //convert the los color to HLS and make sure the luminance of the color is always the same regardless //of the ambient light color and the luminance of the damage overlight color