diff options
author | chai <chaifix@163.com> | 2021-09-29 20:26:12 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-09-29 20:26:12 +0800 |
commit | b781f9ecf36bcc6c614538ac427fa2eb8f1e29d2 (patch) | |
tree | b7380f99de4763c56f80826c26f7875a89ef8dfe /Assets/Bundle/Shaders/Common/Image | |
parent | 61d6e9bf192ffa54abc57bab69b1bd88c3b8d62b (diff) |
*misc
Diffstat (limited to 'Assets/Bundle/Shaders/Common/Image')
-rw-r--r-- | Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader b/Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader index 702bbd4b..6219bdac 100644 --- a/Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader +++ b/Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader @@ -48,6 +48,8 @@ Shader "Erika/Common/Image/MotionBlur" float _Iterate; // 迭代次数 + float _AlphaMultiplier; // + v2f vert(appdata_img v) { v2f o; @@ -71,9 +73,12 @@ Shader "Erika/Common/Image/MotionBlur" fixed2 uv = uv0 + step * i * fixed2(cos(radians(_Angle)), sin(radians(_Angle))); if(uv.x > 1) continue; if(uv.x < 0) continue; - color += tex2D(_MainTex, uv) * 1 / count; + float weight = 0.15 - 0.15 * ((float)i / (float)count); + color += tex2D(_MainTex, uv) * weight; } + color.a *= _AlphaMultiplier; + return color; } ENDCG |