Skip to content

Commit

Permalink
fix: alpha does not work properly on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
homuler committed Aug 4, 2024
1 parent b9a336c commit f8071e2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ Shader "Unlit/MediaPipe/Mask Shader"
SubShader
{
Tags { "RenderType"="Transparent" }
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
LOD 100

Pass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Shader "Unlit/MediaPipe/Overlay Mask Shader"
fixed4 maskCol = tex2D(_MaskTex, i.uv);
int idx = int(i.uv.y * _Height) * _Width + int(i.uv.x * _Width);
float mask = _MaskBuffer[idx];
maskCol.a = mask;
maskCol.a = lerp(0.0, mask, step(_Threshold, mask));
fixed4 col = lerp(emptyCol, maskCol, step(_Threshold, mask));

// apply fog
Expand Down

0 comments on commit f8071e2

Please sign in to comment.