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/ImageEffect.cginc18
-rw-r--r--Assets/Bundle/Shaders/Common/Image/ImageEffect.cginc.meta (renamed from Assets/Bundle/Shaders/Include/ImageEffect.cginc.meta)0
-rw-r--r--Assets/Bundle/Shaders/Common/Image/ImageHelper.cginc (renamed from Assets/Bundle/Shaders/Include/ImageEffect.cginc)0
-rw-r--r--Assets/Bundle/Shaders/Common/Image/ImageHelper.cginc.meta (renamed from Assets/Bundle/Shaders/Include/ImageHelper.cginc.meta)0
-rw-r--r--Assets/Bundle/Shaders/Common/Image/common_img_blur.shader12
-rw-r--r--Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader16
-rw-r--r--Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader11
-rw-r--r--Assets/Bundle/Shaders/Common/common_gbuffer.shader68
-rw-r--r--Assets/Bundle/Shaders/Common/common_gbuffer.shader.meta9
-rw-r--r--Assets/Bundle/Shaders/Include/ImageHelper.cginc4
-rw-r--r--Assets/Bundle/Shaders/Unit/Effect.meta8
11 files changed, 113 insertions, 33 deletions
diff --git a/Assets/Bundle/Shaders/Common/Image/ImageEffect.cginc b/Assets/Bundle/Shaders/Common/Image/ImageEffect.cginc
new file mode 100644
index 00000000..04334ee4
--- /dev/null
+++ b/Assets/Bundle/Shaders/Common/Image/ImageEffect.cginc
@@ -0,0 +1,18 @@
+// UnitLensEffectЧ¹û
+
+sampler2D _MainTex;
+float4 _MainTex_ST;
+
+sampler2D _CameraDepthTexture;
+float4 _CameraDepthTexture_ST;
+
+sampler2D _UnitDepthTexture; // ÅäºÏ_CameraDepthTexture¶¨Î»½ÇÉ«
+float4 _UnitDepthTexture_ST;
+
+sampler2D _UnitWorldNormalTexture;
+float4 _UnitWorldNormalTexture_ST;
+
+sampler2D _UnitMotionVectorTexture;
+float4 _UnitMotionVectorTexture_ST;
+
+float4 _UnitTileOffset;
diff --git a/Assets/Bundle/Shaders/Include/ImageEffect.cginc.meta b/Assets/Bundle/Shaders/Common/Image/ImageEffect.cginc.meta
index 8a4c56b7..8a4c56b7 100644
--- a/Assets/Bundle/Shaders/Include/ImageEffect.cginc.meta
+++ b/Assets/Bundle/Shaders/Common/Image/ImageEffect.cginc.meta
diff --git a/Assets/Bundle/Shaders/Include/ImageEffect.cginc b/Assets/Bundle/Shaders/Common/Image/ImageHelper.cginc
index ffe5bc11..ffe5bc11 100644
--- a/Assets/Bundle/Shaders/Include/ImageEffect.cginc
+++ b/Assets/Bundle/Shaders/Common/Image/ImageHelper.cginc
diff --git a/Assets/Bundle/Shaders/Include/ImageHelper.cginc.meta b/Assets/Bundle/Shaders/Common/Image/ImageHelper.cginc.meta
index d5b4db71..d5b4db71 100644
--- a/Assets/Bundle/Shaders/Include/ImageHelper.cginc.meta
+++ b/Assets/Bundle/Shaders/Common/Image/ImageHelper.cginc.meta
diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_blur.shader b/Assets/Bundle/Shaders/Common/Image/common_img_blur.shader
index d1e00953..89102da7 100644
--- a/Assets/Bundle/Shaders/Common/Image/common_img_blur.shader
+++ b/Assets/Bundle/Shaders/Common/Image/common_img_blur.shader
@@ -7,7 +7,7 @@ Shader "Erika/Common/Image/Blur"
_MainTex("Texture", 2D) = "white" {}
_Angle("Angle", float) = 0
_Distance("Distance", float) = 0
- _TileOffset("TileOffset", Vector) = (1,1,0,0)
+ _UnitTileOffset("TileOffset", Vector) = (1,1,0,0)
_Iterate("Iterate Count", float) = 1
}
@@ -29,7 +29,8 @@ Shader "Erika/Common/Image/Blur"
#include "UnityCG.cginc"
- #include "Assets/Bundle/Shaders/Include/ImageEffect.cginc"
+ #include "./ImageEffect.cginc"
+ #include "./ImageHelper.cginc"
struct v2f
{
@@ -37,16 +38,11 @@ Shader "Erika/Common/Image/Blur"
float4 vertex : SV_POSITION;
};
- sampler2D _MainTex;
- float4 _MainTex_ST;
-
float _Angle;
- float4 _TileOffset; // 角色的范围
-
fixed _Distance;
- float _Iterate; // 迭代次数
+ float _Iterate;
v2f vert(appdata_img v)
{
diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader b/Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader
index 467733f9..929a57b7 100644
--- a/Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader
+++ b/Assets/Bundle/Shaders/Common/Image/common_img_buzz.shader
@@ -5,7 +5,7 @@ Shader "Erika/Common/Image/Buzz"
Properties
{
_MainTex("Texture", 2D) = "white" {}
- _TileOffset("TileOffset", Vector) = (1,1,0,0)
+ _UnitTileOffset("TileOffset", Vector) = (1,1,0,0)
}
SubShader
@@ -26,7 +26,8 @@ Shader "Erika/Common/Image/Buzz"
#include "UnityCG.cginc"
- #include "Assets/Bundle/Shaders/Include/ImageEffect.cginc"
+ #include "./ImageEffect.cginc"
+ #include "./ImageHelper.cginc"
struct v2f
{
@@ -34,17 +35,6 @@ Shader "Erika/Common/Image/Buzz"
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;
diff --git a/Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader b/Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader
index 418d7347..2246fda2 100644
--- a/Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader
+++ b/Assets/Bundle/Shaders/Common/Image/common_img_motionblur.shader
@@ -7,7 +7,7 @@ Shader "Erika/Common/Image/MotionBlur"
_MainTex("Texture", 2D) = "white" {}
_Angle("Angle", float) = 0
_Distance("Distance", float) = 0
- _TileOffset("TileOffset", Vector) = (1,1,0,0)
+ _UnitTileOffset("TileOffset", Vector) = (1,1,0,0)
_Iterate("Iterate Count", float) = 1
}
@@ -29,7 +29,7 @@ Shader "Erika/Common/Image/MotionBlur"
#include "UnityCG.cginc"
- #include "Assets/Bundle/Shaders/Include/ImageEffect.cginc"
+ #include "./ImageEffect.cginc"
struct v2f
{
@@ -37,13 +37,8 @@ Shader "Erika/Common/Image/MotionBlur"
float4 vertex : SV_POSITION;
};
- sampler2D _MainTex;
- float4 _MainTex_ST;
-
float _Angle;
- float4 _TileOffset; // 角色的范围
-
fixed _Distance;
float _Iterate; // 迭代次数
@@ -67,7 +62,7 @@ Shader "Erika/Common/Image/MotionBlur"
fixed4 color = fixed4(0,0,0,0);
const float count = 20;
float step = _Distance / count;
- float amount = 0.15;
+ float amount = 0.2f;
for(int i = 0; i < count; ++i)
{
fixed2 uv = uv0 + step * i * fixed2(cos(radians(_Angle)), sin(radians(_Angle)));
diff --git a/Assets/Bundle/Shaders/Common/common_gbuffer.shader b/Assets/Bundle/Shaders/Common/common_gbuffer.shader
new file mode 100644
index 00000000..485a52c1
--- /dev/null
+++ b/Assets/Bundle/Shaders/Common/common_gbuffer.shader
@@ -0,0 +1,68 @@
+Shader "Erika/Common/GBuffer"
+{
+ Properties
+ {
+ _MainTex ("Texture", 2D) = "white" {}
+ }
+ SubShader
+ {
+ Tags { "RenderType"="Opaque" }
+ LOD 100
+
+ Pass
+ {
+ CGPROGRAM
+ #pragma vertex vert
+ #pragma fragment frag
+
+ #include "UnityCG.cginc"
+
+ struct appdata
+ {
+ float3 vertex : POSITION;
+ float3 normal : NORMAL;
+ float3 tangent : TANGENT;
+ float2 uv : TEXCOORD0;
+ };
+
+ struct v2f
+ {
+ float2 uv : TEXCOORD0;
+ float3 normal : TEXCOORD1;
+ float3 worldPos : TEXCOORD2;
+ float4 vertex : SV_POSITION;
+ };
+
+ struct Output
+ {
+ float4 diffuse : SV_Target0;
+ float4 normal : SV_Target1;
+ float4 position : SV_Target2;
+ float4 texCoord : SV_Target3;
+ };
+
+ sampler2D _MainTex;
+ float4 _MainTex_ST;
+
+ v2f vert (appdata v)
+ {
+ v2f o;
+ o.vertex = UnityObjectToClipPos(v.vertex);
+ o.uv = TRANSFORM_TEX(v.uv, _MainTex);
+ o.worldPos = mul(unity_ObjectToWorld, float4(v.vertex, 1)).xyz;
+ return o;
+ }
+
+ Output frag (v2f i)
+ {
+ Output o;
+ fixed4 col = tex2D(_MainTex, i.uv);
+ o.diffuse = fixed4(1,0,0,1);
+ o.normal = fixed4(1,1,0,1);
+ o.position = fixed4(i.worldPos, 1);
+ return o;
+ }
+ ENDCG
+ }
+ }
+}
diff --git a/Assets/Bundle/Shaders/Common/common_gbuffer.shader.meta b/Assets/Bundle/Shaders/Common/common_gbuffer.shader.meta
new file mode 100644
index 00000000..b40b2f5a
--- /dev/null
+++ b/Assets/Bundle/Shaders/Common/common_gbuffer.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 1bb32fe6a2152fc45b9badd5cf9ed7ed
+ShaderImporter:
+ externalObjects: {}
+ defaultTextures: []
+ nonModifiableTextures: []
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/Bundle/Shaders/Include/ImageHelper.cginc b/Assets/Bundle/Shaders/Include/ImageHelper.cginc
deleted file mode 100644
index 57822700..00000000
--- a/Assets/Bundle/Shaders/Include/ImageHelper.cginc
+++ /dev/null
@@ -1,4 +0,0 @@
-
-// ±ßÔµ¼ì²â
-
-
diff --git a/Assets/Bundle/Shaders/Unit/Effect.meta b/Assets/Bundle/Shaders/Unit/Effect.meta
new file mode 100644
index 00000000..7df9a033
--- /dev/null
+++ b/Assets/Bundle/Shaders/Unit/Effect.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 9cc4684b9f432f149b16a51f148c9490
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant: