diff --git a/Barotrauma/BarotraumaShared/Content/losshader_opengl.fx b/Barotrauma/BarotraumaShared/Content/losshader_opengl.fx index cfa59e796..55e68fddc 100644 --- a/Barotrauma/BarotraumaShared/Content/losshader_opengl.fx +++ b/Barotrauma/BarotraumaShared/Content/losshader_opengl.fx @@ -6,12 +6,18 @@ Texture2D xLosTexture; sampler LosSampler = sampler_state { Texture = ; }; float4 main(float4 position : SV_Position, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0 -{ - float4 losColor = tex2D(LosSampler, texCoord); - float4 sample = tex2D(TextureSampler, texCoord); - - float4 outColor = float4(sample.x*losColor.x, sample.y*losColor.x, sample.z*losColor.x, losColor.x); - +{ + float4 sampleColor = xTexture.Sample(TextureSampler, texCoord); + float4 losColor = xLosTexture.Sample(LosSampler, texCoord); + + float obscureAmount = 1.0f - losColor.r; + + float4 outColor = float4( + sampleColor.r * color.r, + sampleColor.g * color.g, + sampleColor.b * color.b, + obscureAmount); + return outColor; } diff --git a/Barotrauma/BarotraumaShared/Content/losshader_opengl.xnb b/Barotrauma/BarotraumaShared/Content/losshader_opengl.xnb index 071bd901e..af566e976 100644 Binary files a/Barotrauma/BarotraumaShared/Content/losshader_opengl.xnb and b/Barotrauma/BarotraumaShared/Content/losshader_opengl.xnb differ