-
Notifications
You must be signed in to change notification settings - Fork 28
/
hq2x.glsl
executable file
·531 lines (269 loc) · 7.88 KB
/
hq2x.glsl
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
// GLSL shader autogenerated by cg2glsl.py.
#if defined(VERTEX)
varying vec2 VARc22;
varying vec2 VARc21;
varying vec2 VARc20;
varying vec2 VARc12;
varying vec2 VARc11;
varying vec2 VARc10;
varying vec2 VARc02;
varying vec2 VARc01;
varying vec2 VARc00;
struct tex_coords {
vec2 VARc00;
vec2 VARc01;
vec2 VARc02;
vec2 VARc10;
vec2 VARc11;
vec2 VARc12;
vec2 VARc20;
vec2 VARc21;
vec2 VARc22;
};
struct input_dummy {
vec2 _video_size;
vec2 _texture_size;
vec2 _output_dummy_size;
};
vec4 _oPosition1;
tex_coords _coords1;
uniform mat4 MVPMatrix;
input_dummy _IN1;
vec4 _r0009;
attribute vec4 VertexCoord;
attribute vec4 COLOR;
varying vec4 COL0;
attribute vec4 TexCoord;
mat4 transpose_(mat4 matrix)
{
mat4 ret;
for (int i = 0; i != 4; i++)
for (int j = 0; j != 4; j++)
ret[i][j] = matrix[j][i];
return ret;
}
uniform int FrameDirection;
uniform int FrameCount;
#ifdef GL_ES
uniform mediump vec2 OutputSize;
uniform mediump vec2 TextureSize;
uniform mediump vec2 InputSize;
#else
uniform vec2 OutputSize;
uniform vec2 TextureSize;
uniform vec2 InputSize;
#endif
void main()
{
mat4 MVPMatrix_ = transpose_(MVPMatrix);
vec4 _oColor;
vec2 _delta;
tex_coords _TMP7;
_r0009.x = dot(MVPMatrix_[0], VertexCoord);
_r0009.y = dot(MVPMatrix_[1], VertexCoord);
_r0009.z = dot(MVPMatrix_[2], VertexCoord);
_r0009.w = dot(MVPMatrix_[3], VertexCoord);
_oPosition1 = _r0009;
_oColor = COLOR;
_delta = 5.00000000E-001/TextureSize;
_TMP7.VARc00 = TexCoord.xy + vec2(-_delta.x, -_delta.y);
_TMP7.VARc01 = TexCoord.xy + vec2(-_delta.x, 0.00000000E+000);
_TMP7.VARc02 = TexCoord.xy + vec2(-_delta.x, _delta.y);
_TMP7.VARc10 = TexCoord.xy + vec2(0.00000000E+000, -_delta.y);
_TMP7.VARc12 = TexCoord.xy + vec2(0.00000000E+000, _delta.y);
_TMP7.VARc20 = TexCoord.xy + vec2(_delta.x, -_delta.y);
_TMP7.VARc21 = TexCoord.xy + vec2(_delta.x, 0.00000000E+000);
_TMP7.VARc22 = TexCoord.xy + vec2(_delta.x, _delta.y);
VARc00 = _TMP7.VARc00;
VARc01 = _TMP7.VARc01;
VARc02 = _TMP7.VARc02;
VARc10 = _TMP7.VARc10;
VARc11 = TexCoord.xy;
VARc12 = _TMP7.VARc12;
VARc20 = _TMP7.VARc20;
VARc21 = _TMP7.VARc21;
VARc22 = _TMP7.VARc22;
gl_Position = _r0009;
COL0 = COLOR;
}
#elif defined(FRAGMENT)
#ifdef GL_ES
precision mediump float;
#endif
varying vec2 VARc22;
varying vec2 VARc21;
varying vec2 VARc20;
varying vec2 VARc12;
varying vec2 VARc11;
varying vec2 VARc10;
varying vec2 VARc02;
varying vec2 VARc01;
varying vec2 VARc00;
struct tex_coords {
vec2 VARc00;
vec2 VARc01;
vec2 VARc02;
vec2 VARc10;
vec2 VARc11;
vec2 VARc12;
vec2 VARc20;
vec2 VARc21;
vec2 VARc22;
};
struct input_dummy {
vec2 _video_size;
vec2 _texture_size;
vec2 _output_dummy_size;
};
vec4 _ret_0;
float _TMP29;
float _TMP30;
vec3 _TMP28;
float _TMP27;
vec3 _TMP26;
float _TMP25;
vec3 _TMP24;
float _TMP23;
vec3 _TMP22;
float _TMP21;
float _TMP20;
float _TMP19;
float _TMP18;
vec3 _TMP17;
float _TMP16;
vec3 _TMP15;
float _TMP14;
vec3 _TMP13;
float _TMP12;
vec3 _TMP11;
vec3 _TMP10;
vec3 _TMP9;
vec4 _TMP8;
vec4 _TMP7;
vec4 _TMP6;
vec4 _TMP5;
vec4 _TMP4;
vec4 _TMP3;
vec4 _TMP2;
vec4 _TMP1;
vec4 _TMP0;
tex_coords _co1;
uniform sampler2D Texture;
vec3 _a0058;
vec3 _a0062;
vec3 _a0066;
vec3 _a0070;
vec3 _a0074;
vec3 _a0078;
vec3 _a0084;
vec3 _a0086;
vec3 _a0088;
float _TMP91;
float _x0092;
vec3 _a0098;
float _TMP101;
float _x0102;
vec3 _a0108;
float _TMP111;
float _x0112;
vec3 _a0118;
float _TMP121;
float _x0122;
uniform int FrameDirection;
uniform int FrameCount;
#ifdef GL_ES
uniform mediump vec2 OutputSize;
uniform mediump vec2 TextureSize;
uniform mediump vec2 InputSize;
#else
uniform vec2 OutputSize;
uniform vec2 TextureSize;
uniform vec2 InputSize;
#endif
void main()
{
vec3 _c11;
float _md1;
float _md2;
float _w1;
float _w2;
float _w3;
float _w4;
float _t1;
float _t2;
float _ww;
float _lc1;
float _lc2;
vec3 _TMP38;
_TMP0 = texture2D(Texture, VARc00);
_TMP1 = texture2D(Texture, VARc01);
_TMP2 = texture2D(Texture, VARc02);
_TMP3 = texture2D(Texture, VARc10);
_TMP4 = texture2D(Texture, VARc11);
_TMP5 = texture2D(Texture, VARc12);
_TMP6 = texture2D(Texture, VARc20);
_TMP7 = texture2D(Texture, VARc21);
_TMP8 = texture2D(Texture, VARc22);
_a0058 = _TMP0.xyz - _TMP8.xyz;
_TMP9 = abs(_a0058);
_md1 = dot(_TMP9, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_a0062 = _TMP2.xyz - _TMP6.xyz;
_TMP10 = abs(_a0062);
_md2 = dot(_TMP10, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_a0066 = _TMP8.xyz - _TMP4.xyz;
_TMP11 = abs(_a0066);
_TMP12 = dot(_TMP11, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_w1 = _TMP12*_md2;
_a0070 = _TMP2.xyz - _TMP4.xyz;
_TMP13 = abs(_a0070);
_TMP14 = dot(_TMP13, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_w2 = _TMP14*_md1;
_a0074 = _TMP0.xyz - _TMP4.xyz;
_TMP15 = abs(_a0074);
_TMP16 = dot(_TMP15, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_w3 = _TMP16*_md2;
_a0078 = _TMP6.xyz - _TMP4.xyz;
_TMP17 = abs(_a0078);
_TMP18 = dot(_TMP17, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_w4 = _TMP18*_md1;
_t1 = _w1 + _w3;
_t2 = _w2 + _w4;
_TMP19 = max(_t1, _t2);
_ww = _TMP19 + 9.99999975E-005;
_c11 = (_w1*_TMP0.xyz + _w2*_TMP6.xyz + _w3*_TMP8.xyz + _w4*_TMP2.xyz + _ww*_TMP4.xyz)/(_t1 + _t2 + _ww);
_a0084 = _TMP3.xyz + _TMP5.xyz + _c11;
_TMP20 = dot(_a0084, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_lc1 = -2.50000000E-001/(1.19999997E-001*_TMP20 + 2.50000000E-001);
_a0086 = _TMP1.xyz + _TMP7.xyz + _c11;
_TMP21 = dot(_a0086, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_lc2 = -2.50000000E-001/(1.19999997E-001*_TMP21 + 2.50000000E-001);
_a0088 = _c11 - _TMP3.xyz;
_TMP22 = abs(_a0088);
_TMP23 = dot(_TMP22, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_x0092 = _lc1*_TMP23 + 3.24999988E-001;
_TMP30 = min(2.50000000E-001, _x0092);
_TMP91 = max(-5.00000007E-002, _TMP30);
_a0098 = _c11 - _TMP7.xyz;
_TMP24 = abs(_a0098);
_TMP25 = dot(_TMP24, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_x0102 = _lc2*_TMP25 + 3.24999988E-001;
_TMP30 = min(2.50000000E-001, _x0102);
_TMP101 = max(-5.00000007E-002, _TMP30);
_a0108 = _c11 - _TMP5.xyz;
_TMP26 = abs(_a0108);
_TMP27 = dot(_TMP26, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_x0112 = _lc1*_TMP27 + 3.24999988E-001;
_TMP30 = min(2.50000000E-001, _x0112);
_TMP111 = max(-5.00000007E-002, _TMP30);
_a0118 = _c11 - _TMP1.xyz;
_TMP28 = abs(_a0118);
_TMP29 = dot(_TMP28, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_x0122 = _lc2*_TMP29 + 3.24999988E-001;
_TMP30 = min(2.50000000E-001, _x0122);
_TMP121 = max(-5.00000007E-002, _TMP30);
_TMP38 = _TMP91*_TMP3.xyz + _TMP101*_TMP7.xyz + _TMP111*_TMP5.xyz + _TMP121*_TMP1.xyz + ((((1.00000000E+000 - _TMP91) - _TMP101) - _TMP111) - _TMP121)*_c11;
_ret_0 = vec4(_TMP38.x, _TMP38.y, _TMP38.z, 1.00000000E+000);
gl_FragColor = _ret_0;
return;
}
#endif