Skip to content

Commit d17784e

Browse files
committed
fix: soft mask is upside down on some devices (refactor)
1 parent 381bf71 commit d17784e

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Packages/src/Shaders/SoftMask.cginc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@ float2 ClipToUv(const float2 clipPos)
4343
{
4444
half2 uv = clipPos.xy / _ScreenParams.xy;
4545
#if UNITY_UV_STARTS_AT_TOP
46-
uv.y = 1 - uv.y;
47-
#endif
48-
if (_ProjectionParams.x < 0)
46+
if (0 <= _ProjectionParams.x)
4947
uv.y = 1 - uv.y;
48+
#endif
5049

5150
#if UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION
5251
float ratio = _ScreenParams.x / _ScreenParams.y;

0 commit comments

Comments
 (0)