diff options
Diffstat (limited to 'Assets/Bundle/Shaders/Common')
5 files changed, 87 insertions, 32 deletions
diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs b/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs deleted file mode 100644 index a5603324..00000000 --- a/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class common_img_bloom : MonoBehaviour -{ - // Start is called before the first frame update - void Start() - { - - } - - // Update is called once per frame - void Update() - { - - } -} diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs.meta b/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs.meta deleted file mode 100644 index a94e86e5..00000000 --- a/Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 31492de5533444b49bab8c503b8c6d0f -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader b/Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader new file mode 100644 index 00000000..467733f9 --- /dev/null +++ b/Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader @@ -0,0 +1,75 @@ +// 蜂鸣 + +Shader "Erika/Common/Image/Buzz" +{ + Properties + { + _MainTex("Texture", 2D) = "white" {} + _TileOffset("TileOffset", Vector) = (1,1,0,0) + } + + SubShader + { + Tags { "RenderType" = "Opaque" "Queue" = "Transparent-1"} + LOD 100 + + ZWrite Off + ZTest LEqual + + Blend One Zero + + Pass + { + CGPROGRAM + #pragma vertex vert + #pragma fragment frag + + #include "UnityCG.cginc" + + #include "Assets/Bundle/Shaders/Include/ImageEffect.cginc" + + struct v2f + { + float2 uv : TEXCOORD0; + float4 vertex : SV_POSITION; + }; + + sampler2D _MainTex; + float4 _MainTex_ST; + + sampler2D _CameraDepthTexture; + float4 _CameraDepthTexture_ST; + + sampler2D _UnitDepthTexture; + float4 _UnitDepthTexture_ST; + + float4 _TileOffset; // 角色的范围 + + v2f vert(appdata_img v) + { + v2f o; + o.vertex = UnityObjectToClipPos(v.vertex); + o.uv = TRANSFORM_TEX(v.texcoord, _MainTex); + return o; + } + + fixed4 frag(v2f i) : SV_Target + { + fixed2 uv = i.uv; + float depth0 = tex2D(_CameraDepthTexture, uv).r; + float depth1 = tex2D(_UnitDepthTexture, uv).r; + + fixed4 color = tex2D(_MainTex, uv); + + if (abs(depth0 - depth1) < 0.001f && depth1 != 1) + { + color.r = 1; + } + + return color; + } + ENDCG + } + } + +} // shader diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader.meta b/Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader.meta new file mode 100644 index 00000000..310221ef --- /dev/null +++ b/Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 506516fea7a699443b904c0221d860f7 +ShaderImporter: + externalObjects: {} + defaultTextures: [] + nonModifiableTextures: [] + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader b/Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader index 6219bdac..418d7347 100644 --- a/Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader +++ b/Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader @@ -1,4 +1,4 @@ -// 高斯模糊 +// 动态模糊 Shader "Erika/Common/Image/MotionBlur" { @@ -64,16 +64,16 @@ Shader "Erika/Common/Image/MotionBlur" fixed2 uv0 = i.uv; - //fixed4 color = blur(_MainTex, _ScreenParams.xy, uv); fixed4 color = fixed4(0,0,0,0); const float count = 20; float step = _Distance / count; + float amount = 0.15; 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 = 0.15 - 0.15 * ((float)i / (float)count); + float weight = amount - amount * ((float)i / (float)count); color += tex2D(_MainTex, uv) * weight; } |