summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl/distortion.fx
diff options
context:
space:
mode:
author ImJezze <jezze@gmx.net>2016-04-13 19:21:57 +0200
committer ImJezze <jezze@gmx.net>2016-04-13 19:21:57 +0200
commit32f0e6efac8b51dbdc11b390b64753227cbb6180 (patch)
treeaf19990b09f731d098ca93781b732e0724ebf7e9 /hlsl/distortion.fx
parent6be4d8312ccf4d9b5fde5fc2b5094e637fbdf7d7 (diff)
Removed hacks for vector screens from shaders (nw)
- added handling of texture coordinates for vector screens to core render - added handling of orientation/rotation for vector screens to D3D renderer
Diffstat (limited to 'hlsl/distortion.fx')
-rw-r--r--hlsl/distortion.fx45
1 files changed, 9 insertions, 36 deletions
diff --git a/hlsl/distortion.fx b/hlsl/distortion.fx
index 0040c76d3b0..e33b8811ba5 100644
--- a/hlsl/distortion.fx
+++ b/hlsl/distortion.fx
@@ -89,8 +89,6 @@ uniform float2 ScreenDims; // size of the window or fullscreen
uniform float2 TargetDims; // size of the target surface
uniform float2 QuadDims; // size of the screen quad
-uniform bool VectorScreen;
-
VS_OUTPUT vs_main(VS_INPUT Input)
{
VS_OUTPUT Output = (VS_OUTPUT)0;
@@ -120,7 +118,6 @@ uniform float VignettingAmount = 0.0f;
uniform float ReflectionAmount = 0.0f;
uniform bool SwapXY = false;
-uniform int RotationType = 0; // 0 = 0°, 1 = 90°, 2 = 180°, 3 = 270°
float GetNoiseFactor(float3 n, float random)
{
@@ -146,40 +143,16 @@ float GetSpotAddend(float2 coord, float amount)
{
float2 SpotCoord = coord;
- // hack for vector screen
- if (VectorScreen)
- {
- // upper right quadrant
- float2 spotOffset =
- RotationType == 1 // 90°
- ? float2(-0.25f, -0.25f)
- : RotationType == 2 // 180°
- ? float2(0.25f, -0.25f)
- : RotationType == 3 // 270° else 0°
- ? float2(0.25f, 0.25f)
- : float2(-0.25f, 0.25f);
-
- // normalized screen canvas ratio
- float2 CanvasRatio = SwapXY
- ? float2(QuadDims.x / QuadDims.y, 1.0f)
- : float2(1.0f, QuadDims.y / QuadDims.x);
-
- SpotCoord += spotOffset;
- SpotCoord *= CanvasRatio;
- }
- else
- {
- // upper right quadrant
- float2 spotOffset = float2(-0.25f, 0.25f);
+ // upper right quadrant
+ float2 spotOffset = float2(-0.25f, 0.25f);
- // normalized screen canvas ratio
- float2 CanvasRatio = SwapXY
- ? float2(1.0f, QuadDims.x / QuadDims.y)
- : float2(1.0f, QuadDims.y / QuadDims.x);
+ // normalized screen canvas ratio
+ float2 CanvasRatio = SwapXY
+ ? float2(1.0f, QuadDims.x / QuadDims.y)
+ : float2(1.0f, QuadDims.y / QuadDims.x);
- SpotCoord += spotOffset;
- SpotCoord *= CanvasRatio;
- }
+ SpotCoord += spotOffset;
+ SpotCoord *= CanvasRatio;
float SpotBlur = amount;
@@ -201,7 +174,7 @@ float GetRoundCornerFactor(float2 coord, float radiusAmount, float smoothAmount)
smoothAmount = min(smoothAmount, radiusAmount);
float2 quadDims = QuadDims;
- quadDims = !VectorScreen && SwapXY
+ quadDims = SwapXY
? quadDims.yx
: quadDims.xy;