2021-04-24 03:06:03 +02:00
|
|
|
Shader "KernelPanic/add"
|
|
|
|
{
|
|
|
|
Properties
|
|
|
|
{
|
2021-04-25 01:59:37 +02:00
|
|
|
[HideInInspector] _MainTex ("Base (RGB)", 2D) = "white" {}
|
2021-04-24 03:06:03 +02:00
|
|
|
}
|
|
|
|
SubShader
|
|
|
|
{
|
|
|
|
Cull Off ZWrite Off ZTest Always Blend SrcAlpha OneMinusSrcAlpha
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
// This macro declares _BaseMap as a Texture2D object.
|
|
|
|
// TEXTURE2D(_MainTex);
|
|
|
|
// TEXTURE2D(_NoiseMap);
|
|
|
|
|
|
|
|
// This macro declares the sampler for the _BaseMap texture.
|
|
|
|
// SAMPLER(sampler_MainTex);
|
|
|
|
// SAMPLER(sampler_NoiseMap);
|
|
|
|
|
|
|
|
sampler2D _MainTex;
|
2021-04-26 00:44:43 +02:00
|
|
|
sampler2D _BlendTex;
|
2021-04-24 03:06:03 +02:00
|
|
|
|
|
|
|
float _Sample;
|
|
|
|
|
|
|
|
fixed4 frag (v2f i) : SV_Target
|
|
|
|
{
|
|
|
|
// sample raw glitch
|
2021-04-26 00:44:43 +02:00
|
|
|
|
|
|
|
float4 c = tex2D(_MainTex, i.uv);
|
|
|
|
float4 b = tex2D(_BlendTex, i.uv);
|
|
|
|
|
|
|
|
return lerp(b,c,_Sample);
|
2021-04-24 03:06:03 +02:00
|
|
|
|
2021-04-25 01:59:37 +02:00
|
|
|
// float4 c = tex2D(_MainTex, i.uv);
|
|
|
|
// c.a = _Sample;
|
2021-04-24 03:06:03 +02:00
|
|
|
|
2021-04-25 01:59:37 +02:00
|
|
|
// float4 g = tex2D(_GlitchTex, i.uv);
|
|
|
|
|
|
|
|
// return lerp(c,g,_Sample);
|
|
|
|
|
|
|
|
return c;
|
2021-04-24 03:06:03 +02:00
|
|
|
}
|
|
|
|
ENDCG
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|