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 c3ae631 commit c9db361
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions 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 c9db361

Please sign in to comment.