summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl/color.fx
diff options
context:
space:
mode:
Diffstat (limited to 'hlsl/color.fx')
-rw-r--r--hlsl/color.fx26
1 files changed, 13 insertions, 13 deletions
diff --git a/hlsl/color.fx b/hlsl/color.fx
index 53404726699..7724eeb10f7 100644
--- a/hlsl/color.fx
+++ b/hlsl/color.fx
@@ -49,20 +49,20 @@ struct PS_INPUT
uniform float2 ScreenDims;
uniform float2 SourceDims;
-uniform float YIQEnable;
-
VS_OUTPUT vs_main(VS_INPUT Input)
{
VS_OUTPUT Output = (VS_OUTPUT)0;
-
- float2 invDims = 1.0f / SourceDims;
+
Output.Position = float4(Input.Position.xyz, 1.0f);
Output.Position.xy /= ScreenDims;
- Output.Position.y = 1.0f - Output.Position.y;
- Output.Position.xy -= 0.5f;
- Output.Position *= float4(2.0f, 2.0f, 1.0f, 1.0f);
+ Output.Position.y = 1.0f - Output.Position.y; // flip y
+ Output.Position.xy -= 0.5f; // center
+ Output.Position.xy *= 2.0f; // zoom
+
+ Output.TexCoord = Input.TexCoord;
+ Output.TexCoord += 0.5f / SourceDims; // half texel offset correction (DX9)
+
Output.Color = Input.Color;
- Output.TexCoord = Input.TexCoord + 0.5f * invDims;
return Output;
}
@@ -84,17 +84,17 @@ float4 ps_main(PS_INPUT Input) : COLOR
float3 OutRGB = BaseTexel.rgb;
- // -- RGB Tint & Shift --
+ // RGB Tint & Shift
float ShiftedRed = dot(OutRGB, RedRatios);
float ShiftedGrn = dot(OutRGB, GrnRatios);
float ShiftedBlu = dot(OutRGB, BluRatios);
- // -- RGB Offset & Scale --
+ // RGB Scale & Offset
float3 OutTexel = float3(ShiftedRed, ShiftedGrn, ShiftedBlu) * Scale + Offset;
- // -- Saturation --
- float3 Gray = float3(0.3f, 0.59f, 0.11f);
- float OutLuma = dot(OutTexel, Gray);
+ // Saturation
+ float3 Grayscale = float3(0.299f, 0.587f, 0.114f);
+ float OutLuma = dot(OutTexel, Grayscale);
float3 OutChroma = OutTexel - OutLuma;
float3 Saturated = OutLuma + OutChroma * Saturation;