diff options
author | 2015-08-02 17:31:54 +0200 | |
---|---|---|
committer | 2015-08-02 17:31:54 +0200 | |
commit | 37f6ff0b653f840010a9b2dd18b5df9e6337aa2c (patch) | |
tree | c852c4b4fe4de4c4f46f858a4d8721ce0784c37a /hlsl/phosphor.fx | |
parent | 4bcb0c13f50ddb1cd3fd0341b4bb31d9c3c7fc7a (diff) |
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
Diffstat (limited to 'hlsl/phosphor.fx')
-rw-r--r-- | hlsl/phosphor.fx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/hlsl/phosphor.fx b/hlsl/phosphor.fx index 85647fb83e9..44b00ac0ee7 100644 --- a/hlsl/phosphor.fx +++ b/hlsl/phosphor.fx @@ -47,7 +47,6 @@ struct VS_INPUT float3 Position : POSITION; float4 Color : COLOR0; float2 TexCoord : TEXCOORD0; - float2 Unused : TEXCOORD1; }; struct PS_INPUT @@ -62,10 +61,9 @@ struct PS_INPUT //----------------------------------------------------------------------------- uniform float2 ScreenDims; - uniform float2 TargetDims; -uniform float Passthrough; +uniform bool Passthrough; VS_OUTPUT vs_main(VS_INPUT Input) { @@ -73,13 +71,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 *= float4(2.0f, 2.0f, 1.0f, 1.0f); - Output.Color = Input.Color; + 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.PrevCoord = Output.TexCoord; + + Output.Color = Input.Color; return Output; } @@ -99,7 +98,9 @@ float4 ps_main(PS_INPUT Input) : COLOR float GreenMax = max(CurrPix.g, PrevPix.g); float BlueMax = max(CurrPix.b, PrevPix.b); - return lerp(float4(RedMax, GreenMax, BlueMax, CurrPix.a), CurrPix, Passthrough); + return Passthrough + ? CurrPix + : float4(RedMax, GreenMax, BlueMax, CurrPix.a); } //----------------------------------------------------------------------------- |