(5a377a8ee) Unstable v0.9.1000.0
This commit is contained in:
@@ -1,3 +1,24 @@
|
||||
struct VertexShaderInput
|
||||
{
|
||||
float4 Position : POSITION0;
|
||||
float2 TexCoords: TEXCOORD0;
|
||||
};
|
||||
|
||||
struct VertexShaderOutput
|
||||
{
|
||||
float4 Position : POSITION0;
|
||||
float2 TexCoords: TEXCOORD0;
|
||||
};
|
||||
|
||||
VertexShaderOutput mainVS(in VertexShaderInput input)
|
||||
{
|
||||
VertexShaderOutput output = (VertexShaderOutput)0;
|
||||
|
||||
output.Position = input.Position;
|
||||
output.TexCoords = input.TexCoords;
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
Texture2D xTexture;
|
||||
sampler TextureSampler : register (s0) = sampler_state { Texture = <xTexture>; };
|
||||
@@ -5,17 +26,19 @@ sampler TextureSampler : register (s0) = sampler_state { Texture = <xTexture>; }
|
||||
Texture2D xLosTexture;
|
||||
sampler LosSampler = sampler_state { Texture = <xLosTexture>; };
|
||||
|
||||
float4 main(float4 position : SV_Position, float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
|
||||
float4 xColor;
|
||||
|
||||
float4 mainPS(VertexShaderOutput input) : COLOR0
|
||||
{
|
||||
float4 sampleColor = xTexture.Sample(TextureSampler, texCoord);
|
||||
float4 losColor = xLosTexture.Sample(LosSampler, texCoord);
|
||||
float4 sampleColor = xTexture.Sample(TextureSampler, input.TexCoords);
|
||||
float4 losColor = xLosTexture.Sample(LosSampler, input.TexCoords);
|
||||
|
||||
float obscureAmount = 1.0f - losColor.r;
|
||||
|
||||
float4 outColor = float4(
|
||||
sampleColor.r * color.r,
|
||||
sampleColor.g * color.g,
|
||||
sampleColor.b * color.b,
|
||||
sampleColor.r * xColor.r,
|
||||
sampleColor.g * xColor.g,
|
||||
sampleColor.b * xColor.b,
|
||||
obscureAmount);
|
||||
|
||||
return outColor;
|
||||
@@ -25,6 +48,7 @@ technique LosShader
|
||||
{
|
||||
pass Pass1
|
||||
{
|
||||
PixelShader = compile ps_4_0_level_9_1 main();
|
||||
VertexShader = compile vs_4_0_level_9_1 mainVS();
|
||||
PixelShader = compile ps_4_0_level_9_1 mainPS();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user