Roman cb9a50f183 Squashed commit of the following:
commit c9c9ab412170ffd32a12b0660858625856aa3244
Author: lspdC <961907320@qq.com>
Date:   Thu Mar 24 22:11:29 2022 +0800

    3.24
    完成除boss战以外交互,逐步整合美术素材

commit 2a2a11e8514ab67008c85b25b6703888f1ed8824
Author: lspdC <961907320@qq.com>
Date:   Tue Mar 22 22:15:12 2022 +0800

    3.22
    完成了跟踪雷击与玩家的碰撞判定,玩家的受击反馈
    击碎石头那边还有bug,明天再改

commit db3134349aaabb0ba0aaa64e43851ee0d6812fa0
Author: lspdC <961907320@qq.com>
Date:   Mon Mar 21 19:51:46 2022 +0800

    3.21(和霄酱搅在一起了喵)

commit d5836fec13668bd6a00ab8e9377f3959d86ab037
Author: lspdC <961907320@qq.com>
Date:   Mon Mar 21 19:49:15 2022 +0800

    3.21(未合并)
    完成火焰,碎石交互,武器升级替换。
    设置好打雷演出框架,自动追击的雷击框架,尚未加入碰撞判定。

commit 698339a63c5ad608945a2e5702b7b216c97245c3
Author: lspdC <961907320@qq.com>
Date:   Sun Mar 20 23:28:11 2022 +0800

    3.20 和京力交融之后的版本

commit 44c4946a717cd915dae1c92cb536031abf2f9343
Author: lspdC <961907320@qq.com>
Date:   Sun Mar 20 23:24:29 2022 +0800

    3.20
    整理了树木交互,写了个具体互动物品的基类。
    创建了火类,实现火焰交互示意(拿上木棍才能成功交互)。

commit 1b5d15c2d2c98a71d12a79c9443d9cf4c89c7f40
Author: lspdC <961907320@qq.com>
Date:   Sun Mar 20 14:43:08 2022 +0800

    sb coding
2022-03-25 19:50:39 +08:00

99 lines
2.6 KiB
Plaintext

Shader "pp/ScreenEffectShader"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Color("color",Color) = (1,1,1,1)
}
SubShader
{
// No culling or depth
Cull Off ZWrite Off ZTest Always
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
v2f vert (appdata v)
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
return o;
}
sampler2D _MainTex;
sampler2D _GulussTex;
float4 _MainTex_TexelSize;
float4 _GulussTex_TexelSize;
float3 _Color;
float _BlurRadius;
float _Radius;
static float r = 1;
fixed luminance(fixed3 col)
{
return col.x * 0.299 + col.y * 0.587 + col.z * 0.114;
}
fixed4 frag (v2f i) : SV_Target
{
fixed3 col = tex2D(_MainTex,i.uv + _MainTex_TexelSize.xy*r*fixed2(-1,-1)).rgb * -1;
col += tex2D(_MainTex,i.uv + _MainTex_TexelSize.xy*r*fixed2(0,-1)).rgb * -2;
col += tex2D(_MainTex,i.uv + _MainTex_TexelSize.xy*r*fixed2(1,-1)).rgb * -1;
col += tex2D(_MainTex,i.uv + _MainTex_TexelSize.xy*r*fixed2(-1,0)).rgb * 0;
col += tex2D(_MainTex,i.uv + _MainTex_TexelSize.xy*r*fixed2(0,0)).rgb * 0;
col += tex2D(_MainTex,i.uv + _MainTex_TexelSize.xy*r*fixed2(1,0)).rgb * 0;
col += tex2D(_MainTex,i.uv + _MainTex_TexelSize.xy*r*fixed2(-1,1)).rgb * 1;
col += tex2D(_MainTex,i.uv + _MainTex_TexelSize.xy*r*fixed2(0,1)).rgb * 2;
col += tex2D(_MainTex,i.uv + _MainTex_TexelSize.xy*r*fixed2(1,1)).rgb * 1;
fixed gray = abs(luminance(col));
col = tex2D(_MainTex,i.uv + _MainTex_TexelSize.xy*r*fixed2(-1,-1)).rgb * -1;
col += tex2D(_MainTex,i.uv + _MainTex_TexelSize.xy*r*fixed2(0,-1)).rgb * 0;
col += tex2D(_MainTex,i.uv + _MainTex_TexelSize.xy*r*fixed2(1,-1)).rgb * 1;
col += tex2D(_MainTex,i.uv + _MainTex_TexelSize.xy*r*fixed2(-1,0)).rgb * -2;
col += tex2D(_MainTex,i.uv + _MainTex_TexelSize.xy*r*fixed2(0,0)).rgb * 0;
col += tex2D(_MainTex,i.uv + _MainTex_TexelSize.xy*r*fixed2(1,0)).rgb * 2;
col += tex2D(_MainTex,i.uv + _MainTex_TexelSize.xy*r*fixed2(-1,1)).rgb * -1;
col += tex2D(_MainTex,i.uv + _MainTex_TexelSize.xy*r*fixed2(0,1)).rgb * 0;
col += tex2D(_MainTex,i.uv + _MainTex_TexelSize.xy*r*fixed2(1,1)).rgb * 1;
gray += abs(luminance(col));
fixed3 enhance = fixed3(gray, gray, gray)*_Color;
//fixed3 ori = tex2D(_MainTex, i.uv).rgb + enhance * 0.5;
return fixed4(enhance,1);
}
ENDCG
}
}
FallBack Off
}