fix(eye-shader): 采样 UV 饱和并统一 half 精度

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-07-02 19:03:32 +08:00
co-authored by Cursor
parent 6ac7fcf9da
commit c08021a2c8
+5 -5
View File
@@ -133,23 +133,23 @@ Shader "AIBIS/EyeUnifiedSprite"
return saturate(mul(mat, color));
}
fixed4 sampleMainTex(float2 uv)
half4 sampleMainTex(float2 uv)
{
return tex2D(_MainTex, uv);
return tex2D(_MainTex, saturate(uv));
}
fixed3 GaussianBlurRgb(float2 uv, float stepSize)
half3 GaussianBlurRgb(float2 uv, float stepSize)
{
float angle = 1.937315; // ~111 deg, matches MemoryTuningSprite
float2 stepDir = float2(sin(angle), cos(angle));
float2 stepUv = stepDir * stepSize;
#if defined(SHADER_API_MOBILE)
fixed3 rgb = sampleMainTex(uv).rgb * 0.34;
half3 rgb = sampleMainTex(uv).rgb * 0.34;
rgb += sampleMainTex(uv + stepUv).rgb * 0.33;
rgb += sampleMainTex(uv - stepUv).rgb * 0.33;
#else
fixed3 rgb = sampleMainTex(uv).rgb * 0.18;
half3 rgb = sampleMainTex(uv).rgb * 0.18;
rgb += sampleMainTex(uv + stepUv * 1.0).rgb * 0.15;
rgb += sampleMainTex(uv - stepUv * 1.0).rgb * 0.15;
rgb += sampleMainTex(uv + stepUv * 2.0).rgb * 0.12;