summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl/downsample.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/downsample.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/downsample.fx')
-rw-r--r--hlsl/downsample.fx19
1 files changed, 11 insertions, 8 deletions
diff --git a/hlsl/downsample.fx b/hlsl/downsample.fx
index 376e4b8802d..4a4a8fe3743 100644
--- a/hlsl/downsample.fx
+++ b/hlsl/downsample.fx
@@ -48,15 +48,15 @@ struct PS_INPUT
//-----------------------------------------------------------------------------
uniform float2 ScreenDims;
-uniform float2 TargetSize;
+uniform float2 TargetDims;
-uniform float2 Prescale = float2(1.0f, 1.0f);
+uniform bool PrepareVector;
VS_OUTPUT vs_main(VS_INPUT Input)
{
VS_OUTPUT Output = (VS_OUTPUT)0;
- float2 TargetTexelSize = 1.0f / TargetSize;
+ float2 TargetTexelDims = 1.0f / TargetDims;
Output.Position = float4(Input.Position.xyz, 1.0f);
Output.Position.xy /= ScreenDims;
@@ -67,11 +67,14 @@ VS_OUTPUT vs_main(VS_INPUT Input)
Output.Color = Input.Color;
float2 TexCoord = Input.Position.xy / ScreenDims;
-
- Output.TexCoord01.xy = TexCoord + float2(-0.5f, -0.5f) * TargetTexelSize * Prescale;
- Output.TexCoord01.zw = TexCoord + float2( 0.5f, -0.5f) * TargetTexelSize * Prescale;
- Output.TexCoord23.xy = TexCoord + float2(-0.5f, 0.5f) * TargetTexelSize * Prescale;
- Output.TexCoord23.zw = TexCoord + float2( 0.5f, 0.5f) * TargetTexelSize * Prescale;
+ TexCoord += PrepareVector
+ ? 0.5f / TargetDims // half texel offset correction (DX9)
+ : 0.0f;
+
+ Output.TexCoord01.xy = TexCoord + float2(-0.5f, -0.5f) * TargetTexelDims;
+ Output.TexCoord01.zw = TexCoord + float2( 0.5f, -0.5f) * TargetTexelDims;
+ Output.TexCoord23.xy = TexCoord + float2(-0.5f, 0.5f) * TargetTexelDims;
+ Output.TexCoord23.zw = TexCoord + float2( 0.5f, 0.5f) * TargetTexelDims;
return Output;
}