summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl/focus.fx
diff options
context:
space:
mode:
author ImJezze <jezze@gmx.net>2015-12-31 16:59:23 +0100
committer ImJezze <jezze@gmx.net>2015-12-31 16:59:23 +0100
commita2c7b61daa5d66e0e9d7b1d1f683cf2f6d9f5973 (patch)
tree253a2da2a557260a1910e844c5c6bcd2b79b0fa9 /hlsl/focus.fx
parenteea40fd0e47699261332904b5d930f0be68756e9 (diff)
Refactoring
- replaced shader parameters OrientationSwapXY xor RotationSwapXY by SwapXY - made shader parameters SourceDims, SourceRect, TargetDims, ScreenDims, QuadDims and SwapXY available for all shaders - color convolution, defocus and phosphor pass will now be skipped if all influencing parameters are 0 - removed unused bloom_texture and bloom_target arrays from cache_target class - fixed half texel offset in prescale.fx
Diffstat (limited to 'hlsl/focus.fx')
-rw-r--r--hlsl/focus.fx18
1 files changed, 5 insertions, 13 deletions
diff --git a/hlsl/focus.fx b/hlsl/focus.fx
index 6da8ab928a2..c5e5262fedd 100644
--- a/hlsl/focus.fx
+++ b/hlsl/focus.fx
@@ -46,15 +46,6 @@ struct PS_INPUT
};
//-----------------------------------------------------------------------------
-// Functions
-//-----------------------------------------------------------------------------
-
-bool xor(bool a, bool b)
-{
- return (a || b) && !(a && b);
-}
-
-//-----------------------------------------------------------------------------
// Defocus Vertex Shader
//-----------------------------------------------------------------------------
@@ -98,18 +89,19 @@ float2 Coord8Offset = float2( 1.00f, -0.25f);
uniform float2 Defocus = float2(0.0f, 0.0f);
-uniform bool OrientationSwapXY = false; // false landscape, true portrait for default screen orientation
-uniform bool RotationSwapXY = false; // swapped default screen orientation due to screen rotation
+uniform bool SwapXY = false;
float4 ps_main(PS_INPUT Input) : COLOR
{
float2 QuadRatio =
- float2(1.0f, xor(OrientationSwapXY, RotationSwapXY)
+ float2(1.0f, SwapXY
? QuadDims.y / QuadDims.x
: QuadDims.x / QuadDims.y);
// imaginary texel dimensions independed from quad dimensions, but dependend on quad ratio
- float2 DefocusTexelDims = (1.0f / 1024.0) * SourceRect * QuadRatio * Defocus;
+ float2 TexelDims = (1.0f / 1024.0) * SourceRect * QuadRatio;
+
+ float2 DefocusTexelDims = Defocus * TexelDims;
float4 d = tex2D(DiffuseSampler, Input.TexCoord);
float3 d1 = tex2D(DiffuseSampler, Input.TexCoord + Coord1Offset * DefocusTexelDims).rgb;