summaryrefslogtreecommitdiffstatshomepage
path: root/hlsl
diff options
context:
space:
mode:
author ImJezze <jezze@gmx.net>2015-10-19 19:03:56 +0200
committer ImJezze <jezze@gmx.net>2015-10-19 19:03:56 +0200
commitcd7de43b13e33f0d3d8fa3f31e48e2e669c31c1c (patch)
tree15ca881f413f96209f083c9210fc4fd0eb9e77ee /hlsl
parent7eb83c31a5cdcb13a3e596555ecf3a8597f4b5c9 (diff)
Fixed Aspect Ratios
- fixed aspect ratios in special post.fx shader for artwork support
Diffstat (limited to 'hlsl')
-rw-r--r--hlsl/artwork_support/post.fx21
1 files changed, 11 insertions, 10 deletions
diff --git a/hlsl/artwork_support/post.fx b/hlsl/artwork_support/post.fx
index ed6c7ce51aa..e4c2098744a 100644
--- a/hlsl/artwork_support/post.fx
+++ b/hlsl/artwork_support/post.fx
@@ -216,7 +216,9 @@ float GetSpotAddend(float2 coord, float amount)
// normalized screen canvas ratio
float2 CanvasRatio = PrepareVector
? float2(1.0f, QuadDims.y / QuadDims.x)
- : 1.0f / float2(1.0f, SourceRect.y / SourceRect.x);
+ : float2(1.0f, xor(OrientationSwapXY, RotationSwapXY)
+ ? QuadDims.x / QuadDims.y
+ : QuadDims.y / QuadDims.x);
// upper right quadrant
float2 spotOffset = OrientationSwapXY
@@ -251,16 +253,16 @@ float GetRoundCornerFactor(float2 coord, float radiusAmount, float smoothAmount)
float2 CanvasDims = PrepareVector
? ScreenDims
- : SourceDims;
-
- // hack: alignment correction
+ : xor(OrientationSwapXY, RotationSwapXY)
+ ? QuadDims.yx / SourceRect
+ : QuadDims.xy / SourceRect;
+
+ // raster graphics
if (!PrepareVector)
{
- float2 SourceArea = 1.0f / SourceRect;
- float2 SourceTexelDims = 1.0f / CanvasDims;
-
- coord -= SourceTexelDims * SourceArea * 0.75;
- coord *= SourceTexelDims * SourceArea * 0.25 + 1.0f;
+ // alignment correction
+ float2 SourceTexelDims = 1.0f / SourceDims;
+ coord -= SourceTexelDims;
}
float range = min(CanvasDims.x, CanvasDims.y) * 0.5;
@@ -330,7 +332,6 @@ float2 GetCoords(float2 coord, float2 centerOffset, float distortionAmount)
float4 ps_main(PS_INPUT Input) : COLOR
{
float2 ScreenTexelDims = 1.0f / ScreenDims;
- float2 SourceTexelDims = 1.0f / SourceDims;
float2 HalfSourceRect = PrepareVector
? float2(0.5f, 0.5f)