diff options
author | ImJezze <jezze@gmx.net> | 2015-08-02 17:31:54 +0200 |
---|---|---|
committer | ImJezze <jezze@gmx.net> | 2015-08-02 17:31:54 +0200 |
commit | 37f6ff0b653f840010a9b2dd18b5df9e6337aa2c (patch) | |
tree | c852c4b4fe4de4c4f46f858a4d8721ce0784c37a /hlsl/primary.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/primary.fx')
-rw-r--r-- | hlsl/primary.fx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/hlsl/primary.fx b/hlsl/primary.fx index ed73750185d..da9abf028be 100644 --- a/hlsl/primary.fx +++ b/hlsl/primary.fx @@ -33,7 +33,6 @@ struct VS_INPUT float3 Position : POSITION; float4 Color : COLOR0; float2 TexCoord : TEXCOORD0; - float2 Unused : TEXCOORD1; }; struct PS_INPUT @@ -47,6 +46,7 @@ struct PS_INPUT //----------------------------------------------------------------------------- uniform float2 ScreenDims; + uniform bool PostPass; uniform float Brighten; @@ -56,11 +56,13 @@ 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.TexCoord = PostPass ? (Input.Position.xy / ScreenDims) : Input.TexCoord; + Output.TexCoord = PostPass + ? Input.Position.xy / ScreenDims + : Input.TexCoord; Output.Color = Input.Color; @@ -87,6 +89,8 @@ technique TestTechnique { Lighting = FALSE; + Sampler[0] = <DiffuseSampler>; + VertexShader = compile vs_2_0 vs_main(); PixelShader = compile ps_2_0 ps_main(); } |