-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy patholdTV.shader
56 lines (45 loc) · 1.26 KB
/
oldTV.shader
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Shader "LX/OldTV"
{
Properties
{
_MainTex ("Base (RGB)", 2D) = "white" {}
}
CGINCLUDE
#include "UnityCG.cginc"
sampler2D _MainTex;
float _Expand;
float _NoiseIntensity;
int _StripeIntensity;
float simpleNoise(float2 uv)
{
return frac(sin(dot(uv, float2(12.9898, 78.233))) * 43758.5453);
}
half4 frag(v2f_img i) : SV_Target
{
float d2 = dot(i.uv - half2(0.5, 0.5), i.uv - half2(0.5, 0.5));
half2 coord = (i.uv - half2(0.5, 0.5)) * (_Expand + d2 * (1 - _Expand)) + half2(0.5, 0.5);
half4 color = tex2D(_MainTex, coord);
float n = simpleNoise(coord.xy * _Time.x);
half3 result = color.rgb * (1-_NoiseIntensity) + _NoiseIntensity * n;
half2 sc = half2((sin(coord.y * _StripeIntensity) + 1) / 2, (cos(coord.y * _StripeIntensity) + 1) / 2);
result += color.rgb * sc.xyx;
return half4(result, color.a);
}
ENDCG
SubShader
{
ZTest Always Cull Off ZWrite Off
Fog
{
Mode off
}
Pass
{
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
ENDCG
}
}
FallBack off
}