Skip to content

Commit

Permalink
fix: soft mask is upside down on some devices (refactor)
Browse files Browse the repository at this point in the history
  • Loading branch information
mob-sakai committed Aug 17, 2024
1 parent 381bf71 commit d17784e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Packages/src/Shaders/SoftMask.cginc
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ float2 ClipToUv(const float2 clipPos)
{
half2 uv = clipPos.xy / _ScreenParams.xy;
#if UNITY_UV_STARTS_AT_TOP
uv.y = 1 - uv.y;
#endif
if (_ProjectionParams.x < 0)
if (0 <= _ProjectionParams.x)
uv.y = 1 - uv.y;
#endif

#if UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION
float ratio = _ScreenParams.x / _ScreenParams.y;
Expand Down

0 comments on commit d17784e

Please sign in to comment.