-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.data
211 lines (182 loc) · 7.63 KB
/
index.data
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
#extension GL_OES_standard_derivatives:enable
#define PI 3.141592
precision highp float;
// precision highp vec2;
// size of a square in pixel
uniform float scale;
uniform highp vec2 resolution;
uniform highp vec2 offset;
//out vec4 fragColor;
float aastep(float threshold,float value){
float afwidth=.7*length(vec2(dFdx(value),dFdy(value)));
return smoothstep(threshold-afwidth,threshold+afwidth,value);
}
void main(){
// if(scale < 20.){
// discard;}
// Normalized pixel coordinates (from 0 to 1)
// gl_FragCoord = gl_FragCoord + offset;
highp vec2 uv=(-gl_FragCoord.xy - offset)/resolution.xy;
float dotResolution=resolution.y/scale/2.;
float dotRadius=.15;
uv.x*=dotResolution*(resolution.x/resolution.y);
uv.y*=dotResolution;
uv.y+=.5;
uv.x+=.5;
highp vec2 uv2=2.*fract(uv)-1.;
//uv2.x *= u_resolution.x / u_resolution.y;
float distance=length(uv2);
// vec4 dark_gray=vec4(.082,.082,.082,0);
vec4 dark_gray = vec4(0);
vec4 gray=vec4(.282,.282,.282,1);
highp vec4 Coord=cos(PI/scale*vec4((-gl_FragCoord.xy - offset),1,1));
vec4 gridColor=mix(dark_gray, gray, aastep(.97,max(Coord.x,Coord.y)));
// gridColor+=vec4(0,0,0,1);
vec4 color=mix(gray,gridColor,aastep(dotRadius,distance));
// if(color.a < 0.03)
// discard;
gl_FragColor=color;}
// precision highp vec2
// uniform vec2 res;
uniform sampler2D screenTexture;
uniform highp vec2 resolution;
highp vec4 blur13(sampler2D image, vec2 uv, vec2 resolution, vec2 direction) {
highp vec4 color = vec4(0.0);
highp vec2 off1 = vec2(1.411764705882353) * direction;
highp vec2 off2 = vec2(3.2941176470588234) * direction;
highp vec2 off3 = vec2(5.176470588235294) * direction;
color += texture2D(image, uv) * 0.1964825501511404;
color += texture2D(image, uv + (off1 / resolution)) * 0.2969069646728344;
color += texture2D(image, uv - (off1 / resolution)) * 0.2969069646728344;
color += texture2D(image, uv + (off2 / resolution)) * 0.09447039785044732;
color += texture2D(image, uv - (off2 / resolution)) * 0.09447039785044732;
color += texture2D(image, uv + (off3 / resolution)) * 0.010381362401148057;
color += texture2D(image, uv - (off3 / resolution)) * 0.010381362401148057;
return color;
}
void main()
{
// Normalized pixel coordinates (from 0 to 1)
highp vec2 uv = gl_FragCoord.xy/resolution.xy;
// if(texture2D(screenTexture, uv) == vec4(0,0,0,1.))
// discard;
uv /= 4.;
highp vec4 Color = blur13(screenTexture, uv, resolution, vec2(0,0.5));
// Color = (Color / vec4(2.,2.,2.,1.)) + (texture2D(screenTexture, uv) / vec4(2.,2.,2.,1.));
gl_FragColor = Color;
}precision lowp float;
uniform vec2 resolution;
uniform float scale;
uniform vec2 offset;
void main(){
// Normalized pixel coordinates (from 0 to 1)
vec2 offsetCoords = -gl_FragCoord.xy + offset;
vec2 uv = offsetCoords.xy/resolution.xy;
uv.x *= (resolution.x/resolution.y);
// LUT
//uv.y = 1.-uv.y;
float b = (floor(uv.x*scale)+floor(uv.y*scale)*scale)/256.;
vec2 rg = fract(uv*scale);
vec3 col = vec3(rg,b);
// Output to screen
gl_FragColor = vec4(col,0.3);// / vec4(vec(5),1);
}attribute vec4 position;
void main()
{
gl_Position=vec4(position.xyz,1.0);
}precision highp float;
// precision highp vec2;
uniform vec2 resolution;
uniform float scale;
uniform vec2 offset;
uniform sampler2D texture;
uniform vec2 tileDims;
void main(){
// Normalized pixel coordinates (from 0 to 1)
vec2 offsetCoords = gl_FragCoord.xy + offset;
// gl_FragCoord -= vec4(1);
// offsetCoords *= 100./scale;// / 1.04;
// vec2 uv = offsetCoords/resolution;
// uv.x *= resolution.x/resolution.y;
//uv.x *= (resolution.x/resolution.y);
vec2 normCoords = vec2(offsetCoords.x/tileDims.x, offsetCoords.y/tileDims.y) * vec2(tileDims.x/2./scale, tileDims.y/2./scale);
//normCoords = mod(normCoords , vec2(1)) + normCoords;
normCoords /= tileDims;
normCoords = floor(normCoords * vec2(tileDims.x, tileDims.y))/vec2(tileDims.x, tileDims.y);
// LUT
//uv.y = 1.-uv.y;
// float b = (floor(uv.x*scale)+floor(uv.y*scale)*scale)/256.;
// vec2 rg = fract(uv*scale);
// vec3 col = vec3(rg,b);
// vec3 col = texture2D(texture, vec2(floor(uv.x), floor(uv.y))).rgb;
// vec3 col = vec3(0.5);
// vec3 col = vec3(uv < vec3(0.5) ? 0.1 : 1);
// vec3 col = texture2D(texture, vec2(100.,0.)).rgb;
// vec3 col = vec3(0);
// if(uv.x < tileDims.x/2.)
// col = vec3((mod(uv.y,1.) + mod(uv.x,1.))/2.);
//if(col.r < 0.1)
//col = vec3(1.,0,0);
// Output to screen S
vec4 texCol = texture2D(texture, normCoords * vec2(1.));
if(texCol.xyz == vec3(0)){
// texcol = vec4(0.086f, 0.086f, 0.086f, 1.0f);
discard;
}
gl_FragColor = vec4(texCol.rgb,1);// / vec4(vec(5),1);
}attribute vec4 position;
void main()
{
gl_Position=vec4(position.xyz,1.0);
}attribute vec4 position;
void main()
{
gl_Position=vec4(position.xyz,1.0);
}attribute vec4 position;
void main()
{
gl_Position=vec4(position.xyz,1.0);
}
// precision highp vec2
// uniform vec2 res;
uniform sampler2D screenTexture;
uniform highp vec2 resolution;
uniform bool horizontal;
// highp float weight[5] = float[] (0.227027, 0.1945946, 0.1216216, 0.054054, 0.016216);
void main(){
highp vec2 TexCoords = gl_FragCoord.xy / resolution.xy;
highp vec2 tex_offset = 1.0 / resolution.xy; // gets size of single texel
highp vec3 result = texture2D(screenTexture, TexCoords).rgb * 0.227027; // current fragment's contribution
if(horizontal)
{
// for(int i = 1; i < 5; ++i)
// {
result += texture2D(screenTexture, TexCoords + vec2(tex_offset.x * 1., 0.0)).rgb * 0.1945946;
result += texture2D(screenTexture, TexCoords - vec2(tex_offset.x * 1., 0.0)).rgb * 0.1945946;
result += texture2D(screenTexture, TexCoords + vec2(tex_offset.x * 2., 0.0)).rgb * 0.1216216;
result += texture2D(screenTexture, TexCoords - vec2(tex_offset.x * 2., 0.0)).rgb * 0.1216216;
result += texture2D(screenTexture, TexCoords + vec2(tex_offset.x * 3., 0.0)).rgb * 0.054054;
result += texture2D(screenTexture, TexCoords - vec2(tex_offset.x * 3., 0.0)).rgb * 0.054054;
result += texture2D(screenTexture, TexCoords + vec2(tex_offset.x * 4., 0.0)).rgb * 0.016216;
result += texture2D(screenTexture, TexCoords - vec2(tex_offset.x * 4., 0.0)).rgb * 0.016216;
// }
}
else
{
// for(int i = 1; i < 5; ++i)
// {
// result += texture2D(screenTexture, TexCoords + vec2(0.0, tex_offset.y * i)).rgb * weight[i];
// result += texture2D(screenTexture, TexCoords - vec2(0.0, tex_offset.y * i)).rgb * weight[i];
// }
result += texture2D(screenTexture, TexCoords + vec2(0.0, tex_offset.y * 1.)).rgb * 0.1945946;
result += texture2D(screenTexture, TexCoords - vec2(0.0, tex_offset.y * 1.)).rgb * 0.1945946;
result += texture2D(screenTexture, TexCoords + vec2(0.0, tex_offset.y * 2.)).rgb * 0.1216216;
result += texture2D(screenTexture, TexCoords - vec2(0.0, tex_offset.y * 2.)).rgb * 0.1216216;
result += texture2D(screenTexture, TexCoords + vec2(0.0, tex_offset.y * 3.)).rgb * 0.054054;
result += texture2D(screenTexture, TexCoords - vec2(0.0, tex_offset.y * 3.)).rgb * 0.054054;
result += texture2D(screenTexture, TexCoords + vec2(0.0, tex_offset.y * 4.)).rgb * 0.016216;
result += texture2D(screenTexture, TexCoords - vec2(0.0, tex_offset.y * 4.)).rgb * 0.016216;
}
// gl_FragColor = vec4(result, 1.);
gl_FragColor = vec4(1.);
}