From 37f6ff0b653f840010a9b2dd18b5df9e6337aa2c Mon Sep 17 00:00:00 2001 From: ImJezze Date: Sun, 2 Aug 2015 17:31:54 +0200 Subject: Refactoring and Fixes - removed position offset in post.fx - fixed texture offset caused by 0th level of bloom.fx - fixed texture offset caused by focus.fx - changed Passthrough parameter in phosphor.fx to boolean - simplified defocus pass function and calling it twice - removed CU_PHOSPHOR_IGNORE (Passthrough) uniform, which was only used in phosphor pass function and is now directly set - added CU_TARGET_DIMS (TargetDims) uniform based on the current render target - fixed missing Prescal parameter in downsample pass function - some code cleanup --- 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 18eaa8313c0..376e4b8802d 100644 --- a/hlsl/downsample.fx +++ b/hlsl/downsample.fx @@ -60,13 +60,14 @@ VS_OUTPUT vs_main(VS_INPUT Input) 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.xy *= 2.0f; + Output.Position.y = 1.0f - Output.Position.y; // flip y + Output.Position.xy -= 0.5f; // center + Output.Position.xy *= 2.0f; // zoom 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; -- cgit v1.2.3-70-g09d2