Fixed mask orientation for vector screen

This commit is contained in:
ImJezze 2016-03-12 19:17:57 +01:00
parent 4c7e845498
commit b1a392a45f

View file

@ -132,7 +132,7 @@ uniform float ScanlineHeight = 1.0f;
uniform float3 BackColor = float3(0.0f, 0.0f, 0.0f);
uniform int ShadowTileMode = 0; // 0 based on screen dimension, 1 based on source dimension
uniform int ShadowTileMode = 0; // 0 based on screen (quad) dimension, 1 based on source dimension
uniform float ShadowAlpha = 0.0f;
uniform float2 ShadowCount = float2(6.0f, 6.0f);
uniform float2 ShadowUV = float2(0.25f, 0.25f);
@ -174,17 +174,26 @@ float2 GetShadowCoord(float2 QuadCoord, float2 SourceCoord)
float2 shadowUV = ShadowUV;
float2 shadowCount = ShadowCount;
canvasCoord = !VectorScreen && ShadowTileMode == 0 && SwapXY
// swap x/y vector and raster in screen mode (not source mode)
canvasCoord = ShadowTileMode == 0 && SwapXY
? canvasCoord.yx
: canvasCoord.xy;
shadowCount = !VectorScreen && ShadowTileMode == 0 && SwapXY
// swap x/y vector and raster in screen mode (not source mode)
shadowCount = ShadowTileMode == 0 && SwapXY
? shadowCount.yx
: shadowCount.xy;
float2 shadowTile = canvasTexelDims * shadowCount;
// swap x/y vector in screen mode (not raster and not source mode)
shadowTile = VectorScreen && ShadowTileMode == 0 && SwapXY
? shadowTile.yx
: shadowTile.xy;
float2 shadowFrac = frac(canvasCoord / shadowTile);
// swap x/y raster in screen mode (not vector and not source mode)
shadowFrac = !VectorScreen && ShadowTileMode == 0 && SwapXY
? shadowFrac.yx
: shadowFrac.xy;