Updated OpenGL LOS shader

This commit is contained in:
Joonas Rikkonen
2018-03-04 21:00:12 +02:00
parent da7ea779b7
commit 8b6d2f3cc1
2 changed files with 12 additions and 6 deletions

View File

@@ -6,12 +6,18 @@ Texture2D xLosTexture;
sampler LosSampler = sampler_state { Texture = <xLosTexture>; };
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;
}