summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl/phosphor.fx
diff options
context:
space:
mode:
author ImJezze <jezze@gmx.net>2015-09-26 18:22:51 +0200
committer ImJezze <jezze@gmx.net>2015-09-26 18:22:51 +0200
commit062e6e0383050546656dfed7261273a2d7d142a4 (patch)
treeb28fdb238ce5501908086d41f0e443cf11e6c313 /hlsl/phosphor.fx
parent37f6ff0b653f840010a9b2dd18b5df9e6337aa2c (diff)
Refactoring, Fixes and Cleanup
- added distortion pass, which is applied after the bloom pass - moved vignetting, curvature, round corners and reflection effect to distortion pass - disabled distortion pass for multi screens and activated artworks due to not yet fixed misalignments - disabled scanlines for vector rendering in post pass shader - removed prescale knowledge from downsample, bloom and post pass shader - fixed half pixel offset in most shaders - fixed position of reflection effect when screen is rotated or flipped - fixed roundness of round corners in any aspect ratio - fixed shadow mask bleeding (nearly completly) - added bounds() and screen_bounds() getter to layout_view - added current_view() getter to render_target - some cleanup and refactoring
Diffstat (limited to 'hlsl/phosphor.fx')
-rw-r--r--hlsl/phosphor.fx14
1 files changed, 8 insertions, 6 deletions
diff --git a/hlsl/phosphor.fx b/hlsl/phosphor.fx
index 44b00ac0ee7..13c7700e2e8 100644
--- a/hlsl/phosphor.fx
+++ b/hlsl/phosphor.fx
@@ -68,18 +68,20 @@ uniform bool Passthrough;
VS_OUTPUT vs_main(VS_INPUT Input)
{
VS_OUTPUT Output = (VS_OUTPUT)0;
-
+
Output.Position = float4(Input.Position.xyz, 1.0f);
Output.Position.xy /= ScreenDims;
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 + 0.5f / TargetDims;
+
+ Output.TexCoord = Input.TexCoord;
+ Output.TexCoord += 0.5f / TargetDims; // half texel offset correction (DX9)
+
Output.PrevCoord = Output.TexCoord;
Output.Color = Input.Color;
-
+
return Output;
}
@@ -93,13 +95,13 @@ float4 ps_main(PS_INPUT Input) : COLOR
{
float4 CurrPix = tex2D(DiffuseSampler, Input.TexCoord);
float3 PrevPix = tex2D(PreviousSampler, Input.PrevCoord).rgb * float3(Phosphor.r, Phosphor.g, Phosphor.b);
-
+
float RedMax = max(CurrPix.r, PrevPix.r);
float GreenMax = max(CurrPix.g, PrevPix.g);
float BlueMax = max(CurrPix.b, PrevPix.b);
return Passthrough
- ? CurrPix
+ ? CurrPix
: float4(RedMax, GreenMax, BlueMax, CurrPix.a);
}