diff options
author | chai <chaifix@163.com> | 2022-03-10 14:07:40 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2022-03-10 14:07:40 +0800 |
commit | 22891bf59032ba88262824255a706d652031384b (patch) | |
tree | 7595439ba9966c9402d37e37cee5e8cf098757d5 /Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader | |
parent | 8b04ea73e540067f83870b61d89db4868fea5e8a (diff) |
* move folder
Diffstat (limited to 'Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader')
-rw-r--r-- | Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader b/Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader deleted file mode 100644 index d3a67ca9..00000000 --- a/Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader +++ /dev/null @@ -1,65 +0,0 @@ -// 动态模糊 - -Shader "Erika/Common/Image/MotionBlur" -{ - Properties - { - _MainTex("Texture", 2D) = "white" {} - _Angle("Angle", float) = 0 - _Distance("Distance", float) = 0 - _UnitTileOffset("TileOffset", Vector) = (1,1,0,0) - _Iterate("Iterate Count", float) = 1 - } - - SubShader - { - Tags { "RenderType" = "Opaque" "Queue" = "Transparent-1"} - LOD 100 - - ZWrite Off - ZTest LEqual - - Blend SrcAlpha OneMinusSrcAlpha - - Pass - { - CGPROGRAM - #pragma vertex image_vert - #pragma fragment frag - - #include "UnityCG.cginc" - #include "./ImageEffect.cginc" - - float _Angle; - fixed _Distance; - float _Iterate; // 迭代次数 - float _AlphaMultiplier; // - - fixed4 frag(image_v2f i) : SV_Target - { - _Distance = 0.1; - - fixed2 uv0 = i.uv; - - fixed4 color = fixed4(0,0,0,0); - const float count = 20; - float step = _Distance / count; - float amount = 0.2f; - for(int i = 0; i < count; ++i) - { - fixed2 uv = uv0 + step * i * fixed2(cos(radians(_Angle)), sin(radians(_Angle))); - if(uv.x > 1) continue; - if(uv.x < 0) continue; - float weight = amount - amount * ((float)i / (float)count); - color += tex2D(_MainTex, uv) * weight; - } - - color.a *= _AlphaMultiplier; - - return color; - } - ENDCG - } - } - -} // shader |