summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl/downsample.fx
diff options
context:
space:
mode:
author ImJezze <jezze@gmx.net>2016-03-12 16:03:28 +0100
committer ImJezze <jezze@gmx.net>2016-03-12 16:03:28 +0100
commit7add54760210313651c8a53a9ff6676512ce3fc8 (patch)
treee4e58b88feac19928cbb40479c9b799caead065c /hlsl/downsample.fx
parenta026a582f1a0ea8c1ede3acaddacef506ef3f3b0 (diff)
Refactoring of render targes and vector texture coordinates
- implemented proper texture coordinates for vector quad primitive - vector screen is now processed in texture coordinates - revered workaround for raster screen, which is again processed in texture coordinates - known issue: cocktail mode for vector screen looks wrong
Diffstat (limited to 'hlsl/downsample.fx')
-rw-r--r--hlsl/downsample.fx7
1 files changed, 4 insertions, 3 deletions
diff --git a/hlsl/downsample.fx b/hlsl/downsample.fx
index fad2ef8341f..e89407208be 100644
--- a/hlsl/downsample.fx
+++ b/hlsl/downsample.fx
@@ -53,8 +53,6 @@ struct PS_INPUT
uniform float2 ScreenDims;
uniform float2 TargetDims;
-uniform float2 SourceDims;
-uniform float2 SourceRect;
uniform float2 QuadDims;
uniform int BloomLevel;
@@ -71,6 +69,9 @@ VS_OUTPUT vs_main(VS_INPUT Input)
VS_OUTPUT Output = (VS_OUTPUT)0;
float2 HalfTargetTexelDims = 0.5f / TargetDims;
+ HalfTargetTexelDims *= VectorScreen
+ ? (ScreenDims / QuadDims)
+ : 1.0f;
Output.Position = float4(Input.Position.xyz, 1.0f);
Output.Position.xy /= ScreenDims;
@@ -80,7 +81,7 @@ VS_OUTPUT vs_main(VS_INPUT Input)
Output.Color = Input.Color;
- float2 TexCoord = Input.Position.xy / ScreenDims;
+ float2 TexCoord = Input.TexCoord;
TexCoord += 0.5f / TargetDims; // half texel offset correction (DX9)
Output.TexCoord01.xy = TexCoord + Coord0Offset * HalfTargetTexelDims;