Skip to content

Commit

Permalink
fix: soft mask buffer is fliped on UNITY_UV_STARTS_AT_TOP devices
Browse files Browse the repository at this point in the history
close #179
  • Loading branch information
mob-sakai committed Jul 26, 2024
1 parent 469b404 commit b44edc3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Shaders/SoftMask.cginc
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ float2 WorldToUv(float4 worldPos)
float2 ClipToUv(const float2 clipPos)
{
half2 uv = clipPos.xy / _ScreenParams.xy;
if (0 < _ProjectionParams.x)
uv.y = 1 - uv.y;
#if UNITY_UV_STARTS_AT_TOP
uv.y = 1 - uv.y;
#endif

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

0 comments on commit b44edc3

Please sign in to comment.