From 8fa7de8988e476a48e9177c962b8fb4267fd5e34 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期五, 30 五月 2025 11:39:35 +0800
Subject: [PATCH] 18 子 2D卡牌客户端搭建 / 2D卡牌客户端搭建 登陆前的流程

---
 Shader/GUI_ImageSmoothMask.shader |   21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/Shader/GUI_ImageSmoothMask.shader b/Shader/GUI_ImageSmoothMask.shader
index fb86274..4dada11 100644
--- a/Shader/GUI_ImageSmoothMask.shader
+++ b/Shader/GUI_ImageSmoothMask.shader
@@ -14,6 +14,10 @@
 		_StencilReadMask("Stencil Read Mask", Float) = 255
 
 		_ColorMask("Color Mask", Float) = 15
+
+		_LeftBottom("Left Bottom", Vector) = (0, 0, 0, 0)
+		_RightTop("Right Top", Vector) = (0, 0, 0, 0)
+		_SmoothRect("SmoothRect", Vector) = (0, 0, 0, 0)
 	}
 
 		SubShader
@@ -105,14 +109,27 @@
 
 					sampler2D _MainTex;
 
+					bool IsInRect(float2 pos)
+					{
+						if (pos.x > _LeftBottom.x && pos.x < _RightTop.x && pos.y > _LeftBottom.y && pos.y < _RightTop.y)
+						{
+							return true;
+						}
+						return false;
+					}
+
 					fixed4 frag(v2f IN) : SV_Target
 					{
 					half4 color = tex2D(_MainTex, IN.texcoord) * IN.color;
-					color.a = MaskCalculate(color.a, SelfUVCalculate(IN.texcoord1));
-					clip(color.a - 0.01);
+					float4 worldPos = mul(unity_ObjectToWorld, IN.texcoord1);
+					color.a = IsInRect(worldPos) ? 1 : 0;      //MaskCalculate(color.a, SelfUVCalculate(IN.texcoord1));
+					// clip(color.a - 0.01);
 					return color;
 					}
+
 					ENDCG
 				}
+
+			
 		}
 }

--
Gitblit v1.8.0