summaryrefslogtreecommitdiff
path: root/Assets/Bundle/Shaders
diff options
context:
space:
mode:
Diffstat (limited to 'Assets/Bundle/Shaders')
-rw-r--r--Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs18
-rw-r--r--Assets/Bundle/Shaders/Common/Image/common_img_bloom.cs.meta11
-rw-r--r--Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader75
-rw-r--r--Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader.meta9
-rw-r--r--Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader6
-rw-r--r--Assets/Bundle/Shaders/Unit/Common.meta (renamed from Assets/Bundle/Shaders/Unit/Effect.meta)2
-rw-r--r--Assets/Bundle/Shaders/Unit/Common/unit_common_depth.shader64
-rw-r--r--Assets/Bundle/Shaders/Unit/Common/unit_common_depth.shader.meta9
8 files changed, 161 insertions, 33 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;
}
diff --git a/Assets/Bundle/Shaders/Unit/Effect.meta b/Assets/Bundle/Shaders/Unit/Common.meta
index 7df9a033..0f29291c 100644
--- a/Assets/Bundle/Shaders/Unit/Effect.meta
+++ b/Assets/Bundle/Shaders/Unit/Common.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 9cc4684b9f432f149b16a51f148c9490
+guid: 2873cd4cc2d0bfa4bbb17ad11144a488
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Assets/Bundle/Shaders/Unit/Common/unit_common_depth.shader b/Assets/Bundle/Shaders/Unit/Common/unit_common_depth.shader
new file mode 100644
index 00000000..075aec39
--- /dev/null
+++ b/Assets/Bundle/Shaders/Unit/Common/unit_common_depth.shader
@@ -0,0 +1,64 @@
+Shader "Erika/Unit/Common/Depth"
+{
+ Properties
+ {
+ _MainTex ("Texture", 2D) = "white" {}
+ }
+ SubShader
+ {
+ Tags { "RenderType" = "Opaque" "Queue" = "Geometry" }
+ LOD 100
+/*
+ Pass
+ {
+ Name "ShadowCaster"
+ Tags{"LightMode" = "ShadowCaster"}
+
+ CGPROGRAM
+ #pragma vertex vert
+ #pragma fragment frag
+ #pragma multi_compile_shadowcaster
+ #include "UnityCG.cginc"
+
+ struct v2f
+ {
+ V2F_SHADOW_CASTER;
+ };
+
+ v2f vert(appdata_base v)
+ {
+ v2f o;
+ TRANSFER_SHADOW_CASTER_NORMALOFFSET(o)
+ return o;
+ }
+
+ float4 frag(v2f i) :SV_Target
+ {
+ SHADOW_CASTER_FRAGMENT(i)
+ }
+
+ ENDCG
+
+ }*/
+
+ Pass
+ {
+ Name "ShadowCaster"
+ Tags { "LightMode" = "ShadowCaster" }
+
+ Cull Back
+ ZWrite On
+ ZTest LEqual
+
+ CGPROGRAM
+ #pragma target 3.0
+ #pragma multi_compile _ _ALPHATEST_ON _ALPHABLEND_ON
+ #pragma multi_compile_shadowcaster
+ #pragma vertex vertShadowCaster
+ #pragma fragment fragShadowCaster
+ #include "UnityStandardShadow.cginc"
+ ENDCG
+ }
+
+ }
+}
diff --git a/Assets/Bundle/Shaders/Unit/Common/unit_common_depth.shader.meta b/Assets/Bundle/Shaders/Unit/Common/unit_common_depth.shader.meta
new file mode 100644
index 00000000..0de1fc19
--- /dev/null
+++ b/Assets/Bundle/Shaders/Unit/Common/unit_common_depth.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: ff6fd35dfc3c1104c875126ac78274b6
+ShaderImporter:
+ externalObjects: {}
+ defaultTextures: []
+ nonModifiableTextures: []
+ userData:
+ assetBundleName:
+ assetBundleVariant: