Fix LOS effect on linux. Not sure why the parameter names are different in the OpenGL shader but this seems to work ¯\_(ツ)_/¯

This commit is contained in:
Joonas Rikkonen
2018-03-07 20:40:00 +02:00
parent a43b8dc278
commit 3bcf7a849b
2 changed files with 7 additions and 1 deletions

View File

@@ -82,7 +82,7 @@ namespace Barotrauma.Lights
#if WINDOWS
LosEffect = content.Load<Effect>("losshader");
#else
losEffect = content.Load<Effect>("losshader_opengl");
LosEffect = content.Load<Effect>("losshader_opengl");
#endif
if (lightEffect == null)

View File

@@ -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