From 7add54760210313651c8a53a9ff6676512ce3fc8 Mon Sep 17 00:00:00 2001 From: ImJezze Date: Sat, 12 Mar 2016 16:03:28 +0100 Subject: 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 --- hlsl/downsample.fx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'hlsl/downsample.fx') 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; -- cgit v1.2.3