Add mpv config
This commit is contained in:
parent
5e0be74606
commit
709a064053
106 changed files with 42838 additions and 0 deletions
287
mpv/shaders-old/Anime4K_Deblur_Original.glsl
Executable file
287
mpv/shaders-old/Anime4K_Deblur_Original.glsl
Executable file
|
@ -0,0 +1,287 @@
|
|||
// MIT License
|
||||
|
||||
// Copyright (c) 2019-2021 bloc97
|
||||
// All rights reserved.
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
//!DESC Anime4K-v3.2-Deblur-Original-Luma
|
||||
//!HOOK MAIN
|
||||
//!BIND HOOKED
|
||||
//!SAVE LINELUMA
|
||||
//!COMPONENTS 1
|
||||
|
||||
float get_luma(vec4 rgba) {
|
||||
return dot(vec4(0.299, 0.587, 0.114, 0.0), rgba);
|
||||
}
|
||||
|
||||
vec4 hook() {
|
||||
return vec4(get_luma(HOOKED_tex(HOOKED_pos)), 0.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
//!DESC Anime4K-v3.2-Deblur-Original-Kernel-X
|
||||
//!HOOK MAIN
|
||||
//!BIND HOOKED
|
||||
//!BIND LINELUMA
|
||||
//!SAVE LUMAD
|
||||
//!WIDTH MAIN.w 2 *
|
||||
//!HEIGHT MAIN.h 2 *
|
||||
//!COMPONENTS 2
|
||||
|
||||
vec4 hook() {
|
||||
vec2 d = HOOKED_pt;
|
||||
|
||||
//[tl t tr]
|
||||
//[ l c r]
|
||||
//[bl b br]
|
||||
float l = LINELUMA_tex(HOOKED_pos + vec2(-d.x, 0.0)).x;
|
||||
float c = LINELUMA_tex(HOOKED_pos).x;
|
||||
float r = LINELUMA_tex(HOOKED_pos + vec2(d.x, 0.0)).x;
|
||||
|
||||
|
||||
//Horizontal Gradient
|
||||
//[-1 0 1]
|
||||
//[-2 0 2]
|
||||
//[-1 0 1]
|
||||
float xgrad = (-l + r);
|
||||
|
||||
//Vertical Gradient
|
||||
//[-1 -2 -1]
|
||||
//[ 0 0 0]
|
||||
//[ 1 2 1]
|
||||
float ygrad = (l + c + c + r);
|
||||
|
||||
//Computes the luminance's gradient
|
||||
return vec4(xgrad, ygrad, 0.0, 0.0);
|
||||
}
|
||||
|
||||
|
||||
//!DESC Anime4K-v3.2-Deblur-Original-Kernel-Y
|
||||
//!HOOK MAIN
|
||||
//!BIND HOOKED
|
||||
//!BIND LUMAD
|
||||
//!SAVE LUMAD
|
||||
//!WIDTH MAIN.w 2 *
|
||||
//!HEIGHT MAIN.h 2 *
|
||||
//!COMPONENTS 2
|
||||
|
||||
|
||||
/* --------------------- SETTINGS --------------------- */
|
||||
|
||||
//Strength of edge refinement, good values are between 0.2 and 4
|
||||
#define REFINE_STRENGTH 1.0
|
||||
|
||||
|
||||
/* --- MODIFY THESE SETTINGS BELOW AT YOUR OWN RISK --- */
|
||||
|
||||
//Bias of the refinement function, good values are between 0 and 1
|
||||
#define REFINE_BIAS 0.0
|
||||
|
||||
//Polynomial fit obtained by minimizing MSE error on image
|
||||
#define P5 ( 11.68129591)
|
||||
#define P4 (-42.46906057)
|
||||
#define P3 ( 60.28286266)
|
||||
#define P2 (-41.84451327)
|
||||
#define P1 ( 14.05517353)
|
||||
#define P0 (-1.081521930)
|
||||
|
||||
/* ----------------- END OF SETTINGS ----------------- */
|
||||
|
||||
float power_function(float x) {
|
||||
float x2 = x * x;
|
||||
float x3 = x2 * x;
|
||||
float x4 = x2 * x2;
|
||||
float x5 = x2 * x3;
|
||||
|
||||
return P5*x5 + P4*x4 + P3*x3 + P2*x2 + P1*x + P0;
|
||||
}
|
||||
|
||||
vec4 hook() {
|
||||
vec2 d = HOOKED_pt;
|
||||
|
||||
//[tl t tr]
|
||||
//[ l cc r]
|
||||
//[bl b br]
|
||||
float tx = LUMAD_tex(HOOKED_pos + vec2(0.0, -d.y)).x;
|
||||
float cx = LUMAD_tex(HOOKED_pos).x;
|
||||
float bx = LUMAD_tex(HOOKED_pos + vec2(0.0, d.y)).x;
|
||||
|
||||
|
||||
float ty = LUMAD_tex(HOOKED_pos + vec2(0.0, -d.y)).y;
|
||||
//float cy = LUMAD_tex(HOOKED_pos).y;
|
||||
float by = LUMAD_tex(HOOKED_pos + vec2(0.0, d.y)).y;
|
||||
|
||||
|
||||
//Horizontal Gradient
|
||||
//[-1 0 1]
|
||||
//[-2 0 2]
|
||||
//[-1 0 1]
|
||||
float xgrad = (tx + cx + cx + bx);
|
||||
|
||||
//Vertical Gradient
|
||||
//[-1 -2 -1]
|
||||
//[ 0 0 0]
|
||||
//[ 1 2 1]
|
||||
float ygrad = (-ty + by);
|
||||
|
||||
//Computes the luminance's gradient
|
||||
float sobel_norm = clamp(sqrt(xgrad * xgrad + ygrad * ygrad), 0.0, 1.0);
|
||||
|
||||
float dval = clamp(power_function(clamp(sobel_norm, 0.0, 1.0)) * REFINE_STRENGTH + REFINE_BIAS, 0.0, 1.0);
|
||||
|
||||
return vec4(sobel_norm, dval, 0.0, 0.0);
|
||||
}
|
||||
|
||||
//!DESC Anime4K-v3.2-Deblur-Original-Kernel-X
|
||||
//!HOOK MAIN
|
||||
//!BIND HOOKED
|
||||
//!BIND LUMAD
|
||||
//!SAVE LUMAMM
|
||||
//!WIDTH MAIN.w 2 *
|
||||
//!HEIGHT MAIN.h 2 *
|
||||
//!COMPONENTS 2
|
||||
|
||||
|
||||
vec4 hook() {
|
||||
vec2 d = HOOKED_pt;
|
||||
|
||||
if (LUMAD_tex(HOOKED_pos).y < 0.1) {
|
||||
return vec4(0.0);
|
||||
}
|
||||
|
||||
//[tl t tr]
|
||||
//[ l c r]
|
||||
//[bl b br]
|
||||
float l = LUMAD_tex(HOOKED_pos + vec2(-d.x, 0.0)).x;
|
||||
float c = LUMAD_tex(HOOKED_pos).x;
|
||||
float r = LUMAD_tex(HOOKED_pos + vec2(d.x, 0.0)).x;
|
||||
|
||||
//Horizontal Gradient
|
||||
//[-1 0 1]
|
||||
//[-2 0 2]
|
||||
//[-1 0 1]
|
||||
float xgrad = (-l + r);
|
||||
|
||||
//Vertical Gradient
|
||||
//[-1 -2 -1]
|
||||
//[ 0 0 0]
|
||||
//[ 1 2 1]
|
||||
float ygrad = (l + c + c + r);
|
||||
|
||||
|
||||
return vec4(xgrad, ygrad, 0.0, 0.0);
|
||||
}
|
||||
|
||||
|
||||
//!DESC Anime4K-v3.2-Deblur-Original-Kernel-Y
|
||||
//!HOOK MAIN
|
||||
//!BIND HOOKED
|
||||
//!BIND LUMAD
|
||||
//!BIND LUMAMM
|
||||
//!SAVE LUMAMM
|
||||
//!WIDTH MAIN.w 2 *
|
||||
//!HEIGHT MAIN.h 2 *
|
||||
//!COMPONENTS 2
|
||||
|
||||
vec4 hook() {
|
||||
vec2 d = HOOKED_pt;
|
||||
|
||||
if (LUMAD_tex(HOOKED_pos).y < 0.1) {
|
||||
return vec4(0.0);
|
||||
}
|
||||
|
||||
//[tl t tr]
|
||||
//[ l cc r]
|
||||
//[bl b br]
|
||||
float tx = LUMAMM_tex(HOOKED_pos + vec2(0.0, -d.y)).x;
|
||||
float cx = LUMAMM_tex(HOOKED_pos).x;
|
||||
float bx = LUMAMM_tex(HOOKED_pos + vec2(0.0, d.y)).x;
|
||||
|
||||
float ty = LUMAMM_tex(HOOKED_pos + vec2(0.0, -d.y)).y;
|
||||
//float cy = LUMAMM_tex(HOOKED_pos).y;
|
||||
float by = LUMAMM_tex(HOOKED_pos + vec2(0.0, d.y)).y;
|
||||
|
||||
//Horizontal Gradient
|
||||
//[-1 0 1]
|
||||
//[-2 0 2]
|
||||
//[-1 0 1]
|
||||
float xgrad = (tx + cx + cx + bx);
|
||||
|
||||
//Vertical Gradient
|
||||
//[-1 -2 -1]
|
||||
//[ 0 0 0]
|
||||
//[ 1 2 1]
|
||||
float ygrad = (-ty + by);
|
||||
|
||||
float norm = sqrt(xgrad * xgrad + ygrad * ygrad);
|
||||
if (norm <= 0.001) {
|
||||
xgrad = 0.0;
|
||||
ygrad = 0.0;
|
||||
norm = 1.0;
|
||||
}
|
||||
|
||||
return vec4(xgrad/norm, ygrad/norm, 0.0, 0.0);
|
||||
}
|
||||
|
||||
|
||||
//!DESC Anime4K-v3.2-Deblur-Original-Apply
|
||||
//!HOOK MAIN
|
||||
//!BIND HOOKED
|
||||
//!BIND LUMAD
|
||||
//!BIND LUMAMM
|
||||
//!WIDTH MAIN.w 2 *
|
||||
//!HEIGHT MAIN.h 2 *
|
||||
//!SAVE RESAMPLED
|
||||
|
||||
|
||||
vec4 hook() {
|
||||
vec2 d = HOOKED_pt;
|
||||
|
||||
float dval = LUMAD_tex(HOOKED_pos).y;
|
||||
if (dval < 0.1) {
|
||||
return HOOKED_tex(HOOKED_pos);
|
||||
}
|
||||
|
||||
vec4 dc = LUMAMM_tex(HOOKED_pos);
|
||||
if (abs(dc.x + dc.y) <= 0.0001) {
|
||||
return HOOKED_tex(HOOKED_pos);
|
||||
}
|
||||
|
||||
float xpos = -sign(dc.x);
|
||||
float ypos = -sign(dc.y);
|
||||
|
||||
vec4 xval = HOOKED_tex(HOOKED_pos + vec2(d.x * xpos, 0.0));
|
||||
vec4 yval = HOOKED_tex(HOOKED_pos + vec2(0.0, d.y * ypos));
|
||||
|
||||
float xyratio = abs(dc.x) / (abs(dc.x) + abs(dc.y));
|
||||
|
||||
vec4 avg = xyratio * xval + (1.0 - xyratio) * yval;
|
||||
|
||||
return avg * dval + HOOKED_tex(HOOKED_pos) * (1.0 - dval);
|
||||
|
||||
}
|
||||
|
||||
//!DESC Anime4K-v3.2-Deblur-Original-Resample
|
||||
//!HOOK MAIN
|
||||
//!BIND HOOKED
|
||||
//!BIND RESAMPLED
|
||||
|
||||
vec4 hook() {
|
||||
return RESAMPLED_tex(HOOKED_pos);
|
||||
}
|
429
mpv/shaders-old/Anime4K_Restore_CNN_L.glsl
Executable file
429
mpv/shaders-old/Anime4K_Restore_CNN_L.glsl
Executable file
|
@ -0,0 +1,429 @@
|
|||
// MIT License
|
||||
|
||||
// Copyright (c) 2019-2021 bloc97
|
||||
// All rights reserved.
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
//!DESC Anime4K-v4.0-Restore-CNN-(L)-Conv-4x3x3x3
|
||||
//!HOOK MAIN
|
||||
//!BIND MAIN
|
||||
//!SAVE conv2d_tf
|
||||
//!WIDTH MAIN.w
|
||||
//!HEIGHT MAIN.h
|
||||
//!COMPONENTS 4
|
||||
#define go_0(x_off, y_off) (MAIN_texOff(vec2(x_off, y_off)))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.27899465, -0.14974926, 0.6271667, -0.04888494, 0.2164516, -0.47826648, 0.09537477, 0.16404815, -0.009546488, -0.24541017, -0.20505093, -0.11507772, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, -1.0);
|
||||
result += mat4(-0.22372562, 0.046120282, 0.44437107, 0.54215515, -0.10638798, -0.010795577, 0.19478157, 0.5756847, 0.24542068, 0.11135218, -0.27672207, 0.09624475, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, 0.0);
|
||||
result += mat4(0.1703517, -0.17810228, -0.34460765, -0.40586865, 0.2102622, 0.08207581, 0.17641851, 0.23701222, -0.32159516, -0.017147528, 0.41743183, 0.19025058, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, 1.0);
|
||||
result += mat4(0.4708481, -0.1587934, -0.15760423, -0.11388875, -0.36032093, -0.044305246, 0.19414884, 0.31109568, -0.09320259, -0.23072109, 0.0242641, 0.040976923, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, -1.0);
|
||||
result += mat4(0.00951417, 0.2746557, -0.49743456, 0.14564055, 0.15047263, 0.08832856, -0.24360974, -0.3517844, -0.12219134, 0.12957081, 0.2876983, 0.13303527, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, 0.0);
|
||||
result += mat4(-0.12760738, 0.16703783, 0.04391735, 0.34657615, -0.26698044, -0.096000046, -0.46030682, -0.38363042, 0.3510441, 0.2620507, -0.30533043, -0.32785, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, 1.0);
|
||||
result += mat4(0.63138646, -0.12703805, 0.38107973, -0.09134196, -0.04012397, -0.1390924, 0.07578805, -0.09274019, -0.045394078, 0.18203364, 0.16900069, 0.13399005, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, -1.0);
|
||||
result += mat4(-0.13648264, -0.13971807, -0.32322997, -0.08377875, 0.40967095, 0.19853555, -0.26386982, -0.50860924, -0.00555831, 0.06922444, 0.034828495, -0.08413197, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, 0.0);
|
||||
result += mat4(0.21196735, 0.24934316, -0.27111465, -0.19941513, -0.30186844, 0.44828892, 0.35906994, -0.35723612, -0.074009515, -0.34400147, -0.22145566, -0.15622428, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, 1.0);
|
||||
result += vec4(-0.44569078, -0.084358215, -0.014156722, -0.0353374);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v4.0-Restore-CNN-(L)-Conv-4x3x3x3
|
||||
//!HOOK MAIN
|
||||
//!BIND MAIN
|
||||
//!SAVE conv2d_tf1
|
||||
//!WIDTH MAIN.w
|
||||
//!HEIGHT MAIN.h
|
||||
//!COMPONENTS 4
|
||||
#define go_0(x_off, y_off) (MAIN_texOff(vec2(x_off, y_off)))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(0.1953752, -0.09707663, 0.43315637, 0.3862221, 0.2346731, 0.085327715, 0.36244828, 0.06630519, -0.05342483, 0.112148136, 0.07938104, 0.14795923, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, -1.0);
|
||||
result += mat4(0.25197014, 0.032906674, 0.3392793, 0.18099307, -0.36539522, 0.10986396, 0.5440999, 0.41803896, -0.4117931, 0.46616048, 0.0827279, 0.040264074, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, 0.0);
|
||||
result += mat4(-0.060543116, 0.34531194, -0.3202978, 0.32803985, -0.08720925, 0.63656414, -0.052656054, -0.076137036, 0.15297869, -0.11485237, -0.21027736, -0.24086118, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, 1.0);
|
||||
result += mat4(-0.2044052, 0.111065395, -0.36082193, -0.39179638, 0.19812255, -0.3797384, 0.03176089, -0.35085422, 0.31697252, -0.31267545, -0.068170965, -0.06266394, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, -1.0);
|
||||
result += mat4(0.0055682547, 0.24352197, 0.08972456, -0.4340704, -0.25253078, -0.4218859, 0.08408476, -0.5052765, 0.005511427, -0.36491954, 0.3825727, 0.01774532, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, 0.0);
|
||||
result += mat4(0.13323675, -0.6641518, -0.38277033, 0.67553586, -0.5879293, -0.1286407, 0.1355451, 0.19463064, -0.09206729, 0.41892347, 0.16736335, -0.017109495, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, 1.0);
|
||||
result += mat4(0.0627963, 0.29361042, 0.23339616, -0.42217752, 0.21872504, -0.21531922, -0.5016595, 0.20158494, 0.2814043, -0.1474019, 0.08778552, 0.28085083, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, -1.0);
|
||||
result += mat4(-0.009900911, -0.42754972, 0.02737237, -0.17740859, 0.541632, -0.28397697, -0.36375052, -0.172693, 0.1506882, 0.15196925, -0.30358136, -0.29542333, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, 0.0);
|
||||
result += mat4(-0.3690586, 0.19382606, -0.040331036, -0.14121497, 0.121049926, 0.54470515, -0.23628974, 0.20663929, -0.34591553, -0.14778244, -0.23809184, 0.12616424, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, 1.0);
|
||||
result += vec4(-0.009787335, 0.051148742, -0.007458707, -0.016416457);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v4.0-Restore-CNN-(L)-Conv-4x3x3x16
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_tf
|
||||
//!BIND conv2d_tf1
|
||||
//!SAVE conv2d_1_tf
|
||||
//!WIDTH conv2d_tf.w
|
||||
//!HEIGHT conv2d_tf.h
|
||||
//!COMPONENTS 4
|
||||
#define go_0(x_off, y_off) (max((conv2d_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max((conv2d_tf1_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_2(x_off, y_off) (max(-(conv2d_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_3(x_off, y_off) (max(-(conv2d_tf1_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(0.028458824, 0.10831271, 0.017246738, 0.42066097, 0.035127334, 0.14161696, 0.3893337, 0.18358134, -0.26446894, -0.053199783, 0.053528484, -0.3486933, -0.10270838, -0.3593573, 0.049874853, 0.08600247) * go_0(-1.0, -1.0);
|
||||
result += mat4(-0.15829772, -0.31038332, 0.0423391, -0.11978196, -0.29878524, 0.10245719, 0.004307728, 0.052934717, -0.049366333, -0.03277819, -0.062031534, -0.004734159, 0.029009456, -0.18138678, 0.17342477, -0.1632741) * go_0(-1.0, 0.0);
|
||||
result += mat4(-0.14941882, -0.3337916, -0.07740701, -0.8221198, -0.014216013, -0.34028724, 0.06367363, -0.19704603, -0.20317195, 0.17806017, -0.14011545, 0.05067841, 0.08515265, 0.092163175, -0.036603887, -0.2528259) * go_0(-1.0, 1.0);
|
||||
result += mat4(0.044333473, 0.10871938, -0.12288588, 0.0077913217, 0.013970764, -0.21189599, -0.0757029, 0.055366833, 0.04531751, -0.20269018, 0.038650505, -0.09677452, 0.0565207, 0.073703125, -0.10746413, 0.22798601) * go_0(0.0, -1.0);
|
||||
result += mat4(0.33476707, 0.22631067, 0.10190012, 0.25268495, -0.14572862, -0.21331434, 0.024614803, -0.26254398, 0.18070522, 0.34974626, 0.028480766, -0.07855834, 0.16165797, 0.28470036, 0.23497322, -0.15804033) * go_0(0.0, 0.0);
|
||||
result += mat4(-0.09853942, -0.21105993, 0.27787793, 0.24688315, -0.16078049, 0.08541815, 0.16101131, -0.0005086922, -0.13042259, 0.0253011, -0.05298311, 0.16506846, -0.099300735, 0.07577514, 0.041623414, -0.18045023) * go_0(0.0, 1.0);
|
||||
result += mat4(-0.015007392, 0.0720429, -0.018456718, 0.012792885, 0.2049891, -0.061911974, -0.10679284, 0.2530616, -0.1651912, 0.1125125, 0.55918777, 0.1414716, 0.025189033, 0.061680123, -0.13096866, -0.035809774) * go_0(1.0, -1.0);
|
||||
result += mat4(0.037606955, 0.05987735, -0.09903669, 0.09681222, 0.31857902, -0.058445334, 0.10280441, -0.0018247474, 0.051491242, 0.12321206, 0.14069863, -0.013259678, -0.198442, 0.093920216, -0.015952505, -0.3040559) * go_0(1.0, 0.0);
|
||||
result += mat4(0.044491854, 0.079992026, -0.07424999, 0.064774506, 0.36708844, -0.14958903, -0.060033463, -0.5950615, -0.101501055, -0.05275797, -0.0099711865, 0.075409986, -0.19508216, -0.088995665, -0.025926083, 0.023040347) * go_0(1.0, 1.0);
|
||||
result += mat4(-0.00168658, 0.1879708, -0.08964568, 0.124567054, -0.027147152, 0.0013266837, 0.043110568, -0.16238526, 0.18404783, -0.088930264, -0.0841814, -0.06812457, -0.022954177, 0.15315148, 0.00096489635, 0.21262483) * go_1(-1.0, -1.0);
|
||||
result += mat4(0.03728663, 0.16259944, 0.2534931, -0.10620075, -0.032217886, -0.043085426, -0.37875995, 0.16151664, -0.15136409, -0.21990341, 0.0043716, 0.1293011, 0.20516208, 0.32518774, -0.15583529, 0.20054214) * go_1(-1.0, 0.0);
|
||||
result += mat4(0.05088376, -0.21300486, 0.30702966, 0.09044539, 0.020740725, 0.028916309, 0.14391874, 0.15526149, 0.011289051, -0.24014536, -0.2176207, 0.09995701, 0.06747376, -0.3315815, 0.07900332, -0.26542482) * go_1(-1.0, 1.0);
|
||||
result += mat4(0.15973654, 0.2114867, -0.19423203, -0.1529657, -0.24198112, -0.10985252, 0.056409992, 0.111373484, 0.05717073, 0.019566689, -0.12794583, 0.006978016, -0.2708247, 0.2845983, -0.048893075, -0.09198705) * go_1(0.0, -1.0);
|
||||
result += mat4(0.07690064, 0.038431194, 0.1205243, 0.1320201, -0.122893825, -0.022761922, -0.10097431, 0.022808496, -0.0431315, 0.19884229, -0.053464055, -0.08487898, 0.049651224, 0.3001686, -0.05545239, 0.48026356) * go_1(0.0, 0.0);
|
||||
result += mat4(0.04079296, 0.052179057, 0.08785134, 0.17674746, 0.06027275, -0.083381295, -0.29543424, -0.10703248, 0.14123397, 0.12711276, 0.08260646, 0.23608543, 0.10914477, -0.22596069, -0.15743312, 0.103631504) * go_1(0.0, 1.0);
|
||||
result += mat4(0.038997833, -0.14136268, -0.31973416, 0.11666723, -0.20137171, 0.0115205245, 0.22825807, -0.14853193, 0.25628343, 0.06598252, -0.003479285, -0.12315031, -0.07446986, 0.29977, 0.08878428, 0.15130284) * go_1(1.0, -1.0);
|
||||
result += mat4(-0.04147214, -0.050535224, -0.21205503, -0.07425368, -0.06448227, -0.086743675, 0.029389668, -0.07494379, -0.17228132, -0.18035689, -0.09757749, 0.13929781, 0.21867155, 0.02585289, 0.13752261, 0.17800835) * go_1(1.0, 0.0);
|
||||
result += mat4(0.20552272, -0.03113836, -0.201244, -0.07602455, 0.08278268, -0.17029381, -0.0008433311, -0.11591232, 0.087584734, -0.026447749, 0.09185437, 0.15650395, 0.29423076, 0.016036067, -0.17132477, 0.09271113) * go_1(1.0, 1.0);
|
||||
result += mat4(0.09120441, 0.1345777, 0.0468555, 0.2635145, 0.04248785, -0.14849417, -0.013588658, -0.12794739, -0.0109574385, -0.15350367, 0.1872175, -0.17311442, 0.2740676, 0.1931403, 0.049231507, -0.17728893) * go_2(-1.0, -1.0);
|
||||
result += mat4(0.0265621, 0.10291274, -0.0884961, -0.086093664, 0.25218308, -0.027579704, 0.044006765, -0.05947863, -0.17352693, -0.16788955, -0.1829588, -0.19120377, -0.19486824, 0.035516337, -0.04287895, -0.059360266) * go_2(-1.0, 0.0);
|
||||
result += mat4(-0.0077623413, 0.061803013, -0.14371866, -0.2929254, -0.014011599, 0.23037176, 0.09881457, -0.018942501, 0.14976685, -0.0017081804, -0.0420665, 0.075949386, -0.015102705, -0.07807527, 0.053166322, 0.21431307) * go_2(-1.0, 1.0);
|
||||
result += mat4(0.15482867, -0.13303289, 0.05441111, 0.20482185, -0.08669985, -0.26125848, 0.085498355, 0.06895137, -0.11653363, -0.022335036, -0.019448604, -0.19071092, 0.002487127, -0.053429328, 0.07700748, -0.15176988) * go_2(0.0, -1.0);
|
||||
result += mat4(0.058373976, -0.18893883, 0.063239604, -0.16802256, 0.1348292, -0.037208326, 0.121938735, 0.123416096, -0.14086236, -0.08550504, 0.18930112, -0.07056712, -0.2190568, -0.01693728, -0.110385895, -0.10306489) * go_2(0.0, 0.0);
|
||||
result += mat4(-0.21300407, -0.049379632, 0.13865358, 0.0037872058, 0.008286501, -0.12187443, -0.11094277, 0.021951213, -0.10365199, 0.15844372, 0.068476856, -0.09683496, -0.039589003, -0.027428184, 0.022865763, 0.067510754) * go_2(0.0, 1.0);
|
||||
result += mat4(0.05690448, -0.09136643, -0.17356895, -0.18716863, 0.07831065, 0.015976364, -0.06423979, -0.01891357, 0.16295952, 0.17686251, -0.26599383, -0.11806091, -0.0968358, 0.024937721, -0.10509048, -0.097365916) * go_2(1.0, -1.0);
|
||||
result += mat4(-0.06446155, 0.05177888, -0.019579697, 0.046922565, 0.20326103, -0.04118929, 0.07845964, 0.15494241, -0.033653136, 0.13276093, -0.061998203, -0.049391422, 0.0154429395, -0.12517625, -0.022282483, 0.14295246) * go_2(1.0, 0.0);
|
||||
result += mat4(-0.102786146, 0.028481564, 0.12239765, 0.010855834, 0.17208168, -0.24589455, -0.045410756, 0.17422688, -0.051487174, 0.14276022, 0.26189017, -0.0027747392, 0.15695319, 0.13917996, 0.07303566, -0.055219136) * go_2(1.0, 1.0);
|
||||
result += mat4(0.014127897, -0.13218386, -0.4342469, -0.10977742, 0.12229517, -0.32898104, -0.21103851, 0.06275854, -0.22651868, 0.111792624, 0.020457482, -0.048701756, 0.124154285, 0.016944582, -0.14404331, 0.054385293) * go_3(-1.0, -1.0);
|
||||
result += mat4(0.09574338, 0.04884873, -0.12329247, 0.3191857, -0.28155354, 0.03411368, -0.017508674, -0.28257895, 0.06535372, 0.40051946, -0.24508828, 0.05891001, 0.08769791, -0.011710461, 0.10430247, 0.096506774) * go_3(-1.0, 0.0);
|
||||
result += mat4(0.036757194, 0.1374388, -0.14553823, 0.11012423, 0.19377777, -0.053538468, -0.32605696, 0.07757925, 0.054016564, 0.2677718, 0.26038665, 0.029049544, 0.015482294, -0.08899067, 0.26156536, 0.26035222) * go_3(-1.0, 1.0);
|
||||
result += mat4(-0.19651565, 0.30669728, -0.03192298, 0.090777226, 0.34684682, -0.040679373, -0.0006501724, -0.069249466, 0.07256215, -0.018623354, -0.021843085, 0.026858928, 0.24001615, -0.007573629, -0.25308976, -0.08101683) * go_3(0.0, -1.0);
|
||||
result += mat4(-0.19491735, 0.29386947, -0.16541481, -0.12270087, 0.1478019, 0.11557711, 0.09745131, -0.037188005, 0.051415507, -0.009313462, 0.17577961, 0.30678266, 0.052763764, 0.06731275, 0.038889345, 0.01219997) * go_3(0.0, 0.0);
|
||||
result += mat4(0.21972072, -0.16669928, -0.0471254, 0.07962133, -0.24501611, 0.10681031, -0.10724696, 0.046246808, -0.13467999, 0.019233517, -0.2220906, 0.11756837, 0.07995422, -0.091647364, 0.0524831, 0.2427797) * go_3(0.0, 1.0);
|
||||
result += mat4(-0.018560572, 0.28909272, 0.27052113, -0.16862495, -0.04259962, -0.2526796, 0.24546415, 0.13772464, 0.019554865, 0.052288387, 0.22942105, 0.14541095, 0.29822263, -0.10352501, -0.17112546, -0.22842947) * go_3(1.0, -1.0);
|
||||
result += mat4(-0.052647978, 0.17638408, 0.2265538, -0.028214354, -0.13620298, 0.14337336, 0.057785455, 0.14105307, 0.03873432, 0.13013794, 0.24192083, -0.104368195, -0.18878175, 0.11648163, 0.0049888026, -0.17706485) * go_3(1.0, 0.0);
|
||||
result += mat4(0.003658791, 0.057943232, -0.013143919, 0.08626453, -0.26248586, 0.29328227, 0.18253878, 0.05693778, -0.082900435, -0.034102313, -0.05913703, -0.11045182, -0.06499875, 0.15446658, -0.08087537, 0.18904833) * go_3(1.0, 1.0);
|
||||
result += vec4(-0.02852779, 0.027645616, 0.06510905, 0.029781172);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v4.0-Restore-CNN-(L)-Conv-4x3x3x16
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_tf
|
||||
//!BIND conv2d_tf1
|
||||
//!SAVE conv2d_1_tf1
|
||||
//!WIDTH conv2d_tf.w
|
||||
//!HEIGHT conv2d_tf.h
|
||||
//!COMPONENTS 4
|
||||
#define go_0(x_off, y_off) (max((conv2d_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max((conv2d_tf1_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_2(x_off, y_off) (max(-(conv2d_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_3(x_off, y_off) (max(-(conv2d_tf1_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(0.06138475, 0.120526604, 0.22381006, 0.12570442, 0.1439015, -0.5261169, 0.25294203, 0.04825834, 0.06993285, 0.1210301, -0.10087704, 0.038996983, 0.095201865, 0.50708395, 0.17403544, -0.17137507) * go_0(-1.0, -1.0);
|
||||
result += mat4(0.09580414, -0.17387998, 0.10757996, 0.15188572, -0.02090535, 0.2655171, -0.38653868, -0.014376933, -0.03217946, -0.12866813, -0.049665075, -0.048535764, -0.115907624, 0.032473654, 0.36145476, 0.3830508) * go_0(-1.0, 0.0);
|
||||
result += mat4(-0.19303346, -0.30462784, -0.21706793, -0.0123182135, -0.063043006, -0.10658377, 0.08729471, -0.27184415, 0.037174225, 0.13507952, -0.06391928, -0.035610817, 0.17105488, 0.07546837, 0.36270198, 0.13315013) * go_0(-1.0, 1.0);
|
||||
result += mat4(-0.1559421, 0.03859168, 0.058586795, 0.1457787, -0.008261901, 0.17584307, 0.07892688, 0.16024348, 0.20574443, -0.09199424, -0.2572033, -0.06435325, -0.045140598, 0.026080446, 0.30986732, -0.02853244) * go_0(0.0, -1.0);
|
||||
result += mat4(0.06647865, -0.13637248, -0.2077229, -0.18015774, 0.22215, 0.0282581, -0.124256276, -0.18235172, -0.10444975, 0.039713558, 0.031975772, -0.14737205, 0.1533982, 0.115156986, 0.14176169, -0.12018837) * go_0(0.0, 0.0);
|
||||
result += mat4(-0.24000446, 0.08672003, -0.209317, 0.1853504, 0.19062491, -0.04505737, -0.097432695, -0.12218054, -0.20497306, 0.0068228757, -0.07930878, -0.045916412, -0.09002585, -0.019980771, -0.13450326, 0.08838858) * go_0(0.0, 1.0);
|
||||
result += mat4(-0.005804602, 0.05149589, 0.18930501, -0.07475797, -0.3263357, -0.048428953, -0.0062948675, -0.12957661, 0.034840938, -0.12834811, -0.19660017, 0.13469964, -0.049774483, -0.07062978, 0.18116258, -0.2945365) * go_0(1.0, -1.0);
|
||||
result += mat4(0.021823233, 0.17687339, 0.035116684, -0.14888434, 0.101564035, -0.058118407, 0.035971403, 0.304605, -0.08054271, 0.07140431, -0.24807848, -0.014870848, 0.005698307, 0.0925754, -0.16337888, -0.072692335) * go_0(1.0, 0.0);
|
||||
result += mat4(0.15357393, 0.05702486, 0.1838928, -0.052683312, 0.26516896, 0.08939279, 0.040435348, 0.035939544, 0.21697883, -0.011976994, -0.10517768, 0.1004424, -0.073649734, -0.063365534, 0.07981437, -0.13724971) * go_0(1.0, 1.0);
|
||||
result += mat4(0.06887319, -0.031427335, -0.05686962, 0.031254467, -0.0530729, -0.27738956, -0.22601964, -0.16733547, -0.15481988, -0.22141118, -0.19417213, 0.052291542, 0.0665599, 0.13679637, -0.09932399, -0.021917146) * go_1(-1.0, -1.0);
|
||||
result += mat4(0.0043880343, -0.03320605, -0.09556491, 0.064986005, -0.05736109, -0.015415265, -0.12861155, 0.07442758, 0.09653438, -0.30665413, 0.12456121, -0.015494559, -0.04347404, -0.26863584, -0.12057121, -0.12873033) * go_1(-1.0, 0.0);
|
||||
result += mat4(0.43038133, 0.117590204, -0.012805269, 0.06656798, -0.08742217, -0.077595286, 0.01795713, -0.010100221, -0.17349729, -0.02995379, 0.01733494, 0.012438303, -0.062275372, 0.18847479, -0.014758355, -0.13591917) * go_1(-1.0, 1.0);
|
||||
result += mat4(-0.20219825, 0.33157164, -0.036087956, 0.078742586, 0.10264473, 0.13553555, 0.057454523, 0.09034125, 0.04169048, 0.031988595, -0.20171835, -0.018051006, 0.09925883, -0.15372548, -0.14060175, -0.012530946) * go_1(0.0, -1.0);
|
||||
result += mat4(-0.20762882, -0.23219623, 0.044476848, -0.080212615, 0.027042268, 0.068265386, -0.053666174, 0.051648133, 0.012678151, -0.09496996, -0.073195405, 0.23230731, 0.026435647, 0.040384647, -0.15589063, -0.17085052) * go_1(0.0, 0.0);
|
||||
result += mat4(0.06897319, -0.06360793, -0.12517554, -0.106191345, -0.22830063, -0.12295911, 0.20943281, 0.11263121, -0.05995797, -0.04077969, 0.029862454, 0.12051529, -0.008890125, 0.005834341, -0.038162317, 0.05707114) * go_1(0.0, 1.0);
|
||||
result += mat4(0.091504954, -0.054357428, 0.18441072, 0.16866787, 0.14714013, 0.14976494, 0.119183995, 0.11771104, -0.17375562, 0.024148121, 0.08745399, 0.175893, 0.12345911, 0.120711684, -0.23350039, -0.035989728) * go_1(1.0, -1.0);
|
||||
result += mat4(-0.30777606, 0.028484846, 0.19993277, -0.12934783, 0.049725976, 0.02831735, 0.09492996, 0.28220424, 0.26913685, 0.005740985, 0.025957806, 0.047272105, 0.014296343, 0.15206927, 0.035486884, 0.09940966) * go_1(1.0, 0.0);
|
||||
result += mat4(-0.11630714, -0.034275923, 0.26804927, 0.1088897, -0.21128473, -0.043662123, 0.24287297, 0.1738188, 0.04961249, -0.03669543, -0.11308307, 0.007536927, -0.0021338738, -0.095983095, 0.12524886, 0.091356605) * go_1(1.0, 1.0);
|
||||
result += mat4(0.21231711, 0.19442785, 0.047695257, -0.058896706, -0.268304, -0.377306, 0.21314003, -0.09257493, -0.12023363, 0.20652951, -0.027571363, 0.36026677, -0.11473893, 0.22179964, -0.21924159, 0.14666505) * go_2(-1.0, -1.0);
|
||||
result += mat4(0.04660883, -0.22199874, -0.2171105, 0.32090327, -0.11054424, -0.2047386, 0.18756013, 0.08749142, -0.16950387, 0.2577728, 0.048406947, 0.1380687, 0.1014651, -0.09075356, -0.21746674, -0.2651618) * go_2(-1.0, 0.0);
|
||||
result += mat4(-0.1928378, 0.11190454, 0.32514498, 0.32336533, 0.100953236, -0.008598421, 0.02124068, 0.0043789423, -0.046625864, -0.051161833, 0.13504188, -0.049233675, -0.10984389, -0.040151004, -0.08592605, 0.13862692) * go_2(-1.0, 1.0);
|
||||
result += mat4(0.057035644, -0.086490445, 0.17654544, -0.096670695, 0.13528337, -0.10338058, -0.08174943, -0.11349738, 0.088931166, 0.19410637, 0.19873992, 0.01418258, 0.066797465, 0.09427754, -0.17926928, -0.12299086) * go_2(0.0, -1.0);
|
||||
result += mat4(-0.010706926, 0.040176257, -0.12350328, -0.11089934, 0.08166401, 0.103450865, -0.062155697, -0.10264778, 0.09370084, -0.022440543, 0.036917962, -0.20901524, -0.13244434, -0.18850644, -0.069766395, -0.042853933) * go_2(0.0, 0.0);
|
||||
result += mat4(0.0064649805, 0.09057663, 0.042877126, -0.22078879, -0.21635285, -0.0064749196, 0.04875745, -1.3261495e-05, 0.26282236, -0.057637256, -0.037890673, 0.0102023715, 0.0797657, 0.050011456, 0.07423098, -0.055722862) * go_2(0.0, 1.0);
|
||||
result += mat4(-0.21198633, -0.16919948, -0.12337323, -0.06970269, 0.12338858, -0.037561033, -0.013671757, 0.12396114, -0.046889607, -0.005447934, -0.043364853, -0.2882593, -0.069868185, -0.014526121, -0.14131337, 0.12157274) * go_2(1.0, -1.0);
|
||||
result += mat4(-0.07510719, 0.024486735, 0.056790795, 0.12515159, -0.034031168, 0.025101706, -0.05993126, -0.053233545, -0.014431461, -0.12288865, 0.11686025, -0.22278062, -0.07422713, 0.0011266146, -0.06630191, 0.077075236) * go_2(1.0, 0.0);
|
||||
result += mat4(0.15784621, -0.0009692987, 0.057809148, -0.17506301, -0.0764334, 0.036327295, -0.107915476, 0.41731307, 0.005342607, -0.17614163, 0.017190281, -0.17021762, 0.09241874, -0.02230073, 0.015017511, 0.1081785) * go_2(1.0, 1.0);
|
||||
result += mat4(-0.04213655, 0.07620985, -0.24124615, -0.0389524, -0.0071511404, 0.026105708, 0.35026863, 0.0391313, 0.17119752, -0.1083619, -0.011338781, -0.13909689, 0.019918554, -0.21432641, 0.045009304, -0.2289899) * go_3(-1.0, -1.0);
|
||||
result += mat4(-0.003247703, 0.13921799, 0.23126572, -0.11244338, -0.16778667, 0.05676625, 0.17198953, 0.2891844, -0.06569662, 0.18568343, -0.13698709, 0.014525318, 0.09470385, 0.20842068, 0.22716486, -0.044944298) * go_3(-1.0, 0.0);
|
||||
result += mat4(-0.036239535, 0.21613471, 0.0571368, 0.0133618545, -0.15562424, -0.030107146, -0.0881642, -0.3056589, 0.17654738, -0.16532254, -0.19526796, -0.09598035, 0.29869553, -0.19921502, -0.10570262, 0.12562469) * go_3(-1.0, 1.0);
|
||||
result += mat4(0.139326, -0.18395935, -0.14525263, -0.1019923, 0.019128725, 0.06724899, 0.18320693, -0.15844813, -0.063348524, 0.034003522, 0.1160608, 0.16281077, -0.20621236, 0.20389429, 0.008165468, -0.3147023) * go_3(0.0, -1.0);
|
||||
result += mat4(0.0031874597, -0.17282559, -0.19517206, -0.057723213, 0.014905972, -0.115991496, -0.17772576, 0.10005784, -0.34928575, -0.41152355, 0.15671544, 0.16953272, -0.06541263, 0.09083862, 0.12386179, -0.17146301) * go_3(0.0, 0.0);
|
||||
result += mat4(0.024222312, 0.06139789, 0.13585247, 0.048212904, -0.038439997, 0.04822463, -0.31542218, 0.12828648, -0.1334096, -0.10939595, -0.20957507, 0.14276013, 0.09314227, -0.018837357, -0.09913242, -0.0690483) * go_3(0.0, 1.0);
|
||||
result += mat4(-0.059516154, 0.03142432, -0.08262814, 0.12844399, 0.35043675, -0.17421962, 0.034954365, -0.0052628545, 0.10024693, -0.044191923, 0.18297553, -0.045441866, -0.22365399, -0.011058562, 0.1576469, -0.22479026) * go_3(1.0, -1.0);
|
||||
result += mat4(0.11010148, -0.109644935, -0.06213465, 0.06469803, -0.12474922, 0.20629437, -0.03891448, -0.032074396, -0.21814698, -0.2983182, 0.16088112, 0.02542415, -0.019019049, -0.11332389, 0.04115874, -0.15403947) * go_3(1.0, 0.0);
|
||||
result += mat4(-0.07334427, 0.065546006, -0.059299644, 0.1712592, 0.10194824, -0.0076101148, -0.26384652, -0.012047153, -0.069830835, 0.2215555, 0.41080138, 0.051534526, 0.15190491, 0.12348823, -0.16904834, -0.20517784) * go_3(1.0, 1.0);
|
||||
result += vec4(0.019262059, 0.043436494, -0.124304086, -0.014933208);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v4.0-Restore-CNN-(L)-Conv-4x3x3x16
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_1_tf
|
||||
//!BIND conv2d_1_tf1
|
||||
//!SAVE conv2d_2_tf
|
||||
//!WIDTH conv2d_1_tf.w
|
||||
//!HEIGHT conv2d_1_tf.h
|
||||
//!COMPONENTS 4
|
||||
#define go_0(x_off, y_off) (max((conv2d_1_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max((conv2d_1_tf1_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_2(x_off, y_off) (max(-(conv2d_1_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_3(x_off, y_off) (max(-(conv2d_1_tf1_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.20542079, 0.26111016, 0.0036034626, -0.16608916, 0.03036114, 0.04244865, -0.20747331, 0.06865131, -0.13495351, 0.14393657, 0.050192088, 0.13718198, -0.09928467, 0.0038359873, -0.026470508, 0.012319453) * go_0(-1.0, -1.0);
|
||||
result += mat4(0.019964145, 0.038375776, 0.003130048, -0.07945381, 0.06856654, -0.08331041, -0.049974114, -0.011174098, 0.030265702, -0.12478692, -0.009842687, 0.028310193, -0.29398966, -0.14264, -0.08436449, 0.18336426) * go_0(-1.0, 0.0);
|
||||
result += mat4(0.07453813, 0.018200234, -0.1406476, 0.027974837, -0.19164173, -0.15623717, -0.057000756, 0.029960351, 0.27373666, -0.08550347, -0.05088059, -0.10246706, 0.033324502, -0.086211175, -0.010092321, -0.11165423) * go_0(-1.0, 1.0);
|
||||
result += mat4(-0.17666292, 0.26951888, 0.24166632, -0.118283056, -0.1336137, 0.13550404, -0.19008428, 0.0041048722, 0.09373522, -0.032812368, -0.018434448, -0.008766052, 0.10959183, 0.0164411, -0.17436402, 0.11861692) * go_0(0.0, -1.0);
|
||||
result += mat4(0.059816767, 0.0632236, -0.18595679, -0.10951594, 0.11052112, -0.0630564, 0.32736167, 0.016436215, 0.036759567, -0.10445141, -0.16695334, -0.09536692, 0.34936142, -0.091659166, 0.25245044, 0.064123355) * go_0(0.0, 0.0);
|
||||
result += mat4(0.23698406, -0.030446773, 0.20418753, 0.030977655, 0.10176531, -0.091048814, 0.06913646, 0.070524976, 0.20899844, -0.026074586, 0.031215316, -0.14815283, -0.22031465, 0.09148875, -0.058892634, -0.042353395) * go_0(0.0, 1.0);
|
||||
result += mat4(-0.022295577, 0.23975989, -0.03795945, -0.13689965, -0.05808369, -0.005154714, 0.02775734, -0.06821517, 0.14538866, -0.13725305, 0.079675056, 0.015865099, -0.1457713, -0.043883465, -0.11575635, 0.092833005) * go_0(1.0, -1.0);
|
||||
result += mat4(0.008460874, 0.09447306, 0.14322506, -0.0063166656, 0.04562443, 0.12490515, 0.19263941, 0.07084753, 0.16193573, 0.03871189, 0.0042382013, -0.026311405, -0.042831287, 0.047627136, -0.18002886, 0.03910702) * go_0(1.0, 0.0);
|
||||
result += mat4(0.08485893, 0.099010445, 0.1808653, 0.098906465, -0.2406554, 0.11303921, 0.03609519, 0.102015704, 0.018253349, 0.018407846, 0.04515686, -0.1044267, 0.12692702, -0.22019249, 0.17978671, -0.11714096) * go_0(1.0, 1.0);
|
||||
result += mat4(0.37482956, 0.037982, -0.2527836, -0.07246249, -0.3257375, 0.026353687, -0.42709586, 0.15230247, 0.19455267, -0.20558092, 0.040543195, 0.30100232, 0.1208413, -0.022922885, -0.0527519, -0.2754452) * go_1(-1.0, -1.0);
|
||||
result += mat4(-0.39697862, 0.59894156, -0.14519346, -0.21375597, -0.042094186, -0.11699173, -0.3065778, 0.045603614, -0.2315796, 0.1926384, 0.19640557, 0.023360144, 0.11569712, 0.080500975, -0.24562629, -0.11990825) * go_1(-1.0, 0.0);
|
||||
result += mat4(0.030446287, -0.2191283, -0.020313436, 0.12092218, -0.04726904, -0.06145154, -0.10886858, -0.016195009, 0.074864194, 0.048508577, -0.024673669, 0.10286324, 0.23434684, -0.1291551, -0.04299077, -0.12459363) * go_1(-1.0, 1.0);
|
||||
result += mat4(0.064445384, 0.16708861, 0.10306973, -0.13419592, -0.15216815, 0.12578042, -0.575184, -0.46423253, 0.42238462, -0.4330836, -0.26651257, 0.57413465, -0.10399166, 0.1914047, 0.15641387, 0.07064538) * go_1(0.0, -1.0);
|
||||
result += mat4(0.04809328, -0.12349369, 0.1853755, -0.013703159, -0.12840022, 0.022170544, -0.26412117, -0.30681273, -0.31553897, -0.07833276, -0.17104533, 0.03156802, 0.029389234, -0.017229239, -0.052230056, -0.04573632) * go_1(0.0, 0.0);
|
||||
result += mat4(-0.1380467, 0.31759852, 0.06532168, 0.19637011, 0.24012493, -0.04863545, -0.21709125, -0.21216264, 0.16879074, 0.10763089, 0.22363038, -0.14004646, 0.19021708, -0.099481724, -0.0073404606, 0.04956918) * go_1(0.0, 1.0);
|
||||
result += mat4(-0.068974994, 0.5005385, -0.12780246, 0.05813948, 0.035919234, 0.039779782, 0.0028248294, -0.21344285, 0.17026006, -0.17971572, -0.20932221, -0.0862113, -0.0074473396, 0.119821966, 0.28552157, -0.027787263) * go_1(1.0, -1.0);
|
||||
result += mat4(0.20083936, -0.08729008, -0.01474545, 0.061849594, 0.09285405, 0.074680895, -0.11493401, -0.35524356, 0.098670855, -0.31036818, 0.01269914, -0.06409305, -0.13034628, 0.07905559, 0.0018419055, -0.047743056) * go_1(1.0, 0.0);
|
||||
result += mat4(-0.0008763842, 0.16266613, -0.13819253, 0.04136551, 0.11757835, -0.01075886, 0.13635348, 0.14200751, -0.036117654, -0.016920915, -0.003860492, -0.14361666, 0.18442062, -0.0119510535, 0.1574026, 0.11443297) * go_1(1.0, 1.0);
|
||||
result += mat4(-0.26120907, 0.0040505654, -0.01111041, -0.028482055, 0.094762795, -0.27338502, 0.18852817, -0.15605745, -0.012533703, 0.17356302, -0.2594928, -0.04016552, 0.060918808, -0.10248847, 0.12710676, 0.1503744) * go_2(-1.0, -1.0);
|
||||
result += mat4(0.24577981, -0.047384363, -0.13740875, 0.058981817, 0.09629815, -0.042157363, 0.17206886, 0.06895825, -0.13252918, 0.0941419, -0.048901185, 0.052710008, -0.104840726, 0.11820465, 0.17454259, 0.05037063) * go_2(-1.0, 0.0);
|
||||
result += mat4(-0.2239817, 0.4553206, -0.017824922, -0.050273463, -0.21029685, -0.032555267, -0.08916583, 0.10736202, 0.18478145, -0.09538145, 0.052327603, 0.12728482, -0.11439347, 0.17596558, 0.054506473, -0.017638389) * go_2(-1.0, 1.0);
|
||||
result += mat4(-0.072854675, 0.015542916, -0.1950096, 0.06664522, 0.1548192, -0.22573462, -0.20828351, 0.16661869, 0.033900462, 0.23870395, 0.11434291, 0.21813981, 0.12673119, 0.08014363, 0.022457503, 0.20910633) * go_2(0.0, -1.0);
|
||||
result += mat4(0.2652937, 0.17511544, -0.10850216, 0.081340194, -0.21500582, -0.036195952, -0.04102979, -0.15212043, -0.29559842, 0.25977176, 0.24641588, 0.13869548, -0.41371983, -0.14120851, 0.109116435, 0.22358306) * go_2(0.0, 0.0);
|
||||
result += mat4(-0.108154014, 0.35006878, -0.055340957, -0.23728919, -0.24589789, -0.06516491, -0.03474703, -0.047869515, -0.0045436365, -0.17755373, -0.039802775, 0.21740748, -0.033278447, -0.10501602, -0.089266, -0.04061338) * go_2(0.0, 1.0);
|
||||
result += mat4(0.028205335, 0.003054092, 0.14546792, -0.10006339, -0.052365907, -0.13063054, -0.08356806, 0.20927623, 0.05030947, 0.21224388, 0.45320153, 0.0051093665, 0.0021801728, -0.12858267, -0.10686808, 0.21674173) * go_2(1.0, -1.0);
|
||||
result += mat4(0.10200768, 0.13099737, 0.13514566, -0.17343043, -0.22834082, 0.055208363, -0.20808199, -0.0015957861, -0.13871242, -0.06423964, 0.3320781, 0.051521134, -0.11108624, -0.17557982, -0.12519105, 0.067071475) * go_2(1.0, 0.0);
|
||||
result += mat4(0.20798117, -0.046690967, 0.17071529, -0.29893485, -0.06927812, 0.072701424, -0.30537283, -0.16406195, 0.10575524, -0.063635424, -0.044293836, 0.08667325, -0.16368344, 0.2196707, -0.29370767, 0.16401167) * go_2(1.0, 1.0);
|
||||
result += mat4(-0.04009042, -0.034136664, 0.15880232, -0.058544576, -0.09724303, 0.13140567, -0.15769257, 0.05637733, -0.061678827, -0.19032978, 0.11843628, -0.25161943, -0.12645799, -0.27027693, -0.19899485, 0.2231074) * go_3(-1.0, -1.0);
|
||||
result += mat4(0.07176237, -0.12067612, -0.070081174, 0.10180745, -0.1705716, -0.039632697, -0.22599341, -0.12012279, 0.24187793, 0.015815722, -0.03722175, 0.098794326, 0.19674404, -0.040387046, 0.03916034, 0.013947429) * go_3(-1.0, 0.0);
|
||||
result += mat4(-0.06389604, 0.04532417, -0.20961155, -0.22151196, 0.08498287, -0.0912261, -0.17840882, -0.13550358, -0.17497064, 0.12473174, 0.025784912, -0.060957976, -0.17787372, 0.21546759, -0.081276976, -0.0057096705) * go_3(-1.0, 1.0);
|
||||
result += mat4(-0.09308164, -0.036254935, 0.07291895, -0.010599356, -0.07466555, 0.18080021, -0.012473155, 0.24264692, 0.043592792, -0.15068708, 0.19074705, -0.1608174, 0.07106228, -0.15757518, -0.19600157, 0.21481107) * go_3(0.0, -1.0);
|
||||
result += mat4(0.10340095, 0.14977756, -0.18035571, -0.00454613, -0.018766372, -0.0006462305, 0.12609644, -0.022229725, -0.11288012, -0.10881946, 0.016426437, 0.047212575, -0.015592831, 0.088430114, -0.019637503, -0.15445113) * go_3(0.0, 0.0);
|
||||
result += mat4(0.13125896, -0.05610665, 0.04579115, -0.20584439, 0.016590014, -0.14247346, -0.045108374, -0.07701804, 0.059466217, 0.10401916, -0.114898264, 0.15725806, 0.02189435, 0.016297683, -0.11828137, -0.07996226) * go_3(0.0, 1.0);
|
||||
result += mat4(-0.038534615, 0.046327326, 0.04947746, 0.07890686, -0.08618927, 0.1135833, -0.008643036, -0.019718027, -0.08664565, 0.068627, -0.06325347, 0.04222515, 0.120940305, -0.106959745, 0.022951378, 0.14290553) * go_3(1.0, -1.0);
|
||||
result += mat4(0.06408585, 0.19215317, 0.05731193, 0.09329293, 0.26087278, -0.124888204, -0.15473562, -0.037721, -0.12800066, 0.12517492, -0.06680967, 0.09497935, 0.23841377, 0.1347636, 0.17279463, 0.0038290594) * go_3(1.0, 0.0);
|
||||
result += mat4(0.08006353, -0.07942165, 0.14611697, 0.053477652, 0.13953096, -0.14270853, -0.009859328, -0.21148224, 0.11157642, -0.12486184, -0.0709194, 0.16277598, -0.08118929, -0.04684391, 0.049433514, -0.28911993) * go_3(1.0, 1.0);
|
||||
result += vec4(-0.15367588, -0.07928099, 0.063567765, 0.108769014);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v4.0-Restore-CNN-(L)-Conv-4x3x3x16
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_1_tf
|
||||
//!BIND conv2d_1_tf1
|
||||
//!SAVE conv2d_2_tf1
|
||||
//!WIDTH conv2d_1_tf.w
|
||||
//!HEIGHT conv2d_1_tf.h
|
||||
//!COMPONENTS 4
|
||||
#define go_0(x_off, y_off) (max((conv2d_1_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max((conv2d_1_tf1_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_2(x_off, y_off) (max(-(conv2d_1_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_3(x_off, y_off) (max(-(conv2d_1_tf1_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(0.13100185, 0.028466834, 0.21762301, 0.07392093, -0.00046575023, -0.08175499, -0.07715949, 0.056365166, -0.028316915, -0.037371337, -0.16343145, -0.078509934, -0.178982, 0.06893543, -0.12027178, 0.06993414) * go_0(-1.0, -1.0);
|
||||
result += mat4(0.07834248, 0.046873976, 0.23983683, -0.06646688, -0.04749886, -0.101967975, -0.082395144, -0.015339724, -0.07693013, 0.016892025, -0.08877053, 0.14534354, -0.30249342, -0.08455913, 0.09002741, -0.12472986) * go_0(-1.0, 0.0);
|
||||
result += mat4(-0.039911453, 0.11150177, -0.009199328, 0.043733858, -0.013332275, -0.119128324, -0.09285867, 0.007959111, 0.23202884, 0.06459362, 0.071042486, 0.09901959, -0.046906233, -0.07916646, -0.07528521, 0.05652529) * go_0(-1.0, 1.0);
|
||||
result += mat4(0.12189273, -0.07608036, -0.09632985, -0.03643418, -0.1058494, -0.045247663, 0.016788295, 0.046447262, 0.08731556, -0.07916306, -0.17591585, 0.070336945, 0.0825902, 0.21166702, -0.14786263, 0.012765127) * go_0(0.0, -1.0);
|
||||
result += mat4(-0.15099311, -0.082614996, -0.010447922, -0.2116295, 0.22785337, -0.0015175309, 0.21255092, 0.058660604, -0.022553608, -0.120723926, 0.0561124, 0.018720774, 0.0862727, -0.02351105, 0.037588555, -0.013596472) * go_0(0.0, 0.0);
|
||||
result += mat4(-0.17424586, -0.091873385, 0.20892383, 0.3079469, -0.08027999, -0.07241797, 0.035928074, -0.031040983, -0.03548984, -0.047187436, 0.17053668, 0.39115313, 0.061380606, 0.13889132, -0.041030813, -0.022435248) * go_0(0.0, 1.0);
|
||||
result += mat4(-0.0037971158, -0.19398233, -0.041492697, -0.08632908, 0.05087685, 0.114212446, 0.09395637, -0.12073027, 0.18993643, -0.025265925, -0.17716514, -0.062493253, 0.078527555, -0.13106133, 0.09158833, -0.08067098) * go_0(1.0, -1.0);
|
||||
result += mat4(0.11454478, -0.053314645, 0.02932442, -0.052710265, 0.10180192, -0.05165681, 0.1415095, -0.0886421, 0.25377235, -0.16350931, -0.07908212, 0.081858, 0.13214986, 0.056609593, -0.029691117, -0.1963397) * go_0(1.0, 0.0);
|
||||
result += mat4(0.13833676, 0.024542026, -0.07700002, -0.016948726, -0.13303484, -0.0951515, -0.031009076, 0.055997517, -0.037423257, -0.1693348, 0.015715523, 0.053379383, 0.12330872, -0.15478514, 0.14523397, 0.18046756) * go_0(1.0, 1.0);
|
||||
result += mat4(0.20786218, 0.14361653, 0.49472246, 0.09881262, -0.34138504, -0.0025990994, -0.43033788, -0.00039400125, -0.002008598, 0.23800024, 0.04231959, 0.028620182, 0.13962908, 0.089462794, -0.14335507, 0.008409915) * go_1(-1.0, -1.0);
|
||||
result += mat4(-0.12720335, -0.3409636, -0.023997113, 0.026997993, -0.20555046, -0.027020821, -0.235406, 0.09561914, 0.44234744, -0.07148167, 0.00064560794, -0.1726457, -0.014688707, 0.21288827, 0.17666213, -0.11264844) * go_1(-1.0, 0.0);
|
||||
result += mat4(-0.38011166, 0.014146791, 0.03394759, 0.08368928, -0.14633556, 0.11139822, -0.25683075, 0.07368074, -0.25248998, 0.12499596, -0.004184047, 0.192279, -0.048109, -0.006033096, 0.028591031, 0.15288617) * go_1(-1.0, 1.0);
|
||||
result += mat4(0.10880278, -0.02255051, 0.21004406, -0.034776326, 0.10378925, -0.22322227, -0.11731474, -0.11443079, -0.30380723, 0.3183636, 0.18248428, -0.10215758, -0.049251713, 0.12848853, 0.012738647, 0.03222829) * go_1(0.0, -1.0);
|
||||
result += mat4(0.54890627, 0.20614935, -0.019661043, -0.07782363, -0.07293127, -0.004283575, -0.036939718, 0.19752185, -0.41021585, -0.050092876, 0.023610009, -0.23783271, 0.11343489, 0.21473971, -0.06997083, -0.10420534) * go_1(0.0, 0.0);
|
||||
result += mat4(-0.08103626, 0.091647685, -0.17259495, -0.24478562, 0.08222839, 0.12299736, -0.12480139, 0.08303869, 0.069200024, 0.0005504728, 0.01590888, -0.029884247, 0.029297108, 0.17425247, 0.055239804, -0.06290667) * go_1(0.0, 1.0);
|
||||
result += mat4(-0.25949356, -0.049375266, -0.19764636, 0.04848412, 0.14846909, 0.07249825, -0.038826656, -0.15756363, -0.1748046, 0.1839563, -0.015786756, 0.012645979, 0.09585216, 0.07619667, 0.010932837, 0.06530666) * go_1(1.0, -1.0);
|
||||
result += mat4(-0.0592303, 0.34068975, -0.0043445593, 0.25165552, 0.22237164, 0.041179545, -0.046396293, 0.22462137, 0.034741532, 0.06565189, 0.13475078, 0.08480505, 0.1708352, 0.057039484, 0.037506044, -0.34036627) * go_1(1.0, 0.0);
|
||||
result += mat4(-0.10844713, 0.113506734, -0.14367405, 0.111787796, 0.031758603, -0.06955974, -0.068098925, 0.14282043, 0.094929375, 0.18194464, -0.045276128, -0.0032632013, 0.007969798, -0.0590313, 0.05033309, 0.06328967) * go_1(1.0, 1.0);
|
||||
result += mat4(-0.08094655, -0.08266014, -0.31147677, -0.062742665, -0.017061448, 0.26350877, 0.10840224, -0.16414656, 0.25499284, -0.3347594, 0.25973678, 0.15623575, 0.022350369, -0.08235582, 0.29226762, -0.14951667) * go_2(-1.0, -1.0);
|
||||
result += mat4(0.16715927, 0.31846005, -0.007528655, -0.04655408, 0.07248268, -0.1295353, 0.119970314, 0.00721155, 0.19906871, 0.06366751, -0.055744495, 0.11151067, 0.09488815, -0.09006814, -0.1341, -0.12335882) * go_2(-1.0, 0.0);
|
||||
result += mat4(-0.18715191, -0.06641214, -0.24086717, -0.13160741, -0.20222618, -0.08882262, 0.09281967, -0.14381158, 0.31153843, 0.10280565, -0.06487702, -0.0030142434, 0.12800919, 0.059373695, 0.108098336, -0.025091475) * go_2(-1.0, 1.0);
|
||||
result += mat4(-0.26941344, -0.010607985, -0.059500597, -0.087650314, 0.057776485, 0.032416668, -0.0014182271, -0.053006213, 0.198899, -0.12861459, 0.1999814, 0.053311568, 0.0801663, -0.2101018, 0.110617965, -0.02017489) * go_2(0.0, -1.0);
|
||||
result += mat4(-0.0888614, -0.07155236, -0.019973263, -0.12744384, -0.17749546, 0.041163083, 0.07273392, -0.09820898, -0.14922594, -0.11169263, -0.069319114, -0.04354858, 0.18076904, 0.084879614, -0.04125808, 0.068733074) * go_2(0.0, 0.0);
|
||||
result += mat4(0.025723739, -0.3071993, -0.26200652, -0.24551399, 0.040670983, 0.29252282, -0.14551005, 0.111219764, -0.21262506, -0.026296655, 0.16694368, 0.0041154358, 0.03154805, 0.07315552, 0.13088223, -0.10842478) * go_2(0.0, 1.0);
|
||||
result += mat4(0.070245974, 0.110039465, 0.19028768, -0.042884093, -0.09198143, 0.07932312, 0.09101255, 0.046001278, 0.18428285, -0.026307642, 0.099789225, -0.12612925, -0.40322223, 0.18879798, 0.010587032, 0.055332247) * go_2(1.0, -1.0);
|
||||
result += mat4(-0.057069883, -0.032890134, -0.0513947, -0.074211985, -0.19471937, 0.18182398, -0.2119559, 0.2439066, -0.14167733, 0.25903046, 0.18162172, -0.007826057, -0.06429918, 0.02668084, 0.077179454, 0.023550559) * go_2(1.0, 0.0);
|
||||
result += mat4(0.14551505, 0.11689716, 0.28027633, -0.18079606, 0.016579725, 0.03988999, 0.074107096, -0.15190484, -0.060423456, 0.39282638, -0.005255287, 0.09286323, -0.1003253, -0.0412654, -0.117815144, -0.22671913) * go_2(1.0, 1.0);
|
||||
result += mat4(-0.26655, 0.02524124, -0.15780295, 0.010378331, 0.038483843, -0.18752888, 0.12708266, 0.020122316, -0.13007571, 0.11942783, 0.1515452, 0.068273015, -0.11957963, -0.061313108, 0.18422426, -0.16399868) * go_3(-1.0, -1.0);
|
||||
result += mat4(-0.17614686, 0.12740774, -0.12034426, 0.00811552, -0.027063683, 0.004154653, -0.1892024, -0.051516473, -0.15957421, 0.103997365, 0.12231665, -0.082051665, 0.1611069, -0.017016938, 0.03224853, 0.16816284) * go_3(-1.0, 0.0);
|
||||
result += mat4(-0.15254295, -0.011885901, -0.03317691, 0.076534435, -0.060000043, 0.020979656, -0.11068878, 0.17345367, 0.033083163, -0.016063845, -0.03998401, -0.14917895, 0.05829016, 0.055933036, 0.0152959, -0.11680771) * go_3(-1.0, 1.0);
|
||||
result += mat4(-0.22236426, 0.093723886, 0.004360134, 0.05051143, 0.017353376, -0.0092351325, -0.16306834, 0.031693168, 0.20352198, 0.060595278, 0.08691345, 0.25801733, -0.09962889, -0.014900563, -0.15118423, -0.096163675) * go_3(0.0, -1.0);
|
||||
result += mat4(-0.19981825, -0.21788603, 0.20982541, -0.113621205, 0.005621798, 0.0943901, -0.17422888, -0.18507147, 0.30247143, 0.06899553, -0.16009268, 0.067299575, -0.21744101, -0.015869575, 0.095568515, -0.036854178) * go_3(0.0, 0.0);
|
||||
result += mat4(0.06810536, 0.11014666, 0.24017857, 0.12042336, -0.12038678, 0.015001737, -0.17134188, 0.10343175, 0.09067457, 0.11136803, 0.024367718, -0.13199149, -0.37008765, 0.07137436, 0.122724056, 0.06668219) * go_3(0.0, 1.0);
|
||||
result += mat4(0.28085753, -0.14428541, 0.08978648, 0.05202615, -0.15860316, -0.06101108, -0.18904316, 0.104275696, 0.06810539, -0.07249347, -0.10909362, 0.019484319, -0.025948122, 0.0910616, -0.17025243, -0.035804044) * go_3(1.0, -1.0);
|
||||
result += mat4(0.10040864, -0.27650854, -0.029030709, -0.0531634, 0.050312318, 0.14849235, -0.059385244, -0.13935417, -0.16425262, -0.14445016, -0.22415695, 0.04330054, 0.0024454365, -0.009127519, -0.24255885, -0.06303984) * go_3(1.0, 0.0);
|
||||
result += mat4(0.054911103, -0.2811866, -0.049883213, 0.09221324, 0.041680478, 0.1959676, -0.15021674, -0.006908881, -0.15814131, -0.15958795, 0.15639575, -0.10088554, -0.22732499, -0.082894124, 0.06674789, -0.10491449) * go_3(1.0, 1.0);
|
||||
result += vec4(-0.038157728, 0.01904009, 0.07848918, -0.04052424);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v4.0-Restore-CNN-(L)-Conv-4x3x3x16
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_2_tf
|
||||
//!BIND conv2d_2_tf1
|
||||
//!SAVE conv2d_3_tf
|
||||
//!WIDTH conv2d_2_tf.w
|
||||
//!HEIGHT conv2d_2_tf.h
|
||||
//!COMPONENTS 4
|
||||
#define go_0(x_off, y_off) (max((conv2d_2_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max((conv2d_2_tf1_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_2(x_off, y_off) (max(-(conv2d_2_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_3(x_off, y_off) (max(-(conv2d_2_tf1_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(0.044146776, -0.026106803, -0.15219912, -0.15929134, 0.02972265, -0.05223942, 0.06760582, 0.04324784, -0.13192074, 0.12351806, 0.0855665, -0.11861024, 0.097702436, 0.10298012, -0.03555207, 0.06544868) * go_0(-1.0, -1.0);
|
||||
result += mat4(0.05458123, 0.014500078, 0.048824716, 0.14172198, 0.057214983, -0.06896361, -0.052671798, 0.10043398, -0.029938918, -0.013474177, 0.10448471, 0.29896173, -0.0037866347, -0.06600103, -0.19298725, -0.119502924) * go_0(-1.0, 0.0);
|
||||
result += mat4(-0.07483799, 0.0757225, -0.07432271, -0.02994328, -0.047863305, -0.08091319, -0.13640103, -0.16553412, 0.019309495, 0.13153689, 0.14757608, 0.041081686, 0.1447018, -0.09976335, -0.06094595, -0.019380448) * go_0(-1.0, 1.0);
|
||||
result += mat4(-0.116722435, 0.018069802, 0.082960755, 0.25008422, -0.10093022, 0.15039717, 0.16740529, 0.08372216, -0.17313154, 0.072606385, 0.1134366, 0.09108986, -0.025453486, -0.0014705429, 0.073060215, -0.0786531) * go_0(0.0, -1.0);
|
||||
result += mat4(-0.22601452, 0.5512376, -0.11920107, -0.12763597, -0.008671738, -0.058479775, -0.268992, -0.06614402, -0.26501563, -0.030529302, -0.04196243, 0.13161187, 0.1170102, -0.25060177, 0.060350843, -0.1524947) * go_0(0.0, 0.0);
|
||||
result += mat4(-0.1648866, 0.05652559, -0.040925294, -0.11008188, 0.21542753, -0.116541564, -0.08021358, -0.13785587, -0.05141525, -0.039133884, -0.1124311, 0.17472316, -0.22469969, 0.09842997, 0.10967242, -0.020226078) * go_0(0.0, 1.0);
|
||||
result += mat4(-0.12250246, 0.10348344, -0.018174428, 0.037790317, 0.07088387, 0.27629474, 0.049727917, -0.0011699499, -0.1497167, 0.048863184, 0.00309108, 0.12177124, 0.022598455, 0.08864282, -0.048928354, 0.088068075) * go_0(1.0, -1.0);
|
||||
result += mat4(0.043115202, 0.24277024, 0.17749861, 0.10550521, 0.008603091, -0.36454508, 0.09997063, 0.11979698, -0.15786794, -0.008746184, 0.06689776, -0.20002088, 0.04094072, 0.042499837, -0.05387774, -0.10426778) * go_0(1.0, 0.0);
|
||||
result += mat4(0.06600674, 0.07645438, 0.015209062, 0.23262201, -0.08001964, -0.09341582, 0.008619914, 0.093308866, -0.124739006, -0.007209568, -0.06492457, 0.22863889, 0.17875427, 0.0779068, -0.09997953, -0.021379821) * go_0(1.0, 1.0);
|
||||
result += mat4(-0.043263335, 0.1548246, 0.09254137, 0.16256322, 0.13361873, -0.10850825, 0.09901608, -0.0753444, -0.02345517, 0.030159235, -0.0043304237, 0.19805421, -0.11997134, 0.0948639, -0.09261292, 0.1167355) * go_1(-1.0, -1.0);
|
||||
result += mat4(0.1042119, -0.08793884, -0.15884337, -0.08414226, -0.02642236, -0.032897346, -0.07664125, 0.064429455, 0.04868224, 0.04438529, -0.083366744, -0.06398503, -0.2364328, -0.039592575, -0.15421078, 0.17369357) * go_1(-1.0, 0.0);
|
||||
result += mat4(0.20374978, -0.09289948, -0.25493136, 0.028119517, 0.053481918, -0.062769525, -0.052148513, -0.20336467, -0.07322327, 0.071623735, -0.05846495, 0.23537324, 0.030998409, -0.0572314, -0.30425155, 0.17616381) * go_1(-1.0, 1.0);
|
||||
result += mat4(-0.008999034, 0.19063166, -0.16384077, 0.08840229, 0.005153292, 0.17091888, 0.05193965, -0.09363918, 0.07379054, 0.0416411, 0.007373337, -0.002444226, 0.090993404, -0.17546643, -0.14595066, 0.19029109) * go_1(0.0, -1.0);
|
||||
result += mat4(-0.07473051, 0.022953797, 0.3694185, -0.000816042, 0.014621785, -0.029232977, -0.0163784, 0.30796757, 0.024686797, -0.0376939, 0.106044516, 0.10191429, -0.11145659, -0.23659907, 0.11254082, 0.078495234) * go_1(0.0, 0.0);
|
||||
result += mat4(0.05722472, 0.014075986, 0.077577166, -0.1319451, 0.0063364087, 0.07042797, 0.013867829, -0.01543331, -0.069067486, -0.07245758, 0.059568863, 0.06195517, -0.25257275, -0.19943956, -0.19534364, -0.1566254) * go_1(0.0, 1.0);
|
||||
result += mat4(0.10666801, 0.19854072, -0.14524002, 0.21727695, 0.07621112, 0.103370175, 0.003522481, -0.03526533, 0.09204845, 0.04930996, -0.009533781, 0.071561396, 0.007946626, -0.09155877, -0.18856467, 0.11516717) * go_1(1.0, -1.0);
|
||||
result += mat4(0.15758498, 0.25284624, -0.03834856, -0.16141246, -0.09860034, -0.35015398, 0.08133997, 0.05046502, 0.20083027, -0.0026045898, -0.23627196, 0.07382544, 0.11064689, -0.0707055, -0.18984218, -0.09250848) * go_1(1.0, 0.0);
|
||||
result += mat4(0.05949194, 0.00070572464, 0.10784266, -0.008810496, 0.06522392, -0.0023800225, -0.01614215, -0.015862722, 0.08078033, 0.10827174, 0.11440369, 0.014041329, 0.053579852, -0.11658711, -0.052344058, -0.03857412) * go_1(1.0, 1.0);
|
||||
result += mat4(-0.054652497, 0.072690494, 0.11310003, 0.09839347, -0.08197539, 0.089851685, 0.039466213, -0.059131484, 0.03934494, -0.09728057, 0.07211633, 0.14545459, -0.08371904, -0.02848036, -0.020263305, -0.12366355) * go_2(-1.0, -1.0);
|
||||
result += mat4(-0.13024135, 0.10256835, -0.088607304, -0.08425782, -0.067031406, -0.03591957, 0.034701034, -0.0573039, -0.048706584, 0.10135636, -0.13818035, -0.09554917, 0.1541496, -0.09246093, 0.11827978, -0.02703279) * go_2(-1.0, 0.0);
|
||||
result += mat4(-0.057035744, 0.063911796, 0.12805207, 0.13411741, 0.00924603, -0.03657417, 0.08100167, -0.031264946, -0.03189199, -0.049402498, -0.046219792, 0.12624107, 0.2809697, -0.1264563, 0.02382632, -0.16174819) * go_2(-1.0, 1.0);
|
||||
result += mat4(0.032658063, 0.029207656, -0.020362824, -0.18823773, -0.20003095, 0.09240136, 0.004393565, 0.28016117, -0.17617643, 0.21443488, -0.06436653, 0.09426579, -0.012660543, -0.038343526, -0.087761596, -0.06952474) * go_2(0.0, -1.0);
|
||||
result += mat4(0.013616554, -0.16468868, 0.1281466, 0.08476041, -0.0138902385, -0.04434069, 0.12031286, -0.07590152, -0.12818764, 0.1970344, 0.042898823, 0.018936606, 0.019264435, -0.13713486, -0.027062744, 0.26364017) * go_2(0.0, 0.0);
|
||||
result += mat4(-0.03121837, -0.040610187, 0.0023387137, 0.11021297, 0.04006531, 0.089258075, 0.038287688, 0.19519399, 0.0590789, -0.0127886515, 0.16618161, -0.11148632, -0.10438067, 0.088400334, 0.115820415, 0.23558354) * go_2(0.0, 1.0);
|
||||
result += mat4(-0.14781238, -0.020881698, 0.040218577, 0.090248026, -0.04531296, 0.121813886, -0.12156261, -0.02640371, 0.019912932, 0.029554896, -0.032324113, 0.060553055, -0.14531589, -0.20826598, 0.1945815, -0.18510781) * go_2(1.0, -1.0);
|
||||
result += mat4(-0.24151343, 0.08096261, -0.08314715, 0.121899664, -0.21133694, 0.25925165, 0.037419003, 0.0027491911, 0.07981589, -0.06247693, -0.07793235, -0.050702088, -0.21040778, -0.051243544, 0.021130228, -0.16032514) * go_2(1.0, 0.0);
|
||||
result += mat4(-0.1940846, 0.005878943, 0.09001744, 0.00996283, -0.01720877, 0.11209827, -0.045714185, 0.017633213, 0.11248759, -0.070436165, 0.059041988, -0.117122024, -0.15776572, 0.041433014, 0.06852976, -0.32530108) * go_2(1.0, 1.0);
|
||||
result += mat4(-0.018681401, 0.07524977, -0.09961975, -0.025000824, -0.14728728, 0.17958179, 0.05077947, 0.09839162, -0.24664684, 0.2350485, 0.043190528, 0.123329654, 0.031106282, -0.024857467, 0.026871338, 0.03363785) * go_3(-1.0, -1.0);
|
||||
result += mat4(0.090937026, 0.113483965, 0.10115868, 0.09630846, 0.040868916, -0.14394417, 0.13920946, -0.09652194, -0.21267591, 0.079470165, 0.35935298, -0.029055713, 0.0462934, 0.02001686, 0.01959559, 0.0067710667) * go_3(-1.0, 0.0);
|
||||
result += mat4(0.025194263, 0.087321565, -0.008157793, -0.12381555, 0.07437093, -0.024633797, -0.13163073, 0.053631987, -0.16161191, -0.33736497, -0.16600001, -0.16064753, -0.01877911, 0.006173125, -0.21867354, -0.11551306) * go_3(-1.0, 1.0);
|
||||
result += mat4(0.016227739, 0.041133694, 0.12241288, 0.1840938, 0.16001828, -0.07284954, -0.0840258, 0.10275262, 0.059712093, 0.18617383, -0.004344732, 0.04759032, -0.112888224, 0.025455667, 0.06032809, -0.24498977) * go_3(0.0, -1.0);
|
||||
result += mat4(0.07140021, 0.24720372, -0.12715518, 0.13462298, 0.07784012, 0.04233614, 0.030195842, -0.095302135, 0.1719011, -0.16173883, 0.082427144, -0.03078554, -0.115330435, 0.2787821, -0.15274885, -0.016630588) * go_3(0.0, 0.0);
|
||||
result += mat4(0.08701172, 0.021434337, -0.15877618, 0.22535062, 0.014872742, -0.0068805423, -0.051181257, -0.38192979, 0.20793833, -0.2901109, -0.057449028, -0.044476006, -0.08431449, -0.05297424, -0.05526057, -0.06096434) * go_3(0.0, 1.0);
|
||||
result += mat4(0.12446916, -0.010789559, 0.18910398, -0.14184885, -0.040306002, 0.062063884, 0.14885572, 0.0050085005, 0.07284438, 0.03938155, 0.27486423, -0.079940364, -0.10640366, -0.11455711, 0.018501248, -0.05743762) * go_3(1.0, -1.0);
|
||||
result += mat4(0.26359692, 0.014875724, 0.043625355, 0.0974379, 0.09281598, 0.2449208, -0.07954478, -0.20232148, 0.025533125, -0.29744807, 0.1810463, -0.09866862, -0.16949633, -0.097010635, 0.04885873, 0.08639066) * go_3(1.0, 0.0);
|
||||
result += mat4(0.10937537, 0.024320884, -0.084123306, 0.045726787, 0.08169718, 0.038608517, 0.2250605, -0.031330425, -0.008280292, -0.026776202, -0.14776887, 0.3436263, -0.16302314, -0.15479733, -0.10982676, 0.12014077) * go_3(1.0, 1.0);
|
||||
result += vec4(0.046519246, -0.00879819, -0.044789877, -0.07887647);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v4.0-Restore-CNN-(L)-Conv-4x3x3x16
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_2_tf
|
||||
//!BIND conv2d_2_tf1
|
||||
//!SAVE conv2d_3_tf1
|
||||
//!WIDTH conv2d_2_tf.w
|
||||
//!HEIGHT conv2d_2_tf.h
|
||||
//!COMPONENTS 4
|
||||
#define go_0(x_off, y_off) (max((conv2d_2_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max((conv2d_2_tf1_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_2(x_off, y_off) (max(-(conv2d_2_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_3(x_off, y_off) (max(-(conv2d_2_tf1_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.10340159, 0.03126175, 0.008010763, -0.014703102, 0.06388945, 0.08303292, -0.052860666, 0.1492984, 0.06422952, -0.029731093, -0.021047806, 0.0012385565, 0.025289888, 0.08642119, 0.06883434, 0.023763692) * go_0(-1.0, -1.0);
|
||||
result += mat4(0.0748618, -0.048646145, 0.07845818, -0.24385995, 0.077536225, -0.29863936, 0.24418406, 0.07232939, -0.0054087904, 0.05985848, -0.017639449, 0.12629768, 0.108363576, 0.09904134, -0.00050070864, -0.11790627) * go_0(-1.0, 0.0);
|
||||
result += mat4(0.05239057, 0.15894121, -0.07164557, -0.32539955, 0.046355467, -0.1368222, 0.10285978, 0.0981996, 0.04779384, -0.19793929, 0.06193576, -0.061980426, 0.12222037, 0.06162786, 0.12215435, 0.045095358) * go_0(-1.0, 1.0);
|
||||
result += mat4(0.11633697, -0.07783625, 0.038284954, -0.1077604, 0.050120354, -0.039917693, -0.05126379, 0.020723915, 0.06922371, 0.07441101, 0.04355437, -0.0009652994, -0.040668465, 0.11270888, -0.056610428, 0.018002095) * go_0(0.0, -1.0);
|
||||
result += mat4(0.1991713, -0.12291669, 0.007297408, -0.22448927, 0.0118651325, -0.15347931, -0.02881685, -0.13971193, -0.0597255, -0.056213673, -0.16497411, -0.087855674, -0.09711957, 0.19384801, -0.09268538, 0.0010212396) * go_0(0.0, 0.0);
|
||||
result += mat4(0.13538352, 0.20081995, 0.05765413, 0.08507135, -0.11396954, -0.06537804, 0.1840262, 0.13141033, 0.07317906, 0.053597126, 0.14733106, -0.027857138, -0.008961551, -0.030892484, -0.10815004, 0.07787356) * go_0(0.0, 1.0);
|
||||
result += mat4(0.14028777, 0.20683727, -0.1973804, -0.14879352, 0.08193435, 0.06776529, 0.15067616, -0.005689123, 0.091099024, -0.04523496, -0.025365459, 0.046144743, 0.073163316, -0.050716147, 0.03645591, 0.08450625) * go_0(1.0, -1.0);
|
||||
result += mat4(0.05377605, 0.29956514, -0.05203467, -0.12395672, -0.07375765, 0.07590657, -0.1648796, 0.016921869, -0.15838358, -0.18164106, 0.048942942, 0.08723644, -0.05655316, 0.06374977, 0.03486325, -0.17268877) * go_0(1.0, 0.0);
|
||||
result += mat4(0.067100935, 0.116894506, -0.12316177, -0.28647798, 0.15253417, -0.043991808, -0.07732363, 0.12502535, 0.027790325, -0.13292582, 0.06508008, 0.033653572, 0.100093335, 0.044676002, 0.1450233, 0.108926095) * go_0(1.0, 1.0);
|
||||
result += mat4(-0.25443476, 0.0075249635, 0.09893316, 0.13884877, -0.009865199, 0.028503535, 0.04932893, -0.021844162, 0.09569463, 0.042022802, -0.0056093778, -0.044183288, 0.012850613, 0.08729362, 0.088493116, -0.035626948) * go_1(-1.0, -1.0);
|
||||
result += mat4(-0.28942817, -0.2278143, -0.124107786, 0.18914355, -0.13334653, -0.061389446, 0.09170535, 0.1529043, 0.070113055, 0.052939575, -0.027512128, 0.043993592, 0.058714498, 0.0618404, 0.07549026, 0.27376285) * go_1(-1.0, 0.0);
|
||||
result += mat4(-0.17169511, 0.18338326, 0.09645834, -0.19721629, -0.062608786, -0.06097738, -0.052246977, 0.11313908, -0.002827855, -0.08297087, 0.2045053, 0.027751451, 0.05598507, 0.08318512, -0.020142859, -0.07377832) * go_1(-1.0, 1.0);
|
||||
result += mat4(0.024627045, -0.065384455, -0.04648491, -0.32704023, -0.16444866, -0.0068647224, -0.20919928, -0.18135908, 0.05522183, -0.12074867, 0.04628794, 0.025948782, 0.058282085, 0.16593929, -0.1396821, -0.36740735) * go_1(0.0, -1.0);
|
||||
result += mat4(0.16715747, -0.03793736, 0.08576081, 0.23338848, 0.051240716, 0.090182334, -0.046501555, -0.0894777, -0.06944291, -0.05119481, -0.15820025, -0.17854515, 0.3914519, -0.0677236, 0.076883785, -0.16959) * go_1(0.0, 0.0);
|
||||
result += mat4(-0.16410258, 0.11443157, 0.048126943, 0.17386216, -0.09785154, 0.14995028, 0.093302995, 0.09777354, 0.016656177, -0.16498508, -0.16739717, 0.11313578, 0.001371565, -0.031823646, -0.02444281, 0.13747996) * go_1(0.0, 1.0);
|
||||
result += mat4(0.023110714, -0.04154956, -0.030491728, -0.4158937, -0.007988987, 0.0035799788, 0.16974539, -0.014700064, -0.017114861, -0.018651277, 0.00242705, -0.011389802, -0.17292719, -0.03441201, 0.057909735, 0.17829509) * go_1(1.0, -1.0);
|
||||
result += mat4(0.014969421, 0.21926679, 0.14203273, -0.15120554, -0.094369836, 0.083293505, -0.080706924, 0.16517772, -0.053518526, 0.11042086, 0.02499214, -0.05298825, -0.017418144, -0.024013298, -0.07151083, -0.22398451) * go_1(1.0, 0.0);
|
||||
result += mat4(0.052312143, -0.09576563, -0.073171586, 0.13949135, -0.019157652, -0.019879084, 0.083495006, -0.14749153, 0.05605271, -0.07413262, -0.09352249, 0.0042679785, -0.069604576, -0.16840592, 0.103903025, 0.2889917) * go_1(1.0, 1.0);
|
||||
result += mat4(0.059331086, -0.033961378, 0.0041064387, -0.08705166, 0.051230803, -0.018020583, -0.12681223, -0.23725896, 0.059449084, -0.052372735, -0.05540911, 0.10343921, 0.024327401, 0.012832041, -0.022239655, -0.13162766) * go_2(-1.0, -1.0);
|
||||
result += mat4(-0.00208763, 0.06829585, -0.050976753, -0.05621949, -0.005976271, 0.009429676, -0.04865572, -0.09551031, -0.075597085, -0.026020885, 0.03421109, -0.1937313, -0.22840965, -0.15389588, -0.111958645, 0.10905485) * go_2(-1.0, 0.0);
|
||||
result += mat4(0.081813, -0.065287165, -0.045189142, -0.047831066, 0.08934535, 0.09954615, -0.07451004, 0.033529207, 0.1303318, -0.08212296, -0.07734046, -0.014592582, -0.3092255, 0.045021445, -0.1223635, -0.026269957) * go_2(-1.0, 1.0);
|
||||
result += mat4(-0.113570146, 0.036414642, 0.015502351, 0.15432163, 0.008468439, -0.029858474, 0.03321966, -0.14513937, 0.105439186, 0.17247854, -0.040744863, -0.054444846, -0.121361785, 0.04879374, -0.23203504, 0.0054753935) * go_2(0.0, -1.0);
|
||||
result += mat4(-0.015762426, 0.27844664, -0.023570599, 0.004403549, 0.04703402, 0.11293326, -0.22021124, -0.022294452, 0.0109151825, 0.051353704, 0.01387703, -0.25460902, -0.1720017, -0.41253135, 0.13271171, 0.24472673) * go_2(0.0, 0.0);
|
||||
result += mat4(-0.06729634, -0.08928969, 0.044666067, -0.080033734, -0.010024118, 0.09617992, -0.03422752, -0.24341615, 0.0026236945, -0.17291804, -0.18756893, -0.011092629, -0.0758896, -0.11379615, 0.2614097, 0.2968493) * go_2(0.0, 1.0);
|
||||
result += mat4(0.037218813, -0.08741755, -0.047161646, -0.075184174, 0.07814149, -0.117306635, 0.27880162, -0.20831196, 0.11074332, 0.007141896, -0.061060436, -0.07465655, -0.06771369, 0.08425538, -0.13826483, 0.1951752) * go_2(1.0, -1.0);
|
||||
result += mat4(-0.09369145, 0.05128452, -0.0045741517, -0.08464627, 0.072324485, -0.103766605, 0.04346825, -0.084247194, 0.18332602, 0.24476874, -0.23600607, -0.105699316, 0.0018734589, -0.22071646, 0.2122217, -0.1247409) * go_2(1.0, 0.0);
|
||||
result += mat4(0.024415143, -0.1883563, -0.08757719, 0.038815416, 0.06804177, 0.072834484, 0.062976, -0.043060035, 0.008934872, -0.065206386, -0.02180933, 0.18650985, 0.15305461, -0.043311838, -0.13565755, -0.15254296) * go_2(1.0, 1.0);
|
||||
result += mat4(0.027255, 0.13145106, 0.08066033, 0.05240541, -0.093578346, -0.043811, -0.03499714, 0.08510107, -0.01451532, 0.20293784, -0.15014489, 0.010262514, -0.05686128, -0.032981467, 0.009303513, -0.14119668) * go_3(-1.0, -1.0);
|
||||
result += mat4(0.056040764, 0.1030456, 0.19483311, -0.035117295, -0.045012027, 0.036512565, -0.073540024, 0.07976307, 0.048326198, -0.08448881, 0.009611186, 0.21209192, 0.058837466, 0.21072935, -0.18430287, -0.022488063) * go_3(-1.0, 0.0);
|
||||
result += mat4(-0.047507305, -0.0024985473, 0.16436942, 0.11034998, -0.07350365, -0.04659239, 0.055649634, -0.24239732, 0.0874119, 0.0491421, -0.20165893, -0.16950199, -0.06907221, -0.02995977, -0.076965876, -0.019354858) * go_3(-1.0, 1.0);
|
||||
result += mat4(0.16029131, 0.13571973, -0.0066582616, -0.12420045, 0.09299235, 0.10025083, 0.17720564, 0.09894699, 0.25251085, -0.06967862, 0.09031549, 0.014147361, 0.10027847, -0.1572137, 0.075934134, 0.041270934) * go_3(0.0, -1.0);
|
||||
result += mat4(-0.05063072, -0.049268696, -0.018284608, -0.13692653, -0.20619605, -0.3068155, 0.17608485, 0.09949, 0.28783736, -0.22305936, 0.12421118, 0.22138284, -0.14137621, -0.033278886, -0.08361161, -0.030769518) * go_3(0.0, 0.0);
|
||||
result += mat4(0.108629055, 0.0015808924, 0.20601004, -0.026752226, -0.1501807, 0.029018851, 0.21033502, -0.027005566, 0.0030185424, 0.23096606, 0.03001235, -0.37719792, -0.015479773, 0.3498214, -0.25188166, -0.09796651) * go_3(0.0, 1.0);
|
||||
result += mat4(-0.17263511, 0.09929037, -0.057462707, 0.03969186, -0.09580756, -0.02628204, -0.18671957, -0.114821374, -0.032703403, -0.04550097, -0.17387073, -0.06422339, 0.029069535, 0.077399485, -0.09688172, -0.04977373) * go_3(1.0, -1.0);
|
||||
result += mat4(-0.08245095, 0.025046779, 0.15254857, -0.20083354, -0.21334353, 0.13298917, 0.019746812, 0.037977856, -0.18857501, 0.16555329, 0.08286123, -0.07782444, 0.01507326, 0.11679941, 0.029952176, 0.20679134) * go_3(1.0, 0.0);
|
||||
result += mat4(-0.08486794, 0.010211643, 0.22983155, -0.16577461, -0.12877122, 0.0017102316, -0.079031415, -0.08309121, -0.062880024, 0.17439415, 0.2649001, -0.46177015, 0.08025148, -0.06425451, 0.028244738, -0.047507387) * go_3(1.0, 1.0);
|
||||
result += vec4(-0.031883862, -0.0151373055, -0.026020631, 0.062551804);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v4.0-Restore-CNN-(L)-Conv-3x3x3x16
|
||||
//!HOOK MAIN
|
||||
//!BIND MAIN
|
||||
//!BIND conv2d_3_tf
|
||||
//!BIND conv2d_3_tf1
|
||||
//!SAVE MAIN
|
||||
//!WIDTH conv2d_3_tf.w
|
||||
//!HEIGHT conv2d_3_tf.h
|
||||
#define go_0(x_off, y_off) (max((conv2d_3_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max((conv2d_3_tf1_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_2(x_off, y_off) (max(-(conv2d_3_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_3(x_off, y_off) (max(-(conv2d_3_tf1_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(0.012102164, 0.01385959, 0.018815203, 0.0, -0.017435113, -0.04530735, -0.051318135, 0.0, 0.01267727, 0.01400136, 0.017735276, 0.0, 0.012681183, 0.035241637, 0.03990959, 0.0) * go_0(-1.0, -1.0);
|
||||
result += mat4(0.16069227, 0.098007366, 0.076831706, 0.0, 0.081593364, 0.017831434, 0.010174303, 0.0, 0.014732323, 0.02229113, 0.029828338, 0.0, 0.0048171813, 0.051809076, 0.055740006, 0.0) * go_0(-1.0, 0.0);
|
||||
result += mat4(0.0347963, -0.014327445, -0.024176419, 0.0, 0.003463003, -0.050532356, -0.06565927, 0.0, 0.082851514, 0.10950989, 0.12022889, 0.0, -0.038950548, -0.015094648, -0.0119305095, 0.0) * go_0(-1.0, 1.0);
|
||||
result += mat4(-0.11845135, -0.08067485, -0.06981454, 0.0, 0.00058037776, 0.01160575, 0.014900963, 0.0, -0.0374349, -0.052966926, -0.044557698, 0.0, 0.017439643, 0.005496974, -0.0024181441, 0.0) * go_0(0.0, -1.0);
|
||||
result += mat4(-0.1084345, -0.18271221, -0.18795776, 0.0, 0.110637866, 0.08913364, 0.09161146, 0.0, -0.19889367, -0.17172937, -0.1600661, 0.0, -0.03789556, -0.028977778, -0.029903485, 0.0) * go_0(0.0, 0.0);
|
||||
result += mat4(0.017774954, -0.048732057, -0.061161697, 0.0, 0.022389695, -0.013317256, -0.019972157, 0.0, 0.051979035, 0.08774837, 0.09633588, 0.0, -0.047462203, -0.033091765, -0.028352588, 0.0) * go_0(0.0, 1.0);
|
||||
result += mat4(0.022178177, 0.05031684, 0.05802219, 0.0, -0.027539665, -0.020904189, -0.01800042, 0.0, 0.0019531948, 0.00019749763, -0.0013961957, 0.0, 0.024253767, -0.00058503833, 0.0006474611, 0.0) * go_0(1.0, -1.0);
|
||||
result += mat4(0.06707921, 0.0817431, 0.07561426, 0.0, -0.04157211, -0.006174012, -0.003754037, 0.0, 0.0031168605, 0.02320992, 0.026471246, 0.0, 0.0029530525, -0.004939263, -0.0070194793, 0.0) * go_0(1.0, 0.0);
|
||||
result += mat4(0.03383418, 0.042321067, 0.04266926, 0.0, -0.043634403, -0.0182769, -0.011314871, 0.0, -0.050008457, -0.003527757, 0.0035165092, 0.0, -0.00016610099, 0.019936454, 0.022199173, 0.0) * go_0(1.0, 1.0);
|
||||
result += mat4(-0.055203374, -0.03910439, -0.03778927, 0.0, 0.027640847, 0.019469904, 0.0277834, 0.0, -0.026225597, 0.04481541, 0.047454204, 0.0, 0.031545334, 0.019874612, 0.011878432, 0.0) * go_1(-1.0, -1.0);
|
||||
result += mat4(0.016088601, -0.045959134, -0.048793618, 0.0, -0.009834776, 0.0077799167, 0.00873151, 0.0, 0.031265914, 0.09698676, 0.10005417, 0.0, 0.039120086, 0.0005542848, -0.0049420255, 0.0) * go_1(-1.0, 0.0);
|
||||
result += mat4(0.028432969, -0.014792921, -0.026881924, 0.0, -0.00586326, 0.013427183, 0.018215714, 0.0, -0.013559131, 0.017704675, 0.024854776, 0.0, -0.09087544, -0.104627624, -0.0921747, 0.0) * go_1(-1.0, 1.0);
|
||||
result += mat4(-0.022899037, 0.026374351, 0.03145993, 0.0, -0.008008749, -0.0013132087, -0.003957525, 0.0, -0.02490554, 0.0020362549, 0.006453752, 0.0, 0.031494617, 0.049864545, 0.04702567, 0.0) * go_1(0.0, -1.0);
|
||||
result += mat4(-0.12318068, -0.121377476, -0.11615006, 0.0, -0.1321696, -0.078085914, -0.07868927, 0.0, -0.072339885, 0.0012095685, 0.010923645, 0.0, 0.10844834, 0.10038668, 0.09919817, 0.0) * go_1(0.0, 0.0);
|
||||
result += mat4(0.058991943, 0.018824834, 0.01659209, 0.0, -0.041878223, 0.013176531, 0.023566704, 0.0, -0.010507848, 0.02042605, 0.028884022, 0.0, -0.1193022, -0.10676289, -0.096668206, 0.0) * go_1(0.0, 1.0);
|
||||
result += mat4(0.023510003, 0.06057355, 0.052194174, 0.0, 0.02304783, 0.031745855, 0.025863871, 0.0, -0.01060811, -0.043136407, -0.03569961, 0.0, -0.022243036, 0.014206766, 0.0032128936, 0.0) * go_1(1.0, -1.0);
|
||||
result += mat4(0.025120225, 0.07386707, 0.07916389, 0.0, -0.020202598, 0.010854587, 0.009825397, 0.0, -0.043466344, -0.049230598, -0.038344223, 0.0, 0.006438127, 0.041072655, 0.036958262, 0.0) * go_1(1.0, 0.0);
|
||||
result += mat4(0.027640026, 0.04239058, 0.055017423, 0.0, -0.002110394, 0.040088017, 0.045239322, 0.0, -0.020238828, -0.01711292, -0.014726791, 0.0, -0.029621653, -0.007380026, -0.002073584, 0.0) * go_1(1.0, 1.0);
|
||||
result += mat4(0.008071638, 0.0034274645, -0.0016181463, 0.0, 0.044838928, 0.06936641, 0.072150804, 0.0, 0.0006324625, -0.02223834, -0.021122342, 0.0, 0.043963037, 0.047561962, 0.026419055, 0.0) * go_2(-1.0, -1.0);
|
||||
result += mat4(-0.06605246, -0.011649812, -0.0022502556, 0.0, -0.09256232, -0.06281528, -0.055003755, 0.0, 0.032296494, -0.011113339, -0.015790787, 0.0, 0.05214882, 0.022887057, 0.013746634, 0.0) * go_2(-1.0, 0.0);
|
||||
result += mat4(-0.03587372, 0.018986767, 0.03229596, 0.0, 0.008917248, 0.050303612, 0.06147115, 0.0, 0.01872278, -0.011048741, -0.017369485, 0.0, 0.030770298, 0.0063107815, 0.003187433, 0.0) * go_2(-1.0, 1.0);
|
||||
result += mat4(0.087662674, 0.048391398, 0.042332277, 0.0, 0.0043635606, 0.02438183, 0.020213395, 0.0, -0.023863237, -0.0051179314, -0.0060627074, 0.0, 0.06292237, 0.05821987, 0.051667042, 0.0) * go_2(0.0, -1.0);
|
||||
result += mat4(-0.048478693, 0.008368922, 0.016874269, 0.0, -0.19261299, -0.1848583, -0.18258469, 0.0, 0.112302095, 0.061518673, 0.058282077, 0.0, 0.024626324, 0.0058449907, 0.006936535, 0.0) * go_2(0.0, 0.0);
|
||||
result += mat4(-0.04468695, 0.0099176075, 0.025094027, 0.0, 0.05447911, 0.08220857, 0.08161316, 0.0, -0.0007933787, -0.03090106, -0.040217776, 0.0, -0.028044306, -0.050590593, -0.05027328, 0.0) * go_2(0.0, 1.0);
|
||||
result += mat4(0.029733973, -0.0129855955, -0.019776886, 0.0, 0.01860655, 0.017793713, 0.020113358, 0.0, -0.023667783, -0.0013290358, -0.004159268, 0.0, -0.01960303, -0.012806444, -0.016549494, 0.0) * go_2(1.0, -1.0);
|
||||
result += mat4(-0.00952229, -0.007181503, -0.0061082463, 0.0, 0.04292393, 0.01510459, 0.0062862537, 0.0, -0.016540393, -0.023619318, -0.02633423, 0.0, -0.06652295, -0.06933143, -0.063913494, 0.0) * go_2(1.0, 0.0);
|
||||
result += mat4(-0.015281855, -0.012470513, -0.008184894, 0.0, 0.045862548, 0.023707546, 0.014719574, 0.0, 0.032412887, -0.0038218168, -0.0065955487, 0.0, -0.027728679, -0.04009727, -0.018856067, 0.0) * go_2(1.0, 1.0);
|
||||
result += mat4(0.042844415, 0.00673587, 0.0038338478, 0.0, -0.031152235, -0.06649269, -0.065986395, 0.0, 0.005666899, -0.015819343, -0.012795757, 0.0, -0.0007617308, 0.021531299, 0.026071105, 0.0) * go_3(-1.0, -1.0);
|
||||
result += mat4(-0.118266046, -0.07211513, -0.058381762, 0.0, 0.02361942, 0.012819485, 0.010511434, 0.0, 0.077196896, 0.003424893, 0.001927401, 0.0, -0.03160996, -0.0034473129, -0.00444674, 0.0) * go_3(-1.0, 0.0);
|
||||
result += mat4(-0.06548674, -0.018152835, 0.0034779215, 0.0, -0.006173449, 0.008357867, -0.0033986098, 0.0, 0.021622533, -0.03722321, -0.045832597, 0.0, -0.011835129, 0.0109178, 0.010480887, 0.0) * go_3(-1.0, 1.0);
|
||||
result += mat4(0.041682176, -0.008985459, -0.018538723, 0.0, -0.054624356, -0.09495616, -0.090484254, 0.0, -0.0060466817, -0.017551763, -0.014151624, 0.0, -0.015683241, -0.012590141, -0.014278323, 0.0) * go_3(0.0, -1.0);
|
||||
result += mat4(0.073194094, 0.055347454, 0.060976587, 0.0, 0.18175459, 0.13776664, 0.13139476, 0.0, 0.14047755, 0.061971992, 0.056503728, 0.0, 0.0068531767, -0.011873265, -0.016871026, 0.0) * go_3(0.0, 0.0);
|
||||
result += mat4(-0.041848205, -0.009582, -0.0076929387, 0.0, 0.044274334, 0.04011985, 0.03085897, 0.0, 0.009403278, -0.03346772, -0.04463548, 0.0, 0.04548978, 0.014613167, 0.0055232802, 0.0) * go_3(0.0, 1.0);
|
||||
result += mat4(0.019901669, -0.0011372451, -0.007423424, 0.0, -0.053240675, -0.07105105, -0.07122227, 0.0, -0.01892976, -0.019795185, -0.019204788, 0.0, 0.01228504, -0.005040437, -0.0010069044, 0.0) * go_3(1.0, -1.0);
|
||||
result += mat4(0.032843515, 0.014947385, 0.007550199, 0.0, -0.0006476342, -0.020907652, -0.030297596, 0.0, -0.015617971, -0.029182931, -0.038677275, 0.0, 0.037908908, -0.018132487, -0.020226713, 0.0) * go_3(1.0, 0.0);
|
||||
result += mat4(0.03232915, 0.02915194, 0.014929652, 0.0, 0.016676396, 0.004807404, -0.0008906752, 0.0, 0.0076904814, 0.00541351, -0.0048240838, 0.0, 0.03459369, -0.012969539, -0.024712864, 0.0) * go_3(1.0, 1.0);
|
||||
result += vec4(-0.0096404655, 0.0022038757, 0.0035988842, 0.0);
|
||||
return result + MAIN_tex(MAIN_pos);
|
||||
}
|
275
mpv/shaders-old/Anime4K_Restore_CNN_M.glsl
Executable file
275
mpv/shaders-old/Anime4K_Restore_CNN_M.glsl
Executable file
|
@ -0,0 +1,275 @@
|
|||
// MIT License
|
||||
|
||||
// Copyright (c) 2019-2021 bloc97
|
||||
// All rights reserved.
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
//!DESC Anime4K-v4.0-Restore-CNN-(M)-Conv-4x3x3x3
|
||||
//!HOOK MAIN
|
||||
//!BIND MAIN
|
||||
//!SAVE conv2d_tf
|
||||
//!WIDTH MAIN.w
|
||||
//!HEIGHT MAIN.h
|
||||
//!COMPONENTS 4
|
||||
#define go_0(x_off, y_off) (MAIN_texOff(vec2(x_off, y_off)))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.09991986, 0.13782342, -0.031251684, -0.06356843, -0.3437488, 0.05450952, 0.34347802, 0.46335372, 0.08607224, 0.044988394, 0.137179, 0.17976908, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, -1.0);
|
||||
result += mat4(-0.024212424, -0.09278509, -0.00040907756, 0.34552294, -0.13254678, 0.113105185, 0.005667946, -0.00036919137, -0.06375679, 0.009184115, 0.115518734, -0.115506776, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, 0.0);
|
||||
result += mat4(-0.14101827, 0.023523493, 0.044094566, -0.019271746, -0.44348842, -0.08818877, -0.4026149, -0.21995795, -0.15880394, -0.013732858, -0.020751135, 0.012719151, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, 1.0);
|
||||
result += mat4(0.013001821, -0.34503505, 0.39219138, 0.18792126, 0.24760444, -0.016173402, 0.10154511, 0.15453082, -0.058132876, 0.016784398, -0.05808539, -0.11039915, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, -1.0);
|
||||
result += mat4(0.37024534, 0.041440863, -0.3374568, -0.44994286, 0.19555596, 0.20855539, -0.27974075, -0.5372628, 0.21228147, -0.0295346, -0.56700057, 0.030042822, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, 0.0);
|
||||
result += mat4(-0.12940632, 0.057526, 0.090682045, -0.06985033, -0.13704006, -0.047685407, 0.44615674, -0.48056605, -0.06166251, -0.01883519, 0.2032237, -0.113287605, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, 1.0);
|
||||
result += mat4(0.010856669, -0.35820737, 0.16757219, 0.082619876, -0.03967303, 0.038705572, 0.32652855, -0.012030017, 0.015120559, -0.15314877, 0.23442009, 0.09767922, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, -1.0);
|
||||
result += mat4(-0.046272673, -0.17752305, 0.082018286, -0.2512824, 0.58619463, -0.060903464, -0.022793597, 0.077803515, -0.17025311, 0.05136993, 0.029383298, -0.15475409, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, 0.0);
|
||||
result += mat4(-0.11212024, 0.13378005, -0.2027488, 0.08056421, -0.11176219, -0.048429377, -0.08396386, 0.10507829, 0.13326839, 0.0430627, 0.051362377, 0.06482755, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, 1.0);
|
||||
result += vec4(-0.061233472, 0.39222646, 0.029704979, 0.02586828);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v4.0-Restore-CNN-(M)-Conv-4x3x3x8
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_tf
|
||||
//!SAVE conv2d_1_tf
|
||||
//!WIDTH conv2d_tf.w
|
||||
//!HEIGHT conv2d_tf.h
|
||||
//!COMPONENTS 4
|
||||
#define go_0(x_off, y_off) (max((conv2d_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max(-(conv2d_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.16410656, -0.40521824, 0.13121907, -0.02314597, 0.105412476, -0.060401272, -0.043063477, -0.13933973, 0.12558138, -0.020861467, 0.030370515, 0.13178016, -0.14220351, 0.20736893, 0.003321564, -0.29241714) * go_0(-1.0, -1.0);
|
||||
result += mat4(0.18517321, 0.29162985, -0.26783395, 0.039760686, 0.025527012, -0.067319244, 0.055004176, 0.048916563, 0.12750523, -0.091435954, 0.13818842, 0.36704224, 0.0839921, 0.10186618, -0.17237376, 0.13282418) * go_0(-1.0, 0.0);
|
||||
result += mat4(-0.1657887, 0.0131325135, -0.17222486, 0.091398895, -0.12756164, -0.08437298, -0.29052997, 0.3269337, 0.15870757, -0.013529402, -0.0581753, 0.11802371, 0.07099966, -0.024063632, 0.31834844, -0.11183859) * go_0(-1.0, 1.0);
|
||||
result += mat4(0.46036887, -0.07654623, 0.22923063, 0.17463821, 0.10555414, -0.117430426, 0.12406777, -0.011399492, 0.028316498, 0.13684341, 0.009664087, 0.2022659, 0.04953974, -0.31342217, -0.6103131, -0.13605757) * go_0(0.0, -1.0);
|
||||
result += mat4(0.03406955, -0.39819366, 0.61176, -0.46809456, -0.029321073, 0.46619493, 0.36700186, 0.02288561, 0.11464085, -0.10931452, -0.09154022, 0.07334147, -0.5609916, 0.31826234, -0.011012659, -0.46719545) * go_0(0.0, 0.0);
|
||||
result += mat4(-0.056855045, 0.27037027, -0.09269696, -0.563572, -0.06816116, -0.22986612, 0.08693167, -0.16246101, 0.09954046, -0.05374176, 0.0071916827, -0.1788692, 0.3825241, -0.1609887, 0.055204768, 0.10213068) * go_0(0.0, 1.0);
|
||||
result += mat4(0.0646626, 0.102358796, -0.45055822, 0.20557903, -0.23337309, 0.12633002, -0.19299199, -0.15085731, -0.13473304, 0.053790465, -0.10061193, -0.13393497, -0.04264752, -0.029740738, -0.07865285, 0.20883279) * go_0(1.0, -1.0);
|
||||
result += mat4(0.010471527, -0.033218473, -0.46157447, 0.004866583, 0.23226471, -0.059343327, -0.1439596, 0.13619648, 0.013839963, 0.15930325, 0.043742355, 0.17467323, 0.33772305, 0.40261495, -0.08351293, 0.18129359) * go_0(1.0, 0.0);
|
||||
result += mat4(-0.12493434, -0.1875134, -0.074943796, -0.0031701606, -0.037142616, 0.1667002, 0.16665547, -0.011248127, 0.0071619414, 0.0034872112, 0.120318964, -0.09625579, 0.14917047, -0.16310586, 0.07231737, 0.30447328) * go_0(1.0, 1.0);
|
||||
result += mat4(0.093798615, 0.17074613, -0.08780678, -0.012520207, 0.118534856, 0.027508778, -0.2778478, -0.19509242, -0.34137097, 0.32000312, -0.22027159, 0.337515, 0.16220862, 0.108993016, 0.14070526, 0.12784284) * go_1(-1.0, -1.0);
|
||||
result += mat4(-0.14325632, -0.1467453, -0.27502358, 0.09370837, 0.11821083, -0.012266484, -0.2100548, 0.4707502, -0.06766648, 0.58165014, -0.2512279, -0.33783755, 0.1318925, -0.04346277, 0.15454485, 0.044500057) * go_1(-1.0, 0.0);
|
||||
result += mat4(-0.05683207, 0.0051946463, -0.108000524, 0.10133204, -0.50763863, 0.007308442, 0.8542404, 0.28387356, 0.022709515, 0.294523, -0.3822472, 0.66166407, 0.01404485, 0.031282708, -0.26756814, -0.123147786) * go_1(-1.0, 1.0);
|
||||
result += mat4(-0.36455178, 0.3470555, -0.045303088, -0.03170764, -0.15802494, -0.0019141496, -0.25939587, -0.23875342, 0.130428, 0.03954273, -0.17985536, 0.105145946, 0.15804817, 0.12551713, 0.28371975, -0.085748516) * go_1(0.0, -1.0);
|
||||
result += mat4(0.0060625463, 0.2443924, -0.017692259, -0.20214005, -0.09584515, -0.012805372, -0.13942227, 0.16143198, 0.12942013, 0.41785547, 0.046071563, 0.7030026, 0.10499644, -0.20566013, -0.031321276, 0.27830327) * go_1(0.0, 0.0);
|
||||
result += mat4(-0.081274964, -0.14562319, 0.27200526, -0.20491314, 0.012910989, 0.024201397, 0.04816258, 0.21297328, -0.22015952, -0.44160756, -0.056035373, 0.33824417, -0.31645304, 0.15469243, 0.053187452, -0.20989445) * go_1(0.0, 1.0);
|
||||
result += mat4(-0.046550367, 0.033185404, 0.33337244, 0.12853645, 0.23520172, -0.05909214, 0.0861368, 0.10706329, -0.07058717, -0.11759937, -0.18594047, 0.080006264, -0.055425353, -0.12506317, 0.15729053, -0.0915004) * go_1(1.0, -1.0);
|
||||
result += mat4(0.042516407, 0.14844789, 0.16533111, 0.13502933, -0.0655417, -0.057256397, 0.076713726, -0.23448966, 0.12855926, 0.014219275, 0.051761385, 0.053433083, -0.2446715, -0.4008074, 0.19603717, -0.1796951) * go_1(1.0, 0.0);
|
||||
result += mat4(0.14777803, 0.15524907, 0.043158617, -0.06996876, 0.19210646, -0.2144364, -0.47020787, -0.4207906, -0.18074386, -0.2163903, 0.0030754965, 0.36799973, -0.3837698, -0.0022661497, -0.37276733, -0.28934997) * go_1(1.0, 1.0);
|
||||
result += vec4(-0.018297346, -0.080951825, -0.062163066, -0.08050014);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v4.0-Restore-CNN-(M)-Conv-4x3x3x8
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_1_tf
|
||||
//!SAVE conv2d_2_tf
|
||||
//!WIDTH conv2d_1_tf.w
|
||||
//!HEIGHT conv2d_1_tf.h
|
||||
//!COMPONENTS 4
|
||||
#define go_0(x_off, y_off) (max((conv2d_1_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max(-(conv2d_1_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(0.31543177, 0.23095237, -0.06692611, -0.5867763, 0.003622504, 0.17948842, -0.14627707, 0.1745016, -0.052964583, -0.15551159, 0.05644786, -0.012665164, 0.13107763, 0.11369179, -0.09452995, -0.11973403) * go_0(-1.0, -1.0);
|
||||
result += mat4(-0.2694661, -0.115382135, 0.3073268, -0.067228466, -0.25511482, -0.13922207, 0.36758214, -0.18821828, -0.022617863, 0.20333402, -0.11125889, 0.3552245, -0.013346653, -0.099095374, -0.25100616, 0.35521755) * go_0(-1.0, 0.0);
|
||||
result += mat4(0.011012409, -0.13675085, 0.25642, -0.34851208, -0.23184675, 0.18012202, 0.57654136, 0.103173524, -0.16461405, 0.038177088, 0.1234096, 0.013202029, -0.19033363, 0.07469178, -0.017948546, 0.15287702) * go_0(-1.0, 1.0);
|
||||
result += mat4(-0.05340533, 0.23797482, 0.20351392, -0.05333351, -0.12181174, -0.23363493, -0.20696607, 0.109941036, -0.11519453, 0.13842066, -0.10687832, 0.29040006, 0.022218632, 0.031238724, 0.2685182, 0.15300068) * go_0(0.0, -1.0);
|
||||
result += mat4(0.22985318, -0.3103802, -0.22916415, 0.25238806, -0.11690287, -0.1947488, 0.118020535, 0.07814263, -0.06335474, -0.007870727, 0.076106325, 0.094677486, -0.16776285, -0.006570437, -0.29589584, 0.41413507) * go_0(0.0, 0.0);
|
||||
result += mat4(0.43607962, -0.36456433, -0.123776875, -0.16634953, -0.091190875, 0.13035081, 0.28627968, 0.27249968, 0.12356344, -0.008616177, 0.09599816, -0.006144557, -0.23490307, 0.3013123, 0.14153156, 0.21837278) * go_0(0.0, 1.0);
|
||||
result += mat4(0.060364585, 0.37860224, 0.039182413, -0.22805426, -0.089910224, -0.06817697, -0.2684275, -0.12528503, 0.036934495, -0.07826616, 0.06559976, -0.08253646, 0.13489649, 0.06237663, 0.126376, 0.21194184) * go_0(1.0, -1.0);
|
||||
result += mat4(-0.12534817, 0.21225189, -0.27818045, -0.3070443, -0.006957577, -0.025105853, 0.12100924, -0.06916452, 0.23081483, 0.1802756, -0.18995638, 0.16603014, -0.2904096, -0.25292823, -0.21834068, 0.13719653) * go_0(1.0, 0.0);
|
||||
result += mat4(0.017209655, 0.10757137, 0.21414296, -0.30885983, 0.10467716, -0.2184891, 0.100061476, -0.1527528, 0.2100472, -0.25768545, -0.22329919, -0.29153427, -0.06983842, -0.103854865, -0.051384352, 0.14629121) * go_0(1.0, 1.0);
|
||||
result += mat4(0.0059623295, -0.26060802, 0.32115817, 0.021025505, 0.09783085, -0.15865178, 0.1473021, -0.24977303, -0.033508282, 0.17480391, -0.091310136, 0.09870876, 0.10504043, -0.06105686, 0.013493489, -0.11278855) * go_1(-1.0, -1.0);
|
||||
result += mat4(0.14875248, -0.14859414, 0.19377062, -0.17456068, 0.101288855, -0.1113682, -0.48944646, 0.1018565, -0.037392337, 0.08539691, 0.1751306, -0.15428723, -0.059375558, 0.027663672, 0.051804014, -0.049813222) * go_1(-1.0, 0.0);
|
||||
result += mat4(0.118846565, -0.19869871, -0.037388258, 0.08456728, -0.11662527, -0.43818352, -0.093285345, 0.038507205, -0.051991668, 0.21008292, 0.10792365, 0.2020924, 0.057021596, 0.09460527, 0.0016551288, -0.0015957063) * go_1(-1.0, 1.0);
|
||||
result += mat4(0.11062174, -0.2639232, -0.060295466, -0.3217331, -0.050545212, 0.30989558, 0.30906132, 0.030323273, 0.028986752, 0.037429404, 0.20855664, -0.19848943, 0.034687653, -0.09599135, -0.06250494, -0.13215867) * go_1(0.0, -1.0);
|
||||
result += mat4(-0.010391146, 0.07657845, 0.44491258, 0.0435906, 0.0075931503, 0.42632654, 0.47022533, 0.34737435, -0.15452717, -0.14613411, -0.45231065, 0.12094409, 0.0067911847, 0.057501152, 0.09876979, 0.044946447) * go_1(0.0, 0.0);
|
||||
result += mat4(-0.15607435, 0.2293058, -0.09520331, 0.012836732, -0.15282455, 0.26437718, -0.1685477, -0.13211122, -0.055801593, -0.016778728, -0.34478986, -0.23228309, 0.12300962, -0.13235827, -0.13987203, -0.16550972) * go_1(0.0, 1.0);
|
||||
result += mat4(0.13161735, -0.09039346, -0.033475474, -0.23686698, 0.1514885, 0.20977421, 0.031431954, -0.0049226107, 0.090661936, 0.15288061, -0.03316583, 0.09646573, -0.32651708, 0.18825398, -0.15777239, 0.17572704) * go_1(1.0, -1.0);
|
||||
result += mat4(0.112157226, -0.08712878, 0.23453182, 0.1043877, -0.14686783, 0.28682423, -0.086443506, 0.059457052, -0.31530112, -0.2700583, -0.06028952, -0.070416875, 0.18053482, 0.16653341, 0.25215197, 0.061915852) * go_1(1.0, 0.0);
|
||||
result += mat4(-0.20122242, 0.076313145, -0.0988483, 0.094337784, -0.35436687, 0.3762327, -0.07809558, 0.3055848, 0.10425242, -0.17087407, 0.030301496, -0.13911743, 0.01630275, 0.24247427, -0.006474477, 0.03842641) * go_1(1.0, 1.0);
|
||||
result += vec4(-0.008952847, -0.0058945753, -0.08097229, 0.020968592);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v4.0-Restore-CNN-(M)-Conv-4x3x3x8
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_2_tf
|
||||
//!SAVE conv2d_3_tf
|
||||
//!WIDTH conv2d_2_tf.w
|
||||
//!HEIGHT conv2d_2_tf.h
|
||||
//!COMPONENTS 4
|
||||
#define go_0(x_off, y_off) (max((conv2d_2_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max(-(conv2d_2_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.2237721, -0.0064096362, -0.31808427, 0.73477733, 0.015353088, 0.23983319, 0.14967978, -0.34920225, -0.07456269, 0.093151815, -0.14331086, -0.24586205, -0.14183366, 0.06401045, -0.22044073, 0.29932275) * go_0(-1.0, -1.0);
|
||||
result += mat4(-0.07968509, -0.3349146, 0.16529128, 0.08443499, 0.4095855, -0.17120704, 0.17425705, 0.15298946, 0.2981273, 0.2212369, 0.10392389, -0.28775454, -0.065247655, -0.15255849, 0.13094437, 0.18685219) * go_0(-1.0, 0.0);
|
||||
result += mat4(0.015706737, -0.17755036, 0.2622526, 0.112057306, -0.15876788, -0.38466996, -0.33700845, -0.031711742, -0.023320962, -0.3145249, -0.21223734, -0.1314596, -0.1888095, -0.046370104, 0.09000896, -0.0046378844) * go_0(-1.0, 1.0);
|
||||
result += mat4(-0.31127506, 0.31304324, -0.03965752, 0.03649018, -0.029851055, 0.05801377, 0.00040150844, -0.04422069, 0.18019931, 0.14415511, -0.09845236, 0.21895434, -0.013932474, -0.046454947, -0.3403935, -0.006705289) * go_0(0.0, -1.0);
|
||||
result += mat4(-0.34878647, -0.5129283, 0.060250953, -0.16354133, 0.20644619, 0.08732273, -0.24118888, 0.24455065, 0.24449423, 0.44103387, 0.22455928, 0.25738943, -0.26914698, -0.21309987, 0.08386486, 0.021484816) * go_0(0.0, 0.0);
|
||||
result += mat4(-0.057454903, -0.4121922, 0.022661546, 0.37178272, 0.03331408, 0.05044008, 0.04324371, 0.20727943, 0.2432641, 0.076906696, -0.20858039, 0.012439015, -0.19335061, 0.09217451, 0.1968369, -0.19435833) * go_0(0.0, 1.0);
|
||||
result += mat4(-0.16960496, 0.24616167, 0.37977478, 0.14324574, -0.011531225, -0.11312143, -0.18141079, -0.23843932, 0.0086012175, -0.3564491, -0.12639481, 0.009799298, -0.29120612, 0.23756824, 0.18035695, -0.087133996) * go_0(1.0, -1.0);
|
||||
result += mat4(-0.10081239, 0.29191494, 0.10434693, 0.08970636, 0.008997759, 0.104756236, 0.039641086, 0.02323888, -0.11627765, 0.023693223, -0.30801758, -0.120208986, 0.05086147, 0.18498175, 0.15595439, -0.09877306) * go_0(1.0, 0.0);
|
||||
result += mat4(0.101321675, -0.2929976, 0.38810417, 0.5605376, -0.04073937, 0.030110704, -0.18147062, -0.09833952, 0.01927733, 0.15335669, -0.15384074, -0.110595055, -0.054297395, -0.077522054, 0.07918369, -0.068480626) * go_0(1.0, 1.0);
|
||||
result += mat4(0.23263514, -0.11719232, 0.2903209, -0.007503795, -0.020222448, -0.17790157, -0.15600762, -0.08741775, 0.12529704, 0.25548857, -0.04585447, -0.10255033, 0.18350503, -0.29593533, 0.0868933, 0.027004737) * go_1(-1.0, -1.0);
|
||||
result += mat4(-0.14958654, -0.006238835, -0.2928948, 0.1988557, -0.17057803, 0.12524141, 0.13978264, -0.019280292, 0.05967142, -0.07790818, -0.5893818, -0.022845713, -0.08596779, 0.07875358, -0.03316667, -0.4369282) * go_1(-1.0, 0.0);
|
||||
result += mat4(0.19195688, -0.060883682, -0.25897828, 0.07063324, 0.090833396, 0.003422883, 0.109534174, 0.031180874, -0.05017118, 0.022862168, -0.270113, -0.057831235, 0.53920543, -0.10252776, -0.091807485, 0.004294343) * go_1(-1.0, 1.0);
|
||||
result += mat4(-0.18494242, -0.119284816, 0.3821897, 0.07777979, 0.15568028, -0.2854859, -0.22441281, -0.049155876, -0.15292497, 0.21895619, -0.095677756, 0.15210424, 0.001643022, -0.026176987, 0.048463076, -0.4824009) * go_1(0.0, -1.0);
|
||||
result += mat4(0.007215129, 0.17074333, 0.053930074, -0.027014816, -0.17180431, -0.15163863, -0.0012122132, -0.18934256, -0.08294297, -0.24580221, -0.46552867, -0.27923223, 0.4092668, 0.06288688, -0.1602188, -0.0030876845) * go_1(0.0, 0.0);
|
||||
result += mat4(0.111870885, 0.03317145, 0.14155298, 0.20328505, -0.05104131, 0.13979794, 0.018966835, -0.07238511, 0.05493792, -0.14975783, -0.10293237, -0.21985306, 0.49054706, 0.18288186, -0.26925826, 0.35845932) * go_1(0.0, 1.0);
|
||||
result += mat4(0.3747799, -0.096748486, -0.17139742, 0.25289854, -0.17421168, -0.018461818, 0.09747162, 0.01660535, -0.20580359, 0.56189656, 0.17151354, -0.26347768, 0.28350568, -0.21486014, -0.44330928, -0.008981037) * go_1(1.0, -1.0);
|
||||
result += mat4(0.10169985, -0.18244018, 0.04760736, 0.41017643, -0.09468786, -0.024218475, 0.103733875, -0.22540338, 0.10630112, 0.3677178, -0.104170956, 0.057317447, 0.21764882, 0.0789158, -0.22041337, 0.15065216) * go_1(1.0, 0.0);
|
||||
result += mat4(0.11633995, -0.008195114, -0.14501533, 0.07168025, 0.058413275, 0.055995367, 0.09362145, -0.13827963, 0.13760869, 0.040319785, 0.038895044, 0.2675253, -0.087339684, 0.1412073, -0.17166458, -0.2312994) * go_1(1.0, 1.0);
|
||||
result += vec4(-0.059377354, -0.02055341, 0.07234869, -0.015452986);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v4.0-Restore-CNN-(M)-Conv-4x3x3x8
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_3_tf
|
||||
//!SAVE conv2d_4_tf
|
||||
//!WIDTH conv2d_3_tf.w
|
||||
//!HEIGHT conv2d_3_tf.h
|
||||
//!COMPONENTS 4
|
||||
#define go_0(x_off, y_off) (max((conv2d_3_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max(-(conv2d_3_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.29012984, -0.13150147, 0.31015614, 0.05992291, -0.050289866, 0.14845313, -0.09608898, 0.27913308, 0.060307387, -0.04160452, 0.035932682, -0.08137563, -0.07999419, 0.11818284, -0.27512288, 0.21948813) * go_0(-1.0, -1.0);
|
||||
result += mat4(0.12916058, -0.21759962, -0.33868533, 0.021636661, 0.053470243, 0.1412425, 0.043395396, -0.26751056, -0.01689101, -0.2623835, 0.010809152, 0.062962815, -0.20692012, -0.1677863, -0.23313859, -0.17402615) * go_0(-1.0, 0.0);
|
||||
result += mat4(-0.08204112, -0.23672083, -0.0064437394, -0.13200696, -0.056692924, -0.02708657, 0.12536962, 0.004428919, 0.14137582, 0.15404348, -0.105753876, 0.047957454, 0.15734316, 0.16562423, -0.010160829, -0.06602983) * go_0(-1.0, 1.0);
|
||||
result += mat4(0.025653997, -0.10877775, -0.31258908, 0.18841636, -0.36005193, 0.1816357, -0.34537643, -0.0741087, 0.4663994, 0.0065186517, 0.08109033, 0.2976773, -0.35774228, -0.041366056, -0.37852773, 0.050565656) * go_0(0.0, -1.0);
|
||||
result += mat4(0.04392313, 0.11316681, -0.14421389, 0.17985669, -0.1651274, -0.5656209, -0.124100484, 0.42774054, -0.1153939, 0.16829851, 0.2025612, 0.054007456, -0.06868256, -0.56935954, -0.12227961, 0.17688861) * go_0(0.0, 0.0);
|
||||
result += mat4(0.34041, 0.499, 0.15234196, 0.21353458, -0.2732667, -0.049950935, 0.03550811, -0.21051687, 0.2609023, 0.016438454, -0.29874632, 0.37994128, 0.049288407, -0.31126305, 0.029235512, -0.012256015) * go_0(0.0, 1.0);
|
||||
result += mat4(-0.0046853204, 0.15391374, -0.040689662, 0.20186873, -0.08137621, 0.35905558, 0.23733845, 0.21794793, -0.066420384, 0.029600656, -0.31421044, -0.050773863, -0.06260773, 0.04634221, -0.10948491, -0.045498934) * go_0(1.0, -1.0);
|
||||
result += mat4(-0.082953, -0.025837064, -0.09928303, -0.14300232, 0.275064, 0.07793617, 0.22240888, 0.06637834, -0.4382666, -0.2932182, -0.27243167, -0.14221182, 0.5695728, 0.20719238, 0.5575927, 0.40816882) * go_0(1.0, 0.0);
|
||||
result += mat4(-0.18510929, -0.15052167, 0.25277212, 0.06804461, 0.016387, 0.20310035, 0.2903229, -0.0615877, -0.28987274, -0.11942605, 0.013498961, 0.3184152, 0.29543474, -0.042830903, -0.018111207, -0.13263674) * go_0(1.0, 1.0);
|
||||
result += mat4(0.25749087, 0.0053866603, -0.09391162, -0.06129529, -0.094091184, -0.07419633, 0.0013858611, 0.012000353, -0.062903, -0.0204224, -0.12113313, 0.017942557, -0.073379934, 0.052201986, 0.35864577, 0.023564404) * go_1(-1.0, -1.0);
|
||||
result += mat4(0.100115694, 0.19451359, 0.23252094, 0.19506809, -0.12470779, 0.0027281935, -0.17488572, -0.018721964, -0.15159339, 0.18457152, 0.057712987, -0.08191495, 0.19735703, 0.07326743, -0.28563106, 0.01642815) * go_1(-1.0, 0.0);
|
||||
result += mat4(0.068062514, 0.28356665, 0.07377898, 0.42776972, 0.28725025, -0.13045293, -0.17525704, -0.05885591, -0.16676305, -0.2555945, -0.10078422, -0.053032875, 0.084470876, 0.06460686, 0.13824362, -0.05231353) * go_1(-1.0, 1.0);
|
||||
result += mat4(0.22637829, -0.028969254, 0.1968254, -0.13331996, 0.038017053, -0.008854481, -0.2031639, 0.09237089, -0.3821112, 0.1108527, -0.11029933, -0.24542028, 0.22416145, -0.031492114, -0.19144306, -0.0996271) * go_1(0.0, -1.0);
|
||||
result += mat4(0.10776744, 0.16363445, 0.14656505, -0.3737814, -0.06642015, 0.5616549, -0.008412252, -0.37266847, 0.12506576, -0.15329036, 0.037538245, -0.10810259, 0.01706349, 0.1813702, 0.035651788, -0.012786579) * go_1(0.0, 0.0);
|
||||
result += mat4(-0.4023338, -0.2098614, -0.18285121, -0.02727653, 0.26107362, 0.041306913, -0.036515504, -0.045217298, -0.39958602, -0.21229339, -0.021053292, -0.13427502, 0.36178818, 0.20934913, 0.1500852, 0.2634554) * go_1(0.0, 1.0);
|
||||
result += mat4(0.07794611, -0.25937587, -0.06822529, -0.056336135, 0.094220124, 0.21588847, -0.0455218, -0.10968329, -0.08068449, -0.31366697, 0.07799637, 0.24252681, 0.23963861, 0.13715535, 0.010329345, 0.09094301) * go_1(1.0, -1.0);
|
||||
result += mat4(-0.20975718, -0.12550138, 0.14453574, -0.0020878632, -0.07153068, 0.3249998, -0.056577377, 0.18166828, 0.37204072, 0.17018336, 0.3752895, 0.32178587, 0.2571982, -0.27258632, -0.25971004, -0.40536007) * go_1(1.0, 0.0);
|
||||
result += mat4(-0.3243907, -0.06300621, -0.09398436, -0.19549188, 0.14906861, 0.061537784, -0.055284478, 0.11281728, 0.12964857, 0.09979093, -0.1810159, -0.4104283, 0.05807971, -0.056371246, 0.08072554, 0.18479007) * go_1(1.0, 1.0);
|
||||
result += vec4(-0.048888464, -0.0561434, 0.030690912, -0.030496685);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v4.0-Restore-CNN-(M)-Conv-4x3x3x8
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_4_tf
|
||||
//!SAVE conv2d_5_tf
|
||||
//!WIDTH conv2d_4_tf.w
|
||||
//!HEIGHT conv2d_4_tf.h
|
||||
//!COMPONENTS 4
|
||||
#define go_0(x_off, y_off) (max((conv2d_4_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max(-(conv2d_4_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(0.15332128, 0.027258258, 0.14900503, -0.15982795, 0.17021236, -0.51046044, -0.15287271, -0.058167327, 0.51826185, -0.34817994, 0.004513167, 0.05395769, 0.1990321, -0.049979225, 0.11391989, -0.16062729) * go_0(-1.0, -1.0);
|
||||
result += mat4(0.033682905, 0.019728886, 0.19931756, 0.17381927, 0.2585768, -0.2124572, -0.014632459, 0.39779893, -0.1146207, -0.2396625, 0.08960277, 0.38345298, 0.25497693, 0.11692859, -0.14207517, 0.12667973) * go_0(-1.0, 0.0);
|
||||
result += mat4(-0.14911255, 0.08910706, 0.16136818, 0.03914566, 0.24204038, -0.03607149, -0.4571109, 0.10802461, -0.0021356856, 0.00885878, 0.22297303, 0.2367231, 0.045177583, 0.11120606, -0.009971904, -0.059262395) * go_0(-1.0, 1.0);
|
||||
result += mat4(0.24565999, -0.2261384, 0.47373205, 0.024613412, -0.10923052, 0.039027315, -0.42707404, -0.3783373, 0.3544573, -0.5468578, -0.27599156, -0.09455918, 0.18760219, -0.19082001, 0.030565469, 0.20589156) * go_0(0.0, -1.0);
|
||||
result += mat4(0.1973198, -0.03433863, 0.059960485, 0.045642868, 0.1819595, -0.14460869, 0.1286175, 0.2067575, -0.042632047, -0.11842967, -0.11224446, -0.18764776, -0.19563004, 0.027425969, 0.24056377, 0.5949649) * go_0(0.0, 0.0);
|
||||
result += mat4(0.055027682, 0.16331595, -0.2608588, 0.12545955, 0.4588985, 0.03642909, 0.22187738, 0.45190734, -0.001210133, -0.057651415, -0.061199043, 0.11935476, -0.049561135, 0.27509886, 0.13778673, -0.124914035) * go_0(0.0, 1.0);
|
||||
result += mat4(-0.02257459, 0.27705106, 0.044165276, -0.26521233, 0.05982374, -0.2824302, 0.3171142, 0.08430561, -0.10155528, 0.16182268, -0.09183147, -0.19447176, 0.3295707, -0.50616395, -0.036964044, 0.23166709) * go_0(1.0, -1.0);
|
||||
result += mat4(-0.0232342, 0.07299799, -0.18038079, -0.13672702, -0.108305976, 0.15024792, -0.19531927, 0.0870979, -0.26488534, 0.19481428, 0.10737945, -0.14573483, -0.33094683, 0.24155116, -0.09850332, 0.2797003) * go_0(1.0, 0.0);
|
||||
result += mat4(-0.24089853, 0.19506595, 0.4799156, -0.058313113, 0.36212957, -0.44844806, 0.23864488, 0.15477742, -0.07795971, -0.0033861927, -0.11216164, 0.033454563, -0.25893036, 0.23793478, -0.15769425, -0.00033481256) * go_0(1.0, 1.0);
|
||||
result += mat4(0.05772507, -0.1640253, -0.13499664, -0.20460358, -0.024399966, 0.14966168, -0.090857334, -0.039677754, 0.00036956606, -0.24236615, -0.053542696, -0.0049544116, 0.026651502, 0.39019194, -0.2742246, -0.061242323) * go_1(-1.0, -1.0);
|
||||
result += mat4(-0.016323274, -0.036179908, 0.029965919, 0.11151491, -0.00016685206, -0.29573023, 0.17996423, -0.20145437, 0.1324275, -0.18442132, -0.24618152, 0.061780427, -0.02770517, 0.28452995, 0.39804098, -0.1174389) * go_1(-1.0, 0.0);
|
||||
result += mat4(-0.025068847, -0.053328387, -0.27053785, 0.26866457, -0.09866204, 0.057677213, 0.01850112, -0.18014707, -0.13319959, -0.14411181, -0.26355243, -0.022209354, -0.05062645, -0.036771543, 0.13294417, -0.18458557) * go_1(-1.0, 1.0);
|
||||
result += mat4(-0.046194963, 0.038230438, -0.08993043, -0.07236354, 0.11031123, -0.16504908, -0.09517036, -0.16459833, -0.5279925, 0.12686682, -0.05726125, 0.055361677, 0.31593755, 0.027328093, 0.001839602, 0.30581662) * go_1(0.0, -1.0);
|
||||
result += mat4(0.08608678, 0.03168437, 0.007713377, -0.26140293, -0.1268983, 0.13395861, -0.069848835, -0.24080403, 0.018839337, -0.049821075, -0.21461345, -0.14168301, -0.0872339, 0.47096667, 0.022512507, 0.14860632) * go_1(0.0, 0.0);
|
||||
result += mat4(0.06293673, 0.22462969, 0.045494985, 0.021673543, 0.18227446, -0.2956555, 0.08010543, -0.01919729, -0.012190269, 0.241983, -0.046537094, -0.40094566, -0.3853647, 0.1081711, -0.16926058, 0.16138376) * go_1(0.0, 1.0);
|
||||
result += mat4(-0.14854589, -0.17625804, -0.10849075, 0.221543, 0.099971965, 0.13901573, 0.29464146, 0.020068526, 0.054358527, -0.10351705, -0.0062914286, 0.24127026, -0.16914125, 0.12729423, -0.18377453, -0.6452375) * go_1(1.0, -1.0);
|
||||
result += mat4(0.12603393, -0.10986093, 0.2314103, 0.16915044, -0.13619255, -0.09349073, 0.20594226, -0.34507084, 0.19077192, 0.052500796, 0.07185645, 0.029082738, -0.015576321, 0.08254907, -0.5501743, -0.38495848) * go_1(1.0, 0.0);
|
||||
result += mat4(0.09300796, -0.079218306, 0.46825135, -0.08735625, 0.06321122, 0.16234867, 0.042932414, -0.013057422, 0.09697148, 0.23457524, 0.19417483, -0.16804664, 0.18379296, 0.17770062, -0.050235, -0.059676602) * go_1(1.0, 1.0);
|
||||
result += vec4(0.011169491, 0.032399546, 0.138099, 0.023857072);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v4.0-Restore-CNN-(M)-Conv-4x3x3x8
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_5_tf
|
||||
//!SAVE conv2d_6_tf
|
||||
//!WIDTH conv2d_5_tf.w
|
||||
//!HEIGHT conv2d_5_tf.h
|
||||
//!COMPONENTS 4
|
||||
#define go_0(x_off, y_off) (max((conv2d_5_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max(-(conv2d_5_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.22753362, -0.08612073, 0.33140692, 0.08699529, -0.18788953, -0.056579117, -0.12905197, -0.06694621, 0.054559365, 0.15031597, -0.13430363, 0.021646025, 0.14884405, -0.0694291, 0.26149413, 0.11270503) * go_0(-1.0, -1.0);
|
||||
result += mat4(0.17876762, -0.09637848, 0.11285323, 0.2004893, 0.1317187, -0.036162686, 0.17958368, -0.069625, 0.28760737, -0.12505141, 0.12760694, 0.047717955, -0.16811855, -0.16340709, 0.13278298, -0.08403954) * go_0(-1.0, 0.0);
|
||||
result += mat4(-0.21917523, 0.079711854, -0.28642535, 0.2822416, 0.03001489, -0.014772918, -0.3487396, 0.10597145, -0.013841082, 0.17034237, 0.10810282, -0.08089695, -0.22184245, -0.59067357, 0.44113398, 0.13045649) * go_0(-1.0, 1.0);
|
||||
result += mat4(-0.29906932, 0.013923749, 0.2031124, -0.11846688, -0.13953634, 0.08003455, -0.10164494, -0.21218559, 0.10563715, 0.31033117, -0.075903505, 0.047310907, -0.37824214, -0.14506383, 0.11866701, -0.21384487) * go_0(0.0, -1.0);
|
||||
result += mat4(-0.1353849, 0.19258606, 0.063908584, -0.2043788, 0.27244982, 0.1665306, -0.29357895, -0.22441709, 0.18514316, -0.17840464, 0.20986097, 0.14351055, -0.057732623, 0.42166704, -0.23182064, -0.4957248) * go_0(0.0, 0.0);
|
||||
result += mat4(-0.34830126, 0.109066755, -0.28285867, -0.048280068, -0.12290918, 0.04291651, -0.047484186, -0.03702595, 0.23047262, 0.09398974, 0.022467108, 0.08271034, 0.3066665, -0.54077, 0.057771873, 0.23194093) * go_0(0.0, 1.0);
|
||||
result += mat4(-0.17731948, -0.3175927, 0.1452728, 0.09396786, -0.16433562, -0.01833653, -0.22345604, -0.04161193, -0.14827462, 0.18544114, -0.15544125, -0.06179007, 0.16989979, -0.20985202, 0.16391534, -0.09447268) * go_0(1.0, -1.0);
|
||||
result += mat4(-0.053878862, -0.21034616, 0.023831524, 0.19772215, 0.31647214, 0.0126534775, -0.19130844, -0.049282108, -0.21446131, 0.067189045, 0.09117449, -0.25548774, 0.12109098, 0.22009392, -0.3924665, -0.13340388) * go_0(1.0, 0.0);
|
||||
result += mat4(-0.16096684, -0.18495405, 0.10410178, 0.0015673033, -0.00183498, -0.044303037, -0.062745355, -0.090802394, 0.043269135, 0.06924481, -0.21367405, -0.14619029, 0.11555763, -0.20292862, 0.5799557, 0.14739846) * go_0(1.0, 1.0);
|
||||
result += mat4(-0.21030277, -0.09578802, 0.013482288, -0.21484336, 0.12995781, 0.40431052, -0.3347856, -0.18183486, 0.15550353, -0.04402301, 0.4603779, 0.14874357, -0.07694621, -0.053523075, -0.19607326, -0.10850742) * go_1(-1.0, -1.0);
|
||||
result += mat4(-0.2347211, 0.2697403, -0.0634794, -0.17925987, 0.17231455, 0.24999185, -0.5208536, -0.10491828, -0.233575, 0.52950364, 0.0038063182, -0.1380038, 0.022935199, 0.19369157, 0.14586553, 0.1938704) * go_1(-1.0, 0.0);
|
||||
result += mat4(-0.10245223, 0.34150192, 0.25862157, -0.20165509, 0.5597771, 0.114510864, -0.122526556, -0.04010975, 0.1704679, -0.23335956, -0.16771887, -0.03783455, -0.056995615, 0.24153493, -0.08082429, -0.24210933) * go_1(-1.0, 1.0);
|
||||
result += mat4(-0.103466526, 0.15278348, -0.30526164, -0.080755696, 0.103505425, 0.15862796, 0.14696524, -0.008358076, -0.09180311, -0.12505089, 0.28052542, -0.13551563, 0.07528779, -0.09636086, -0.10369617, 0.23656134) * go_1(0.0, -1.0);
|
||||
result += mat4(-0.25752836, 0.099439755, -0.30716348, 0.035077725, 0.023509016, 0.23106368, 0.05277125, 0.34910464, 0.088015385, 0.26995596, 0.1390645, -0.40671825, 0.18096298, -0.100688554, 0.5492049, 0.2482101) * go_1(0.0, 0.0);
|
||||
result += mat4(0.41411775, -0.107200556, -0.13813478, 0.13768874, 0.27137747, 0.06313619, -0.08522967, 0.03218302, -0.03166121, -0.3415683, -0.52242, -0.1741813, -0.36956537, 0.179129, -0.09742935, -0.11696616) * go_1(0.0, 1.0);
|
||||
result += mat4(-0.07975504, 0.17964838, 0.37122533, 0.16064765, 0.14309953, 0.29473078, 0.0926391, -0.22333665, 0.34612748, -0.3387473, 0.0077308523, -0.07239449, 0.18522519, -0.21297298, 0.11493978, 0.16117814) * go_1(1.0, -1.0);
|
||||
result += mat4(-0.17402779, 0.10023144, 0.11712206, 0.031971734, 0.18713303, 0.08736295, 0.013007052, -0.06943139, -0.20102951, -0.010721135, -0.2562522, 0.34877458, -0.13732676, -0.40258047, 0.25824392, 0.15720639) * go_1(1.0, 0.0);
|
||||
result += mat4(0.044494305, 0.3296108, 0.0017603852, 0.09362289, 0.38839245, 0.40015858, -0.13395199, -0.044521853, -0.56266373, 0.251378, 0.5005789, -0.13106057, -0.18491416, -0.046887, 0.067797676, -0.14694957) * go_1(1.0, 1.0);
|
||||
result += vec4(0.013687534, -0.08185164, -0.04755438, 0.290178);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v4.0-Restore-CNN-(M)-Conv-3x1x1x56
|
||||
//!HOOK MAIN
|
||||
//!BIND MAIN
|
||||
//!BIND conv2d_tf
|
||||
//!BIND conv2d_1_tf
|
||||
//!BIND conv2d_2_tf
|
||||
//!BIND conv2d_3_tf
|
||||
//!BIND conv2d_4_tf
|
||||
//!BIND conv2d_5_tf
|
||||
//!BIND conv2d_6_tf
|
||||
//!SAVE MAIN
|
||||
//!WIDTH conv2d_tf.w
|
||||
//!HEIGHT conv2d_tf.h
|
||||
#define g_0 (max((conv2d_tf_tex(conv2d_tf_pos)), 0.0))
|
||||
#define g_1 (max(-(conv2d_tf_tex(conv2d_tf_pos)), 0.0))
|
||||
#define g_2 (max((conv2d_1_tf_tex(conv2d_1_tf_pos)), 0.0))
|
||||
#define g_3 (max(-(conv2d_1_tf_tex(conv2d_1_tf_pos)), 0.0))
|
||||
#define g_4 (max((conv2d_2_tf_tex(conv2d_2_tf_pos)), 0.0))
|
||||
#define g_5 (max(-(conv2d_2_tf_tex(conv2d_2_tf_pos)), 0.0))
|
||||
#define g_6 (max((conv2d_3_tf_tex(conv2d_3_tf_pos)), 0.0))
|
||||
#define g_7 (max(-(conv2d_3_tf_tex(conv2d_3_tf_pos)), 0.0))
|
||||
#define g_8 (max((conv2d_4_tf_tex(conv2d_4_tf_pos)), 0.0))
|
||||
#define g_9 (max(-(conv2d_4_tf_tex(conv2d_4_tf_pos)), 0.0))
|
||||
#define g_10 (max((conv2d_5_tf_tex(conv2d_5_tf_pos)), 0.0))
|
||||
#define g_11 (max(-(conv2d_5_tf_tex(conv2d_5_tf_pos)), 0.0))
|
||||
#define g_12 (max((conv2d_6_tf_tex(conv2d_6_tf_pos)), 0.0))
|
||||
#define g_13 (max(-(conv2d_6_tf_tex(conv2d_6_tf_pos)), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.08837163, -0.065234736, -0.034704313, 0.0, 0.021405501, 0.013663729, 0.019249594, 0.0, 0.05328863, 0.03580334, 0.046457592, 0.0, -0.12216048, 0.022547891, 0.016400825, 0.0) * g_0;
|
||||
result += mat4(0.061996464, 0.05631466, 0.06808407, 0.0, -0.005013109, -0.0044589997, -0.032367796, 0.0, 0.016481603, 0.13721058, 0.14924648, 0.0, 0.020035887, -0.07250003, -0.08034037, 0.0) * g_1;
|
||||
result += mat4(0.24078514, 0.081361525, 0.053420708, 0.0, -0.009353794, -0.051077116, -0.058007747, 0.0, -0.14071098, 0.01035966, 0.005308949, 0.0, -0.1489842, -0.06711817, -0.05552926, 0.0) * g_2;
|
||||
result += mat4(-0.13002375, 0.012733757, 0.017821986, 0.0, 0.17767483, 0.20204604, 0.1751779, 0.0, 0.12804912, 0.07381453, 0.05655911, 0.0, 0.17044514, 0.07301451, 0.06523978, 0.0) * g_3;
|
||||
result += mat4(-0.1170986, -0.05130371, -0.027939914, 0.0, -0.16645707, -0.121526904, -0.09471366, 0.0, -0.04143118, 0.026693767, 0.034615446, 0.0, -0.084318705, -0.064990036, -0.054324172, 0.0) * g_4;
|
||||
result += mat4(0.12094524, 0.09518409, 0.07387219, 0.0, 0.062216382, 0.053228356, 0.031372335, 0.0, 0.072797105, 0.026258165, 0.009804673, 0.0, 0.120719045, 0.073281154, 0.056623302, 0.0) * g_5;
|
||||
result += mat4(-0.11141495, -0.11566289, -0.10398725, 0.0, -0.0651895, -0.06820691, -0.054204144, 0.0, -0.032746475, -0.008849683, -0.007610222, 0.0, -0.024655705, -0.048778858, -0.041144755, 0.0) * g_6;
|
||||
result += mat4(0.058090195, 0.07538767, 0.059722915, 0.0, 0.044788487, 0.04212742, 0.027502589, 0.0, 0.04892866, 0.015416752, 0.008312418, 0.0, -0.011864114, -0.0074752793, -0.0060824654, 0.0) * g_7;
|
||||
result += mat4(0.043446552, 0.061971307, 0.05758086, 0.0, -0.06379154, -0.053758245, -0.047204215, 0.0, 0.016307736, 0.03423424, 0.030179083, 0.0, 0.041445345, 0.03843772, 0.033059113, 0.0) * g_8;
|
||||
result += mat4(-0.003803544, 0.0008906116, -0.00059585314, 0.0, 0.102071285, 0.11485224, 0.10007254, 0.0, -0.074306004, -0.08803551, -0.07972321, 0.0, -0.030704215, -0.021514274, -0.009049376, 0.0) * g_9;
|
||||
result += mat4(0.0066058086, 0.0011408008, 0.0016199006, 0.0, -0.03916473, -0.042929266, -0.04018418, 0.0, -0.03153446, -0.039413508, -0.034767237, 0.0, 0.113516055, 0.12577052, 0.113335624, 0.0) * g_10;
|
||||
result += mat4(0.02655948, 0.041905303, 0.03861737, 0.0, 0.048471425, 0.049788587, 0.050447535, 0.0, 0.12092813, 0.13564217, 0.12613249, 0.0, -0.0023508538, 0.0012828974, 0.0028730957, 0.0) * g_11;
|
||||
result += mat4(0.0084758485, 0.008800083, 0.008206044, 0.0, -0.056123603, -0.06610845, -0.060320783, 0.0, -0.081793964, -0.101638645, -0.096699014, 0.0, -0.04402356, -0.04177539, -0.03829645, 0.0) * g_12;
|
||||
result += mat4(0.10676299, 0.118409514, 0.10618478, 0.0, -0.05880252, -0.06488367, -0.06432695, 0.0, 0.019221924, 0.017602798, 0.017413978, 0.0, -0.07512528, -0.080483615, -0.066218294, 0.0) * g_13;
|
||||
result += vec4(-0.010478934, -0.008364784, -0.010246552, 0.0);
|
||||
return result + MAIN_tex(MAIN_pos);
|
||||
}
|
222
mpv/shaders-old/Anime4K_Thin_HQ.glsl
Executable file
222
mpv/shaders-old/Anime4K_Thin_HQ.glsl
Executable file
|
@ -0,0 +1,222 @@
|
|||
// MIT License
|
||||
|
||||
// Copyright (c) 2019-2021 bloc97
|
||||
// All rights reserved.
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
//!DESC Anime4K-v3.2-Thin-(HQ)-Luma
|
||||
//!HOOK MAIN
|
||||
//!BIND HOOKED
|
||||
//!SAVE LINELUMA
|
||||
//!COMPONENTS 1
|
||||
|
||||
float get_luma(vec4 rgba) {
|
||||
return dot(vec4(0.299, 0.587, 0.114, 0.0), rgba);
|
||||
}
|
||||
|
||||
vec4 hook() {
|
||||
return vec4(get_luma(HOOKED_tex(HOOKED_pos)), 0.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
//!DESC Anime4K-v3.2-Thin-(HQ)-Sobel-X
|
||||
//!HOOK MAIN
|
||||
//!BIND LINELUMA
|
||||
//!SAVE LINESOBEL
|
||||
//!COMPONENTS 2
|
||||
|
||||
vec4 hook() {
|
||||
float l = LINELUMA_texOff(vec2(-1.0, 0.0)).x;
|
||||
float c = LINELUMA_tex(LINELUMA_pos).x;
|
||||
float r = LINELUMA_texOff(vec2(1.0, 0.0)).x;
|
||||
|
||||
float xgrad = (-l + r);
|
||||
float ygrad = (l + c + c + r);
|
||||
|
||||
return vec4(xgrad, ygrad, 0.0, 0.0);
|
||||
}
|
||||
|
||||
|
||||
//!DESC Anime4K-v3.2-Thin-(HQ)-Sobel-Y
|
||||
//!HOOK MAIN
|
||||
//!BIND LINESOBEL
|
||||
//!SAVE LINESOBEL
|
||||
//!COMPONENTS 1
|
||||
|
||||
vec4 hook() {
|
||||
float tx = LINESOBEL_texOff(vec2(0.0, -1.0)).x;
|
||||
float cx = LINESOBEL_tex(LINESOBEL_pos).x;
|
||||
float bx = LINESOBEL_texOff(vec2(0.0, 1.0)).x;
|
||||
|
||||
float ty = LINESOBEL_texOff(vec2(0.0, -1.0)).y;
|
||||
float by = LINESOBEL_texOff(vec2(0.0, 1.0)).y;
|
||||
|
||||
float xgrad = (tx + cx + cx + bx) / 8.0;
|
||||
|
||||
float ygrad = (-ty + by) / 8.0;
|
||||
|
||||
//Computes the luminance's gradient
|
||||
float norm = sqrt(xgrad * xgrad + ygrad * ygrad);
|
||||
return vec4(pow(norm, 0.7));
|
||||
}
|
||||
|
||||
|
||||
//!DESC Anime4K-v3.2-Thin-(HQ)-Gaussian-X
|
||||
//!HOOK MAIN
|
||||
//!BIND HOOKED
|
||||
//!BIND LINESOBEL
|
||||
//!SAVE LINESOBEL
|
||||
//!COMPONENTS 1
|
||||
|
||||
#define SPATIAL_SIGMA (2.0 * float(HOOKED_size.y) / 1080.0) //Spatial window size, must be a positive real number.
|
||||
|
||||
#define KERNELSIZE (max(int(ceil(SPATIAL_SIGMA * 2.0)), 1) * 2 + 1) //Kernel size, must be an positive odd integer.
|
||||
#define KERNELHALFSIZE (int(KERNELSIZE/2)) //Half of the kernel size without remainder. Must be equal to trunc(KERNELSIZE/2).
|
||||
#define KERNELLEN (KERNELSIZE * KERNELSIZE) //Total area of kernel. Must be equal to KERNELSIZE * KERNELSIZE.
|
||||
|
||||
float gaussian(float x, float s, float m) {
|
||||
float scaled = (x - m) / s;
|
||||
return exp(-0.5 * scaled * scaled);
|
||||
}
|
||||
|
||||
float comp_gaussian_x() {
|
||||
|
||||
float g = 0.0;
|
||||
float gn = 0.0;
|
||||
|
||||
for (int i=0; i<KERNELSIZE; i++) {
|
||||
float di = float(i - KERNELHALFSIZE);
|
||||
float gf = gaussian(di, SPATIAL_SIGMA, 0.0);
|
||||
|
||||
g = g + LINESOBEL_texOff(vec2(di, 0.0)).x * gf;
|
||||
gn = gn + gf;
|
||||
|
||||
}
|
||||
|
||||
return g / gn;
|
||||
}
|
||||
|
||||
vec4 hook() {
|
||||
return vec4(comp_gaussian_x(), 0.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
|
||||
//!DESC Anime4K-v3.2-Thin-(HQ)-Gaussian-Y
|
||||
//!HOOK MAIN
|
||||
//!BIND HOOKED
|
||||
//!BIND LINESOBEL
|
||||
//!SAVE LINESOBEL
|
||||
//!COMPONENTS 1
|
||||
|
||||
#define SPATIAL_SIGMA (2.0 * float(HOOKED_size.y) / 1080.0) //Spatial window size, must be a positive real number.
|
||||
|
||||
#define KERNELSIZE (max(int(ceil(SPATIAL_SIGMA * 2.0)), 1) * 2 + 1) //Kernel size, must be an positive odd integer.
|
||||
#define KERNELHALFSIZE (int(KERNELSIZE/2)) //Half of the kernel size without remainder. Must be equal to trunc(KERNELSIZE/2).
|
||||
#define KERNELLEN (KERNELSIZE * KERNELSIZE) //Total area of kernel. Must be equal to KERNELSIZE * KERNELSIZE.
|
||||
|
||||
float gaussian(float x, float s, float m) {
|
||||
float scaled = (x - m) / s;
|
||||
return exp(-0.5 * scaled * scaled);
|
||||
}
|
||||
|
||||
float comp_gaussian_y() {
|
||||
|
||||
float g = 0.0;
|
||||
float gn = 0.0;
|
||||
|
||||
for (int i=0; i<KERNELSIZE; i++) {
|
||||
float di = float(i - KERNELHALFSIZE);
|
||||
float gf = gaussian(di, SPATIAL_SIGMA, 0.0);
|
||||
|
||||
g = g + LINESOBEL_texOff(vec2(0.0, di)).x * gf;
|
||||
gn = gn + gf;
|
||||
|
||||
}
|
||||
|
||||
return g / gn;
|
||||
}
|
||||
|
||||
vec4 hook() {
|
||||
return vec4(comp_gaussian_y(), 0.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
//!DESC Anime4K-v3.2-Thin-(HQ)-Kernel-X
|
||||
//!HOOK MAIN
|
||||
//!BIND LINESOBEL
|
||||
//!SAVE LINESOBEL
|
||||
//!COMPONENTS 2
|
||||
|
||||
vec4 hook() {
|
||||
float l = LINESOBEL_texOff(vec2(-1.0, 0.0)).x;
|
||||
float c = LINESOBEL_tex(LINESOBEL_pos).x;
|
||||
float r = LINESOBEL_texOff(vec2(1.0, 0.0)).x;
|
||||
|
||||
float xgrad = (-l + r);
|
||||
float ygrad = (l + c + c + r);
|
||||
|
||||
return vec4(xgrad, ygrad, 0.0, 0.0);
|
||||
}
|
||||
|
||||
|
||||
//!DESC Anime4K-v3.2-Thin-(HQ)-Kernel-Y
|
||||
//!HOOK MAIN
|
||||
//!BIND LINESOBEL
|
||||
//!SAVE LINESOBEL
|
||||
//!COMPONENTS 2
|
||||
|
||||
vec4 hook() {
|
||||
float tx = LINESOBEL_texOff(vec2(0.0, -1.0)).x;
|
||||
float cx = LINESOBEL_tex(LINESOBEL_pos).x;
|
||||
float bx = LINESOBEL_texOff(vec2(0.0, 1.0)).x;
|
||||
|
||||
float ty = LINESOBEL_texOff(vec2(0.0, -1.0)).y;
|
||||
float by = LINESOBEL_texOff(vec2(0.0, 1.0)).y;
|
||||
|
||||
float xgrad = (tx + cx + cx + bx) / 8.0;
|
||||
|
||||
float ygrad = (-ty + by) / 8.0;
|
||||
|
||||
//Computes the luminance's gradient
|
||||
return vec4(xgrad, ygrad, 0.0, 0.0);
|
||||
}
|
||||
|
||||
|
||||
//!DESC Anime4K-v3.2-Thin-(HQ)-Warp
|
||||
//!HOOK MAIN
|
||||
//!BIND HOOKED
|
||||
//!BIND LINESOBEL
|
||||
|
||||
#define STRENGTH 0.6 //Strength of warping for each iteration
|
||||
#define ITERATIONS 1 //Number of iterations for the forwards solver, decreasing strength and increasing iterations improves quality at the cost of speed.
|
||||
|
||||
vec4 hook() {
|
||||
vec2 d = HOOKED_pt;
|
||||
|
||||
float relstr = HOOKED_size.y / 1080.0 * STRENGTH;
|
||||
|
||||
vec2 pos = HOOKED_pos;
|
||||
for (int i=0; i<ITERATIONS; i++) {
|
||||
vec2 dn = LINESOBEL_tex(pos).xy;
|
||||
vec2 dd = (dn / (length(dn) + 0.01)) * d * relstr; //Quasi-normalization for large vectors, avoids divide by zero
|
||||
pos -= dd;
|
||||
}
|
||||
|
||||
return HOOKED_tex(pos);
|
||||
|
||||
}
|
300
mpv/shaders-old/Anime4K_Upscale_CNN_x2_M.glsl
Executable file
300
mpv/shaders-old/Anime4K_Upscale_CNN_x2_M.glsl
Executable file
|
@ -0,0 +1,300 @@
|
|||
// MIT License
|
||||
|
||||
// Copyright (c) 2019-2021 bloc97
|
||||
// All rights reserved.
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
//!DESC Anime4K-v3.2-Upscale-CNN-x2-(M)-Conv-4x3x3x3
|
||||
//!HOOK MAIN
|
||||
//!BIND MAIN
|
||||
//!SAVE conv2d_tf
|
||||
//!WIDTH MAIN.w
|
||||
//!HEIGHT MAIN.h
|
||||
//!COMPONENTS 4
|
||||
//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > *
|
||||
#define go_0(x_off, y_off) (MAIN_texOff(vec2(x_off, y_off)))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.010995803, 0.077095956, -0.043992598, 0.06048717, 0.1164834, -0.11689607, 0.072985925, -0.078805886, 0.01182932, 0.054985743, -0.09018186, 0.044907484, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, -1.0);
|
||||
result += mat4(0.1813623, -0.14752422, 0.025720436, -0.17639883, 0.15697388, 0.10445984, -0.1843076, 0.5264643, 0.047516696, -0.097305484, 0.09740847, -0.29619336, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, 0.0);
|
||||
result += mat4(-0.014534763, 0.09486465, 0.046173926, 0.039391946, 0.09609376, -0.060574662, 0.042200956, -0.3269777, 0.051006425, 0.059818447, 0.04366627, 0.17699827, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, 1.0);
|
||||
result += mat4(0.04268535, -0.08152529, 0.10577459, -0.036936995, -0.051562306, 0.054872766, 0.09194519, 0.0025066638, -0.01073954, 0.00064474024, 0.10038221, 0.02131141, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, -1.0);
|
||||
result += mat4(-0.51751363, -0.40028602, 0.3469574, 0.5933738, -0.91357684, -0.67692596, 0.57815677, 0.39809322, -0.16341521, -0.27169713, 0.12232366, 0.4318641, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, 0.0);
|
||||
result += mat4(0.12601124, -0.06263236, -0.45907676, -0.41514075, 0.3330334, -0.1929565, -0.6333532, -0.6552794, -0.045809917, 0.046351526, -0.26173338, -0.30252662, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, 1.0);
|
||||
result += mat4(0.0030332592, 0.012103107, 0.010537323, -0.02038607, 0.095558085, 0.097704545, 0.083433494, 0.026790185, 0.01943357, -0.061712462, -0.00015703632, -0.032268334, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, -1.0);
|
||||
result += mat4(0.016870102, 0.5215812, -0.11525501, 0.027527615, -0.09045733, 0.61310345, -0.1575268, 0.1905386, 0.020172214, 0.3503187, -0.08209157, -0.051328037, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, 0.0);
|
||||
result += mat4(0.005494087, -0.010656317, 0.07682753, -0.08116042, -0.03934524, 0.16589017, 0.101483546, -0.066603065, 0.03494657, -0.07885597, 0.074227594, 0.0016264897, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, 1.0);
|
||||
result += vec4(0.014463938, -0.0031906287, 0.007015422, -0.003888468);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v3.2-Upscale-CNN-x2-(M)-Conv-4x3x3x8
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_tf
|
||||
//!SAVE conv2d_1_tf
|
||||
//!WIDTH conv2d_tf.w
|
||||
//!HEIGHT conv2d_tf.h
|
||||
//!COMPONENTS 4
|
||||
//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > *
|
||||
#define go_0(x_off, y_off) (max((conv2d_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max(-(conv2d_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.08532478, -0.14302494, -0.017921071, -0.0032664281, -0.09841952, 0.024187077, 0.10701477, 0.14110753, -0.05714981, -0.10897174, 0.073803626, 0.103992954, 0.07914382, 0.032193683, -0.18346278, -0.09723936) * go_0(-1.0, -1.0);
|
||||
result += mat4(-0.034482613, -0.10742312, -0.047286414, -0.08641124, -0.33896688, -0.036533825, -0.48337597, 0.034040943, -0.13598205, -0.080917805, 0.08540263, -0.012667689, -0.009171425, -0.120026454, -0.20536867, -0.032149274) * go_0(-1.0, 0.0);
|
||||
result += mat4(0.18687321, 0.066278316, 0.024327392, 0.08816582, -0.08017908, 0.09488853, 0.26018232, -0.101504356, 0.17487666, 0.31057635, 0.14785016, -0.09622089, -0.07537452, -0.13844088, -0.05810814, 0.09907489) * go_0(-1.0, 1.0);
|
||||
result += mat4(-0.04183032, 0.15207712, 0.005002397, 0.32277516, -0.16169126, -0.119836345, -0.04068436, -0.096728764, 0.11943901, 0.1789597, -0.20412198, 0.19009817, 0.36630696, 0.06946421, -0.5254373, -0.11896399) * go_0(0.0, -1.0);
|
||||
result += mat4(-0.31916487, -0.98911583, 1.0728644, -0.39280394, 0.33458877, -0.17325239, -0.645045, -0.28524077, -0.14512783, 0.24996442, -0.09837877, 0.05468934, 0.31559715, -0.020504637, -0.026724018, 0.24507573) * go_0(0.0, 0.0);
|
||||
result += mat4(-0.23759829, -0.08530173, -0.16665787, -0.22463752, 0.109896734, 0.13446991, -0.049552456, -0.02385489, -0.01245375, 0.3833208, 0.05758832, 0.1528937, 0.0501858, -0.19651426, 0.0076587177, -0.03297025) * go_0(0.0, 1.0);
|
||||
result += mat4(0.14554465, -0.01826686, 0.10284085, -0.19152659, -0.017585073, -0.05511482, 0.06362406, 0.023924058, -0.0018977845, -0.103172876, 0.03287086, -0.20085956, 0.36062446, 0.10749464, -0.20984372, 0.018256644) * go_0(1.0, -1.0);
|
||||
result += mat4(-0.005534592, 0.3709197, -0.18287498, 0.1720451, 0.030155553, -0.023265475, 0.0058617783, -0.031765483, 0.037328955, -0.2730994, 0.35090837, -0.3269043, -0.028477207, 0.32756507, -0.15989502, 0.12158258) * go_0(1.0, 0.0);
|
||||
result += mat4(0.10873739, 0.19583772, 0.060394943, 0.09410379, -0.04739245, 0.026561242, 0.022990001, 0.1093272, -0.01071349, -0.022938967, -0.046423864, 0.2385325, -0.0319821, 0.046962265, 0.09081178, -0.11001857) * go_0(1.0, 1.0);
|
||||
result += mat4(0.13012704, 0.112289295, 0.030790284, -0.050499484, 0.11784853, 0.08107028, -0.07556717, -0.15643, 0.015249331, 0.015299608, 0.07748125, 0.054485757, 0.044857923, 0.12161275, -0.048292994, -0.033995003) * go_1(-1.0, -1.0);
|
||||
result += mat4(0.12931514, 0.15114146, 0.070513315, 0.11246343, 0.4142387, 0.213479, -0.5439916, 0.07776645, 0.13109331, 0.2021147, 0.25932786, -0.22157331, 0.02377734, -0.014970623, -0.1943276, 0.18440372) * go_1(-1.0, 0.0);
|
||||
result += mat4(-0.22365458, -0.19829084, -0.06881161, -0.06468993, 0.17202774, 0.0048758537, -0.09235021, 0.18941896, 0.064125344, -0.09067088, 0.09748182, 0.13561936, -0.05876288, -0.0122420965, -0.054380875, -0.17743628) * go_1(-1.0, 1.0);
|
||||
result += mat4(0.18582906, -0.09263032, -0.08210888, -0.20515606, 0.11484005, 0.08557595, 0.0009253741, -0.051202174, -0.18535301, -0.1529345, -0.13092944, 0.03770747, -0.020947013, 0.19187425, -0.15494856, -0.048979875) * go_1(0.0, -1.0);
|
||||
result += mat4(-0.38131633, 0.4278787, 0.19763695, 0.27655518, -0.08711912, 0.07374453, -0.064803004, 0.5983854, 0.2361923, -0.057221692, -0.37138999, -0.24259573, 0.13890724, 0.25706333, -0.54021406, 0.08095518) * go_1(0.0, 0.0);
|
||||
result += mat4(0.0991328, -0.022651536, -0.029148921, -0.009812537, -0.09523686, -0.15704902, 0.052389514, 0.21561539, 0.1950314, -0.08572602, 0.0016523858, 0.14125621, -0.030999828, 0.12009709, 0.0373512, -0.105043754) * go_1(0.0, 1.0);
|
||||
result += mat4(-0.11251988, 0.12106985, 0.011923068, 0.3662747, 0.004800994, 0.017972551, 0.004761366, -0.07934206, -0.13755941, -0.022852683, 0.1502225, 0.009758547, -0.16964264, 0.00984782, 0.07855833, 0.035730787) * go_1(1.0, -1.0);
|
||||
result += mat4(0.01964957, -0.27226487, 0.033933397, -0.117632054, -0.009058229, 0.047830686, -0.01125145, 0.136628, 0.0056388285, 0.3028781, -0.12286517, 0.23498532, -0.009319075, -0.444048, 0.16174883, -0.06367683) * go_1(1.0, 0.0);
|
||||
result += mat4(0.02343933, -0.010915871, -0.058680378, -0.21886891, -0.010750894, -0.06671997, 0.0602906, -0.07903071, 0.066891186, 0.06650588, 0.14362891, -0.101870626, 0.02264628, -0.06940821, -0.077616625, 0.110911585) * go_1(1.0, 1.0);
|
||||
result += vec4(0.032014452, -0.020821465, 0.0826416, -0.002838458);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v3.2-Upscale-CNN-x2-(M)-Conv-4x3x3x8
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_1_tf
|
||||
//!SAVE conv2d_2_tf
|
||||
//!WIDTH conv2d_1_tf.w
|
||||
//!HEIGHT conv2d_1_tf.h
|
||||
//!COMPONENTS 4
|
||||
//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > *
|
||||
#define go_0(x_off, y_off) (max((conv2d_1_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max(-(conv2d_1_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.06963679, -0.07560548, -0.069522075, 0.0038078027, -0.08002613, 0.13671301, 0.084461786, -0.039376218, 0.19136548, -0.123174496, 0.26566333, -0.16583005, -0.18664864, -0.023539122, -0.21928434, -0.026818147) * go_0(-1.0, -1.0);
|
||||
result += mat4(0.16660932, -0.18558703, 0.37230486, 0.118128106, -0.14098641, 0.14659132, -0.22217897, 0.12952235, -0.4139033, -0.04308319, 0.12885277, -0.17986743, -0.23556231, -0.08351981, -0.43240538, 0.019033253) * go_0(-1.0, 0.0);
|
||||
result += mat4(-0.18008037, -0.04448665, 0.011906908, -0.023056917, 0.18136618, -0.04723555, -0.0050158803, -0.14823224, -0.2105281, 0.023047728, -0.14040631, -0.03178526, -0.13477588, -0.01820428, 0.058358394, 0.23792502) * go_0(-1.0, 1.0);
|
||||
result += mat4(0.07363309, -0.061728477, 0.03573137, -0.0050971056, -0.012813505, -0.17236637, 0.1697835, 0.055788577, -0.22263195, 0.10324512, 0.58971673, -0.4872246, -0.1555681, 0.032747746, -0.096495196, 0.070196226) * go_0(0.0, -1.0);
|
||||
result += mat4(0.14174286, 0.099460006, -0.088765986, 0.58350676, -0.025177564, -0.46004987, 0.37007022, -0.11437029, -0.5164534, -0.60465246, 0.38859612, -0.32846406, 0.050266482, -0.20334712, 0.18316261, -0.19327633) * go_0(0.0, 0.0);
|
||||
result += mat4(-0.09377763, -0.0012762006, -0.028991895, -0.26523829, 0.20173682, 0.037923716, -0.03174243, 0.07103378, -0.10764164, -0.30752546, 0.20556998, -0.1892279, 0.08115748, -0.023550175, -0.07627362, 0.11746628) * go_0(0.0, 1.0);
|
||||
result += mat4(-0.06998859, -0.017997518, 0.069938794, -0.14943017, -0.14179112, 0.16643842, -0.110231474, 0.08895815, -0.24074875, 0.3277253, -0.07435203, -0.23452802, 0.039962552, -0.07145652, -0.022511544, -0.04571222) * go_0(1.0, -1.0);
|
||||
result += mat4(-0.059785757, -0.23771374, -0.030571314, 0.25222278, 0.106601834, 0.34398326, 0.14511436, -0.03867526, -0.38982397, -0.11944689, 0.12997924, -0.13079585, 0.005729482, 0.012653905, -0.063693404, 0.09632285) * go_0(1.0, 0.0);
|
||||
result += mat4(-0.04933823, 0.0547175, 0.050636575, -0.10060694, 0.1344485, 0.19752938, -0.100068115, -0.028829506, -0.14096203, -0.079092234, 0.092109434, 0.011606209, -0.04052607, -0.008347507, 0.06956573, -0.028109524) * go_0(1.0, 1.0);
|
||||
result += mat4(0.21918017, -0.11115073, 0.2262453, -0.06889667, -0.11256312, -0.07438075, -0.088454485, 0.13672407, -0.06905764, 0.08128395, 0.016103368, 0.050190717, 0.09691516, 0.05845721, 0.4886816, 0.041121427) * go_1(-1.0, -1.0);
|
||||
result += mat4(-0.3449472, 0.09711974, -0.13881907, -0.018265123, 0.27855873, -0.07030004, 0.29545054, 0.37216932, 0.08657718, 0.099066615, -0.10574013, -0.17667885, -0.14855732, -0.11351448, 0.66945946, 0.11312157) * go_1(-1.0, 0.0);
|
||||
result += mat4(0.2526151, -0.04594331, -0.06606611, 0.09104881, 0.06857995, -0.075284235, -0.17664689, 0.21578754, 0.0696524, 0.09142951, 0.080997564, -0.0682772, -0.0011445724, -0.11736295, 0.2519232, -0.101926275) * go_1(-1.0, 1.0);
|
||||
result += mat4(-0.12913518, 0.058357026, 0.195421, -0.15651494, 0.2877076, 0.0033844314, -0.07831594, 0.052855384, -0.031295884, 0.03301088, -0.18408822, 0.06732994, 0.23742151, -0.12568143, 0.22810535, -0.11545694) * go_1(0.0, -1.0);
|
||||
result += mat4(-0.49203303, -0.22656603, 0.1723193, -0.51250046, -0.09742038, 0.758559, -0.3387505, -0.6193586, 0.14136684, 0.27679884, -0.050113205, 0.31041816, -0.36475047, -0.48746544, 0.3233227, 0.4579754) * go_1(0.0, 0.0);
|
||||
result += mat4(0.46636763, 0.1507748, -0.2581362, 0.15413165, -0.17160143, 0.14256273, -0.074575804, -0.099299066, -0.0017214464, 0.13778336, -0.07378213, -0.15489665, -0.10533715, -0.0011083825, 0.39584312, 0.0023906573) * go_1(0.0, 1.0);
|
||||
result += mat4(0.026959421, -0.06391859, 0.0034752619, 0.14521928, -0.0010877338, -0.032619733, 0.005375293, -0.018952755, 0.03381545, -0.007652831, 0.034141563, 0.046016496, 0.11219674, 0.030913852, 0.077403754, 0.17192438) * go_1(1.0, -1.0);
|
||||
result += mat4(0.040326044, 0.17290725, -0.1220239, -0.09594783, -0.025229257, 0.17913155, -0.26623353, -0.033396784, -0.03075146, 0.009143897, -0.0136083895, -0.13886899, 0.075683735, -0.11584183, 0.22182357, 0.19350322) * go_1(1.0, 0.0);
|
||||
result += mat4(0.15726025, -0.10215694, -0.060057458, 0.26487043, -0.04075552, -0.016496127, 0.0015382086, 0.108562306, 0.026795091, 0.0441233, -0.08754318, -0.0460157, 0.048422016, 0.14107347, 0.07986661, 0.1047697) * go_1(1.0, 1.0);
|
||||
result += vec4(0.0766796, 0.08115133, -0.05703058, 0.14025708);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v3.2-Upscale-CNN-x2-(M)-Conv-4x3x3x8
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_2_tf
|
||||
//!SAVE conv2d_3_tf
|
||||
//!WIDTH conv2d_2_tf.w
|
||||
//!HEIGHT conv2d_2_tf.h
|
||||
//!COMPONENTS 4
|
||||
//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > *
|
||||
#define go_0(x_off, y_off) (max((conv2d_2_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max(-(conv2d_2_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.18038331, 0.21830973, -0.10019419, -0.022745568, -0.14944611, -0.15669158, 0.46361133, -0.07289843, 0.02976627, -0.09000817, 0.113060996, 0.05635241, 0.012762965, -0.022688959, 0.01629751, 0.061114635) * go_0(-1.0, -1.0);
|
||||
result += mat4(0.024338024, -0.10004009, -0.13709056, -0.0851965, 0.23927099, -0.024349794, -0.16574804, 0.084686354, -0.047885604, 0.09688507, -0.12733915, 0.06980246, 0.11480734, 0.014669346, -0.07505829, 0.04676309) * go_0(-1.0, 0.0);
|
||||
result += mat4(0.054203495, 0.011881634, -0.036115017, -0.0686298, -0.13682245, -0.15678032, 0.057050128, -0.03368558, 0.13011025, 0.033391044, -0.09841339, -0.027057761, -0.18701133, 0.20852546, -0.13660902, 0.0005817616) * go_0(-1.0, 1.0);
|
||||
result += mat4(-0.08077834, 0.35952288, -0.07647382, -0.0033230998, 0.13929126, -0.09155619, 0.14128102, 0.16005981, 0.18161216, -0.09485738, 0.0029118075, 0.052682754, 0.03242074, 0.08299826, 0.073796146, -0.06446532) * go_0(0.0, -1.0);
|
||||
result += mat4(-0.36655015, 0.4606936, 0.19073649, 0.31655258, -0.006838053, -0.579939, 0.089126326, -0.14021218, -0.3437716, 0.16714323, 0.17705944, -0.22418492, -0.3883696, -0.2302651, 0.2581861, 0.21983066) * go_0(0.0, 0.0);
|
||||
result += mat4(0.0992383, -0.014257871, -0.023896435, 0.19868234, 0.0408007, 0.07995299, 0.16102871, -0.11668251, 0.22458278, -0.05587917, 0.19373615, -0.016202094, -0.25106144, 0.15634494, 0.11624891, -0.2930768) * go_0(0.0, 1.0);
|
||||
result += mat4(0.024616942, 0.36248252, -0.14779098, -0.019894283, -0.007111256, 0.010641561, -0.09541178, 0.21236233, 0.009501827, 0.08132797, -0.13983901, 0.027207611, 0.038444366, -0.013995817, -0.16242191, 0.03294123) * go_0(1.0, -1.0);
|
||||
result += mat4(0.0131698875, -0.18124102, -0.13503514, -0.06099072, 0.07422735, -0.20906176, -0.049005672, 0.08739405, -0.031758767, -0.1978915, 0.23094437, 0.54512614, 0.21338555, -0.011205669, -0.23727885, -0.29533875) * go_0(1.0, 0.0);
|
||||
result += mat4(-0.0010255767, -0.07168225, -0.033568826, 0.22161655, -0.087293416, 0.11350447, 0.13653576, 0.061226424, -0.13074352, 0.058425818, 0.038460605, 0.2749964, -0.012814839, 0.085885845, -0.038151987, -0.17960808) * go_0(1.0, 1.0);
|
||||
result += mat4(0.19728905, -0.040724937, -0.18270236, 0.046735186, 0.03507326, 0.119867206, -0.12691991, 0.18119748, -0.052895024, 0.11348764, -0.043787055, 0.004703516, 0.006752757, -0.06939761, -0.009801806, -0.075640485) * go_1(-1.0, -1.0);
|
||||
result += mat4(0.051735226, 0.1732299, -0.10672899, 0.0320877, -0.4913656, 0.2102274, 0.43920282, 0.059108034, 0.08349019, -0.16517872, 0.15436842, -0.1075667, 0.022741623, -0.26693836, 0.3645307, 0.017874828) * go_1(-1.0, 0.0);
|
||||
result += mat4(0.034464058, 0.014929155, 0.054227423, 0.14167373, -0.0023630706, -0.08904212, 0.11918041, -0.034539603, 0.06048089, -0.06807333, 0.14447778, 0.035260547, 0.09979546, -0.1924939, 0.14596114, -0.12069667) * go_1(-1.0, 1.0);
|
||||
result += mat4(-0.04427228, -0.23673469, 0.010357103, -0.2907043, -0.06845721, -0.078984015, 0.06867713, -0.058163825, -0.12154615, 0.08430951, 0.1922373, 0.030108064, -0.43081748, -0.38715646, -0.022240646, -0.15403675) * go_1(0.0, -1.0);
|
||||
result += mat4(0.46885306, -0.33421394, -0.6695223, -0.41841158, 0.30317923, 0.24244753, -0.1047785, -0.18656285, 0.06261881, -0.4405616, 0.24233986, 0.40070608, 0.81440526, 0.11305212, -0.8826317, -0.023478031) * go_1(0.0, 0.0);
|
||||
result += mat4(-0.07879348, -0.024378026, -0.041883785, -0.17030984, 0.23229122, -0.011237109, 0.12058088, 0.20766267, -0.36519575, 0.09599417, -0.1271098, 0.06990154, 0.21161246, 0.041002538, -0.36046275, 0.007304667) * go_1(0.0, 1.0);
|
||||
result += mat4(0.10873893, 0.003872542, -0.13476561, -0.036068805, -0.054637462, 0.02304618, 0.04707738, -0.2856381, 0.07124422, 0.010866545, 0.20484549, -0.008342406, -0.43660247, -0.041055538, 0.33536008, -0.060022205) * go_1(1.0, -1.0);
|
||||
result += mat4(0.1966458, 0.0016302796, -0.25712642, -0.09639119, -0.006955351, 0.10882133, 0.1107341, 0.062697805, -0.1074494, 0.17361663, 0.6429869, -0.39846307, -0.26302996, 0.048710946, 0.40387508, 0.4299715) * go_1(1.0, 0.0);
|
||||
result += mat4(0.18948616, 0.24086732, -0.064474985, -0.11069709, 0.1279659, -0.13438123, -0.028438117, 0.125883, 0.018153818, -0.21942288, 0.020390838, -0.22797634, -0.10821287, -0.17175092, 0.122016855, 0.20699544) * go_1(1.0, 1.0);
|
||||
result += vec4(-0.05101961, -0.060740646, -0.024465766, 0.058471628);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v3.2-Upscale-CNN-x2-(M)-Conv-4x3x3x8
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_3_tf
|
||||
//!SAVE conv2d_4_tf
|
||||
//!WIDTH conv2d_3_tf.w
|
||||
//!HEIGHT conv2d_3_tf.h
|
||||
//!COMPONENTS 4
|
||||
//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > *
|
||||
#define go_0(x_off, y_off) (max((conv2d_3_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max(-(conv2d_3_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.14533128, 0.07266841, 0.13238011, -0.23328504, 0.031516243, 0.058471266, -0.06394412, 0.090752736, -0.0042359144, 0.12357294, -0.04377495, 0.0011743477, 0.05412243, -0.08146249, 0.04002749, -0.032876283) * go_0(-1.0, -1.0);
|
||||
result += mat4(-0.036972385, -0.15238069, -0.3453321, -0.36025128, 0.07597202, -0.02368151, -0.3889606, 0.34607083, 0.3133179, -0.21712309, -0.4210954, 0.21450534, 0.15226828, 0.25326282, 0.45327064, -0.3350824) * go_0(-1.0, 0.0);
|
||||
result += mat4(0.019018406, -0.33060563, -0.092601225, 0.14970545, 0.1441509, -0.19228427, -0.032771986, 0.26331595, 0.052981265, -0.06627376, -0.08634131, 0.038706224, 0.13403937, -4.4842476e-05, 0.049002815, -0.12719193) * go_0(-1.0, 1.0);
|
||||
result += mat4(0.17527401, -0.0035254909, -0.047959115, -0.4526988, -0.07510284, 0.0013256798, -0.07539148, 0.24220634, -0.08708839, -0.14494033, -0.17085724, -0.099797316, 0.0068515535, -0.08918779, 0.27164719, -0.1702649) * go_0(0.0, -1.0);
|
||||
result += mat4(0.31848368, 0.48983255, -0.44140294, -0.65174145, -0.004199057, 0.19494705, 0.5196497, -0.027118586, 0.032509074, -0.23900363, -0.14489244, 0.36314297, -0.23168536, -0.20960593, 0.61471456, 0.12401275) * go_0(0.0, 0.0);
|
||||
result += mat4(-0.24317405, 0.21560913, 0.15564032, 0.11606844, -0.15039803, -0.59578896, 0.14100945, -0.026194477, 0.37237462, -0.49472088, -0.15215331, -0.38820064, -0.25089455, -0.29643852, -0.09513793, 0.019779462) * go_0(0.0, 1.0);
|
||||
result += mat4(0.12498539, 0.0710632, -0.25012368, -0.2272255, -0.08647026, 0.12277892, 0.011025097, -0.12168395, -0.13489573, 0.016708186, -0.15583871, -0.057124946, 0.1216943, 0.019803725, 0.06952334, -0.032985855) * go_0(1.0, -1.0);
|
||||
result += mat4(0.28794885, 0.33783793, -0.14469545, -0.081780486, -0.50320613, -0.067601606, -0.06847453, -0.021648854, -0.34295765, 0.15071863, -0.06619896, -0.084465064, 0.31909832, 0.015414661, 0.14930317, -0.11295768) * go_0(1.0, 0.0);
|
||||
result += mat4(0.24530606, 0.25526014, 0.09971985, -0.07749641, -0.2361951, -0.07997673, 0.03617294, 0.02959561, -0.4498983, -0.014073485, -0.20587012, 0.06396779, 0.1262825, 0.027433183, 0.14469334, 0.011538011) * go_0(1.0, 1.0);
|
||||
result += mat4(-0.038572453, -0.023108613, -0.039481267, -0.012160024, -0.004521989, -0.028665857, 0.04295255, 0.10580258, 0.05439479, -0.072261885, 0.11030243, 0.08934696, 0.09133867, 0.017547369, 0.097613186, 0.05491059) * go_1(-1.0, -1.0);
|
||||
result += mat4(-0.09972817, 0.057730395, 0.12665828, 0.32861367, -0.16186063, 0.0745509, 0.2394045, -0.08687853, -0.034404907, -0.05843572, 0.0684561, -0.1355754, 0.19248672, -0.60372186, 0.12583947, 0.4388962) * go_1(-1.0, 0.0);
|
||||
result += mat4(0.10341107, 0.061113223, 0.08773817, -0.082504354, -0.16612078, 0.2681751, 0.019737698, -0.17122322, -0.135949, 0.3048101, 0.087803006, 0.11373851, 0.013192192, -0.27022064, 0.35529897, -0.15321451) * go_1(-1.0, 1.0);
|
||||
result += mat4(-0.032835662, 0.11123062, -0.11322452, -0.17300649, 0.04680824, 0.12849288, 0.17269878, -0.048671383, 0.05189037, -0.009078046, 0.22105052, 0.013008137, -0.009738674, 0.15391739, 0.20969556, 0.14189166) * go_1(0.0, -1.0);
|
||||
result += mat4(-0.47377753, 0.3038031, 0.18604809, 0.1931698, -0.2964668, -0.12287907, -0.7107761, 0.26619422, -0.33923018, 0.19200724, 0.013786281, -0.17496964, 0.079325035, -0.3694445, 0.0054486147, -0.33018264) * go_1(0.0, 0.0);
|
||||
result += mat4(0.14903802, -0.028043179, 1.5238678e-05, 0.021232028, 0.16025065, 0.14746875, -0.22831628, -0.12177345, 0.038778774, 0.32188168, -0.042017702, 0.27155936, 0.17920609, 0.04099755, 0.28527525, 0.074623376) * go_1(0.0, 1.0);
|
||||
result += mat4(0.057019282, -0.112741895, 0.030361209, 0.14567861, 0.056265317, -0.01573537, -0.06707608, 0.016657263, 0.09829025, -0.026795063, 0.023042196, 0.09438241, -0.025483066, -0.052787006, 0.19730279, 0.021218104) * go_1(1.0, -1.0);
|
||||
result += mat4(0.19868211, -0.01531125, 0.108596824, -0.035456363, 0.0033609823, 0.057961613, -0.013726211, 0.101742364, 0.33357215, 0.14468077, 0.29711527, -0.24662566, -0.119014986, -0.1899639, 0.11246697, -0.0035374009) * go_1(1.0, 0.0);
|
||||
result += mat4(-0.05602109, -0.15539522, 0.010730943, 0.057116497, -0.02037749, 0.084210664, -0.028235348, 0.10574697, 0.056925274, 0.07922333, -0.090088, 0.1615985, -0.0044301567, -0.089945644, 0.024176618, -0.041844133) * go_1(1.0, 1.0);
|
||||
result += vec4(0.0015292584, -0.043625206, -0.09429898, -0.06280405);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v3.2-Upscale-CNN-x2-(M)-Conv-4x3x3x8
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_4_tf
|
||||
//!SAVE conv2d_5_tf
|
||||
//!WIDTH conv2d_4_tf.w
|
||||
//!HEIGHT conv2d_4_tf.h
|
||||
//!COMPONENTS 4
|
||||
//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > *
|
||||
#define go_0(x_off, y_off) (max((conv2d_4_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max(-(conv2d_4_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(0.06051604, -0.028152643, -0.21418124, 0.13032125, 0.42565975, -0.09571944, -0.34494513, 0.30004, -0.073245734, -0.028659137, 0.0032105136, -0.05009555, -0.048971225, 0.04814533, 0.002843805, -0.046224426) * go_0(-1.0, -1.0);
|
||||
result += mat4(-0.07495975, 0.018714864, 0.21229684, -0.13614887, 0.79988647, -0.0697328, 0.38232988, 0.24165109, 0.25947478, -0.0009418982, -0.17369923, 0.10007766, 0.024117598, 0.028611807, 0.15090801, -0.06344829) * go_0(-1.0, 0.0);
|
||||
result += mat4(-0.07982219, 0.0900347, 0.007609254, -0.0034791247, 0.013611781, -0.13560618, 0.09685799, 0.06276075, 0.134693, -0.14370437, -0.25175703, -0.0016138123, -0.0075672898, -0.13325731, -0.061100446, 0.0059743375) * go_0(-1.0, 1.0);
|
||||
result += mat4(-0.039018434, -0.19668463, -0.43018532, 0.31886247, 0.4965479, 0.114569925, 0.19110382, 0.27343535, 0.0707728, -0.11877004, -0.25827697, 0.37012872, 0.1474777, 0.07056952, -0.14965728, 0.061595406) * go_0(0.0, -1.0);
|
||||
result += mat4(0.506543, -0.16268773, 0.455319, -0.0702646, 0.70102173, -0.14041683, 0.70184857, 0.4817842, -0.3389246, -0.14463086, 0.13763213, -1.1259074, 0.47722015, 0.38352612, -0.04293366, -0.5604627) * go_0(0.0, 0.0);
|
||||
result += mat4(0.17606944, 0.15897374, 0.13499324, 0.29241478, -0.032824475, 0.11128662, -0.22204424, -0.051803727, 0.013195331, -0.42040786, -0.3950585, 0.70745844, 0.38646924, -0.19080774, -0.15171832, -0.10742828) * go_0(0.0, 1.0);
|
||||
result += mat4(-0.039278325, 0.18421806, -0.044948544, 0.07902063, -0.2149251, 0.09913459, -0.09743655, -0.26899317, -0.002695496, -0.07554527, -0.22373366, 0.17830558, -0.047994815, -0.06789183, -0.06755918, -0.104452066) * go_0(1.0, -1.0);
|
||||
result += mat4(-0.0493473, -0.30411786, -0.056439694, -0.06582185, -0.21309847, 0.100670904, -0.22966193, -0.045954112, 0.12728062, -0.25081897, -0.094699375, -0.4036555, 0.060854495, -0.64373237, -0.21522263, -0.6683476) * go_0(1.0, 0.0);
|
||||
result += mat4(0.063481025, 0.11744312, -0.043330096, 0.33817932, -0.06679828, -0.23207302, -0.10188898, -0.10590511, 0.058780864, 0.047292337, -0.11834696, 0.10076128, -0.036641665, 0.30200714, -0.0002892557, -0.10303763) * go_0(1.0, 1.0);
|
||||
result += mat4(-0.10842604, 0.042055763, 0.29702973, -0.07409644, -0.030164458, -0.012098744, -0.06396587, -0.08787527, 0.051854923, 0.12997511, 0.11468497, 0.15022379, 0.007814715, 0.014517445, 0.025484756, 0.01078619) * go_1(-1.0, -1.0);
|
||||
result += mat4(-0.29229385, 0.040265664, -0.15376821, 0.075579196, -0.05593569, -0.045405343, 0.12099204, 0.1571252, 0.17841713, 0.04673325, 0.14550509, 0.08603346, -0.049786013, 0.06121843, -0.16273825, -0.13857752) * go_1(-1.0, 0.0);
|
||||
result += mat4(0.06903744, 0.2628764, -0.13582836, -0.35678583, -0.13821034, -0.019381443, -0.19570538, -0.09298511, 0.08965436, 0.09745909, 0.20055099, 0.024967568, 0.08144204, 0.004633625, 0.12809834, -0.009431525) * go_1(-1.0, 1.0);
|
||||
result += mat4(0.09784006, 0.010729353, 0.046643205, -0.110926524, -0.21556224, 0.00016300633, 0.122175336, 0.15004392, 0.013864355, 0.24767809, 0.13865592, 0.0155424485, -0.1450483, -0.15688781, -0.06195043, -0.13745981) * go_1(0.0, -1.0);
|
||||
result += mat4(0.018991318, 0.55401963, 0.11709872, -0.028442185, -0.46035343, -0.10215539, -0.60193926, 0.47882316, -0.23346989, 0.037200127, 0.22814943, -0.08231696, -0.36430013, -0.011152757, 0.48752213, 0.29796222) * go_1(0.0, 0.0);
|
||||
result += mat4(-0.07258066, -0.023222538, 0.23230423, -0.30317304, 0.03942911, -0.06899803, 0.23778579, 0.07418621, -0.17443737, 0.33387753, 0.007354842, -0.123447575, -0.1745315, 0.11071779, -0.11949625, -0.22832453) * go_1(0.0, 1.0);
|
||||
result += mat4(-0.024909232, -0.0308135, 0.12170621, -0.13298757, 0.045828197, -0.1532345, -0.06633672, 0.23591088, 0.04964077, 0.14091493, 0.038343724, -0.029780807, 0.05762822, -0.048930667, -0.02434709, 0.07109019) * go_1(1.0, -1.0);
|
||||
result += mat4(-0.16039175, 0.3004474, -0.17278233, 0.13677922, 0.18838613, 0.15054552, 0.32901475, -0.1288333, 0.26378244, -0.05119892, 0.34533516, 0.25180495, 0.19452183, 0.0843233, -0.08029368, 0.39877903) * go_1(1.0, 0.0);
|
||||
result += mat4(-0.07097129, -0.26492423, -0.055032317, -0.093516104, -0.11795062, 0.04086253, -0.07989471, 0.059686553, 0.09378249, 0.45851848, 0.2510942, 0.19599153, 0.019765077, -0.02920918, -0.04125142, -0.13859107) * go_1(1.0, 1.0);
|
||||
result += vec4(0.04400571, -0.04015565, 0.0140529545, 0.05474095);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v3.2-Upscale-CNN-x2-(M)-Conv-4x3x3x8
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_5_tf
|
||||
//!SAVE conv2d_6_tf
|
||||
//!WIDTH conv2d_5_tf.w
|
||||
//!HEIGHT conv2d_5_tf.h
|
||||
//!COMPONENTS 4
|
||||
//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > *
|
||||
#define go_0(x_off, y_off) (max((conv2d_5_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max(-(conv2d_5_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.014236042, -0.0031431736, -0.1551387, 0.12515116, -0.28528872, 0.36161992, 0.15750743, -0.17111474, 0.13792591, -0.0657419, -0.17471549, 0.14650472, 0.034169197, -0.019157575, 0.23520657, -0.20358163) * go_0(-1.0, -1.0);
|
||||
result += mat4(0.02015035, 0.12993371, 0.11199667, -0.09854378, 0.5001741, 0.03462961, 0.24919736, 0.08505297, -0.20902094, -0.24141377, -0.15360375, 0.049974803, -0.037157424, -0.048510186, 0.20106035, -0.118480384) * go_0(-1.0, 0.0);
|
||||
result += mat4(0.086798504, -0.009607818, 0.034812123, -0.005187592, 0.0351509, 0.021755, -0.04996161, -0.041231696, 0.0020545553, 0.015730752, -0.07507172, 0.018597523, -0.02393343, 0.07624775, 0.03892451, -0.0025574185) * go_0(-1.0, 1.0);
|
||||
result += mat4(0.035725456, 0.06809103, 0.51926994, -0.39983147, -0.16402833, -0.1243394, -0.25922915, 0.28285915, 0.15959994, -0.2351732, 0.2650535, -0.30193794, -0.11468332, 0.050777763, -0.51894253, 0.4408367) * go_0(0.0, -1.0);
|
||||
result += mat4(-0.27042082, 0.22243942, 0.14902467, 0.38428563, 0.46612173, 0.5169912, -0.22330502, -0.11300288, -0.36141354, 0.0668681, 0.2984152, 0.1275798, -0.24121419, 0.2952039, -0.45109174, -0.3822957) * go_0(0.0, 0.0);
|
||||
result += mat4(0.26543504, -0.05742226, -0.052103903, -0.013124308, -0.14358385, -0.04024543, 0.07665455, -0.012301872, -0.18752757, -0.03913891, 0.038205814, -0.006583095, -0.25550908, -0.25725332, -0.12454206, -0.0058936924) * go_0(0.0, 1.0);
|
||||
result += mat4(-0.0018946569, 0.019746022, -0.13080788, 0.11450627, -0.013743845, -0.027179785, -0.14425103, 0.07109661, 0.023703793, 0.086905524, 0.03151253, 0.0132474145, 0.041018624, 0.04548913, 0.2718715, -0.20008296) * go_0(1.0, -1.0);
|
||||
result += mat4(-0.076830454, 0.11652955, 0.5068201, -0.3082819, 0.058615055, -0.006765798, -0.057522714, 0.049981344, -0.006897243, -0.21763432, 0.16896053, -0.21176189, -0.061227098, 0.03566485, 0.08901554, -0.050980624) * go_0(1.0, 0.0);
|
||||
result += mat4(0.02327798, 0.07662976, 0.034811985, -0.03238033, -0.0021881019, -0.030997375, -0.069672935, 0.04040273, -0.1217442, 0.104173124, 0.09862539, 0.020557549, -0.022286594, 0.10287763, -0.021694934, 0.07542515) * go_0(1.0, 1.0);
|
||||
result += mat4(0.124069154, -0.08579466, -0.07816314, 0.11332851, -0.034682628, -0.11038275, 0.04750615, -0.096100725, 0.039588403, -0.15149672, -0.05529172, 0.034304325, -0.022520235, -0.05023852, -0.2674731, 0.21886522) * go_1(-1.0, -1.0);
|
||||
result += mat4(-0.1948599, -0.14946899, -0.39548838, 0.18042913, -0.007919619, 0.19826505, 0.23789087, 0.009140256, 0.11857748, 0.18215668, 0.13606293, -0.09209675, -0.080678545, -0.020431137, -0.07728839, -0.051353537) * go_1(-1.0, 0.0);
|
||||
result += mat4(-0.07616472, -0.0032800382, -0.045657665, -0.039144326, -0.37786487, -0.08877774, 0.053579114, -0.070886396, 0.011311804, 0.107276045, 0.013236154, 0.009832061, 0.08292063, 0.12258811, 0.0005569043, -0.009806432) * go_1(-1.0, 1.0);
|
||||
result += mat4(-0.28062925, 0.15946878, -0.1021801, -0.06471589, -0.26999477, 0.21230288, -0.14243907, 0.2555922, -0.09608517, 0.26339412, 0.20891234, -0.23538485, 0.33958244, -0.12569186, 0.43289876, -0.33462036) * go_1(0.0, -1.0);
|
||||
result += mat4(0.16265294, 0.2625464, -0.34452894, 0.2233622, 0.13850005, -0.42999864, -0.5385177, -0.11035979, 0.51662, -0.78238726, -0.09422375, 0.83759475, 0.44468537, 0.14301361, 0.108906105, 1.1596143) * go_1(0.0, 0.0);
|
||||
result += mat4(-0.73757625, -0.12369605, 0.23523071, 0.006587637, -0.15445381, 0.22757277, 0.052819528, 0.10183905, -0.07912228, -0.16998893, -0.13360223, 0.014348178, -0.17778571, -0.41047302, 0.10241381, -0.08526306) * go_1(0.0, 1.0);
|
||||
result += mat4(0.14712952, 0.048995696, 0.05299946, -0.06817572, 0.1498064, -0.079825334, 0.40354064, -0.31789717, -0.1998377, 0.00955295, -0.32318407, 0.30898204, -0.039571725, -0.026203401, -0.16292085, 0.08574385) * go_1(1.0, -1.0);
|
||||
result += mat4(-0.6353329, -0.56000775, -0.17279743, 0.18198174, -0.19555812, 0.056538377, 0.34365895, -0.07799055, 0.19011354, -0.13952748, 0.029196098, -0.19596763, -0.069196045, -0.17402656, 0.07948411, -0.016226962) * go_1(1.0, 0.0);
|
||||
result += mat4(0.25592864, 0.083498634, -0.28515807, 0.10789751, 0.0043962947, 0.07085363, 0.048724182, -0.025131436, -0.0049440865, -0.033094388, -0.032935806, 0.04266025, 0.20026933, 0.0927841, -0.006839351, -0.013012285) * go_1(1.0, 1.0);
|
||||
result += vec4(0.02021373, 0.0014037411, 0.0012718709, 0.017278494);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v3.2-Upscale-CNN-x2-(M)-Conv-4x1x1x56
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_tf
|
||||
//!BIND conv2d_1_tf
|
||||
//!BIND conv2d_2_tf
|
||||
//!BIND conv2d_3_tf
|
||||
//!BIND conv2d_4_tf
|
||||
//!BIND conv2d_5_tf
|
||||
//!BIND conv2d_6_tf
|
||||
//!SAVE conv2d_last_tf
|
||||
//!WIDTH conv2d_tf.w
|
||||
//!HEIGHT conv2d_tf.h
|
||||
//!COMPONENTS 4
|
||||
//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > *
|
||||
#define g_0 (max((conv2d_tf_tex(conv2d_tf_pos)), 0.0))
|
||||
#define g_1 (max(-(conv2d_tf_tex(conv2d_tf_pos)), 0.0))
|
||||
#define g_2 (max((conv2d_1_tf_tex(conv2d_1_tf_pos)), 0.0))
|
||||
#define g_3 (max(-(conv2d_1_tf_tex(conv2d_1_tf_pos)), 0.0))
|
||||
#define g_4 (max((conv2d_2_tf_tex(conv2d_2_tf_pos)), 0.0))
|
||||
#define g_5 (max(-(conv2d_2_tf_tex(conv2d_2_tf_pos)), 0.0))
|
||||
#define g_6 (max((conv2d_3_tf_tex(conv2d_3_tf_pos)), 0.0))
|
||||
#define g_7 (max(-(conv2d_3_tf_tex(conv2d_3_tf_pos)), 0.0))
|
||||
#define g_8 (max((conv2d_4_tf_tex(conv2d_4_tf_pos)), 0.0))
|
||||
#define g_9 (max(-(conv2d_4_tf_tex(conv2d_4_tf_pos)), 0.0))
|
||||
#define g_10 (max((conv2d_5_tf_tex(conv2d_5_tf_pos)), 0.0))
|
||||
#define g_11 (max(-(conv2d_5_tf_tex(conv2d_5_tf_pos)), 0.0))
|
||||
#define g_12 (max((conv2d_6_tf_tex(conv2d_6_tf_pos)), 0.0))
|
||||
#define g_13 (max(-(conv2d_6_tf_tex(conv2d_6_tf_pos)), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.0067711817, 0.08160003, 0.0247279, 0.03084815, -0.026977416, -0.02120602, -0.025078611, -0.029852165, -0.011627478, -0.012742972, 0.022736797, -0.0028815821, -0.007515677, 0.0172887, -0.023259213, 0.009608947) * g_0;
|
||||
result += mat4(-0.028660107, -0.014015208, -0.027838672, -0.013171922, 0.0029435428, 0.027047642, -0.017478354, 0.022834882, -0.037572853, -0.0034044068, -0.0149029335, -0.013362301, 0.009827443, -0.015742151, -0.0074795415, -0.0022266617) * g_1;
|
||||
result += mat4(-0.07579662, -0.039754186, -0.066026606, -0.046816852, 0.1099032, 0.043956704, 0.073109835, 0.04680284, -0.06896613, -0.008838632, -0.044584926, -0.01319039, -0.0021152915, -0.04503326, 0.027061926, -0.028334105) * g_2;
|
||||
result += mat4(0.15458213, 0.059769996, 0.09327123, -0.028782733, 0.023459995, -0.15390377, -0.13432898, -0.1127775, 0.072764635, -0.0020463336, 0.034736466, -0.0012086042, -0.05847183, -0.029952323, 0.052969377, 0.09590908) * g_3;
|
||||
result += mat4(-0.07476772, -0.016574614, 0.04131183, 0.017335678, 0.009654406, 0.072183535, -0.002266456, 0.086873695, 9.310129e-05, 0.0056416965, -0.004188391, 0.023132093, -0.05183336, -0.025825873, -0.03684392, -0.0075729224) * g_4;
|
||||
result += mat4(0.00878842, 0.03869637, -0.035759524, 0.003345386, -0.064184256, -0.034568302, -0.06672922, -0.0686381, -0.06794392, -0.10685906, 0.04679947, -0.012535639, 0.006932529, -0.007783515, 0.109123886, 0.13804391) * g_5;
|
||||
result += mat4(-0.03160699, 0.050473, -0.09030729, 0.0649397, 0.11466501, 0.17912874, -0.0081851315, 0.052244574, 0.051632743, 0.061941486, 0.06546816, 0.12174249, -0.05104755, -0.018193979, -0.032196652, -0.035292786) * g_6;
|
||||
result += mat4(0.013612735, -0.0024100312, -0.068611205, -0.07369285, -0.019647537, -0.066944756, -0.010012875, -0.06785739, -0.062246565, -0.087313406, -0.044278186, -0.09368995, 0.052555013, 0.13604961, 0.05645059, 0.08763303) * g_7;
|
||||
result += mat4(0.04218486, -0.05028401, 0.059086576, -0.03545452, 0.027737848, 0.0043074046, 0.0011001764, -0.073026665, -0.04094988, 0.044061556, -0.009812515, 0.06841999, -0.06612581, 0.037223976, -0.07759491, -0.04356598) * g_8;
|
||||
result += mat4(-0.027558247, 0.014248466, -0.019813016, -0.058107473, -0.016717663, -0.020424338, 0.0053625097, -0.009917319, 0.013678771, 0.0113340765, 0.0061787106, -0.036083996, -0.020179711, -0.011310535, 0.054827053, -0.0008278952) * g_9;
|
||||
result += mat4(0.028690035, -0.012079616, 0.11931408, -0.048533775, 0.069336995, 0.0049852817, 0.013774468, 0.035233382, -0.07384821, 0.0003354423, -0.0059171803, -0.04503906, 0.08727279, 0.005138857, -0.17724465, 0.055782065) * g_10;
|
||||
result += mat4(-0.20744391, 0.24348328, -0.3145766, 0.17026486, -0.022870807, -0.01648648, -0.05912279, -0.012555373, -0.066004686, 0.03182394, 0.16285324, -0.1221846, -0.31816196, 0.007928748, 0.43180224, -0.015949022) * g_11;
|
||||
result += mat4(0.16363169, 0.14781676, -0.2377973, -0.1571377, -0.09038187, 0.0046504294, 0.033955004, -0.051421452, 0.046735536, 0.006827522, -0.121338, 0.12671822, 0.15833299, -0.1858712, -0.1942371, 0.17336044) * g_12;
|
||||
result += mat4(-0.018145572, -0.015550516, 0.044410378, 0.046016492, 0.084021375, 0.05327457, -0.008270992, -0.045435544, 0.07185879, -0.131923, 0.26721445, -0.26745328, -0.07093472, 0.042701527, 0.13793674, -0.095621444) * g_13;
|
||||
result += vec4(0.016836504, 0.010161949, 0.021351453, 0.01278978);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v3.2-Upscale-CNN-x2-(M)-Depth-to-Space
|
||||
//!HOOK MAIN
|
||||
//!BIND MAIN
|
||||
//!BIND conv2d_last_tf
|
||||
//!SAVE MAIN
|
||||
//!WIDTH conv2d_last_tf.w 2 *
|
||||
//!HEIGHT conv2d_last_tf.h 2 *
|
||||
//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > *
|
||||
vec4 hook() {
|
||||
vec2 f0 = fract(conv2d_last_tf_pos * conv2d_last_tf_size);
|
||||
ivec2 i0 = ivec2(f0 * vec2(2.0));
|
||||
float c0 = conv2d_last_tf_tex((vec2(0.5) - f0) * conv2d_last_tf_pt + conv2d_last_tf_pos)[i0.y * 2 + i0.x];
|
||||
float c1 = c0;
|
||||
float c2 = c1;
|
||||
float c3 = c2;
|
||||
return vec4(c0, c1, c2, c3) + MAIN_tex(MAIN_pos);
|
||||
}
|
300
mpv/shaders-old/Anime4K_Upscale_Denoise_CNN_x2_M.glsl
Executable file
300
mpv/shaders-old/Anime4K_Upscale_Denoise_CNN_x2_M.glsl
Executable file
|
@ -0,0 +1,300 @@
|
|||
// MIT License
|
||||
|
||||
// Copyright (c) 2019-2021 bloc97
|
||||
// All rights reserved.
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
//!DESC Anime4K-v3.2-Upscale-Denoise-CNN-x2-(M)-Conv-4x3x3x3
|
||||
//!HOOK MAIN
|
||||
//!BIND MAIN
|
||||
//!SAVE conv2d_tf
|
||||
//!WIDTH MAIN.w
|
||||
//!HEIGHT MAIN.h
|
||||
//!COMPONENTS 4
|
||||
//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > *
|
||||
#define go_0(x_off, y_off) (MAIN_texOff(vec2(x_off, y_off)))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.029052526, 0.059789784, -0.024398074, 0.06907132, 0.18920785, -0.12923062, 0.0766382, -0.12048348, -0.017786544, 0.06251133, -0.068393864, 0.056690093, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, -1.0);
|
||||
result += mat4(0.14032267, -0.077691495, -0.009036259, -0.13049065, 0.20954624, 0.023231741, -0.2759354, 0.49927905, 0.039609738, -0.092625424, 0.09426452, -0.2246486, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, 0.0);
|
||||
result += mat4(-0.023119625, 0.046549924, 0.073033765, 0.03727065, 0.04498207, 0.024455868, 0.17602317, -0.3150503, 0.019985953, 0.03670126, 0.0071220254, 0.107966185, 0.0, 0.0, 0.0, 0.0) * go_0(-1.0, 1.0);
|
||||
result += mat4(0.111121014, -0.084099665, 0.12595509, -0.048271902, -0.007799661, 0.04831373, 0.11868961, 0.11607051, 0.05169621, -0.050569464, 0.120362274, 0.034607537, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, -1.0);
|
||||
result += mat4(-0.41167754, -0.44940078, 0.35485214, 0.58048695, -1.0151424, -0.70137614, 0.38405335, 0.37337455, -0.096364655, -0.14538667, 0.17917591, 0.32259464, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, 0.0);
|
||||
result += mat4(0.06378494, -0.040756933, -0.4773648, -0.47702238, 0.1803328, -0.21388084, -0.5509359, -0.6491179, -0.048081584, -0.0025129975, -0.28561604, -0.22229671, 0.0, 0.0, 0.0, 0.0) * go_0(0.0, 1.0);
|
||||
result += mat4(-0.037024107, 0.016497454, -0.05315267, -0.023392007, 0.1840294, 0.12675077, 0.037417043, -0.022394283, -0.028192522, -0.016344562, -0.07269005, -0.04747136, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, -1.0);
|
||||
result += mat4(0.039480202, 0.5577544, -0.117326505, 0.06622856, -0.038784727, 0.65673745, -0.109742545, 0.22294083, 0.00038519394, 0.24552485, -0.07008514, 0.00029412706, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, 0.0);
|
||||
result += mat4(-0.009279719, -0.031882852, 0.14124188, -0.0759899, -0.024016602, 0.15252088, 0.13614258, -0.09961189, 0.05446014, -0.03827061, 0.11210173, -0.028823104, 0.0, 0.0, 0.0, 0.0) * go_0(1.0, 1.0);
|
||||
result += vec4(0.012836382, -0.0062823873, -0.03165346, -0.0017501811);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v3.2-Upscale-Denoise-CNN-x2-(M)-Conv-4x3x3x8
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_tf
|
||||
//!SAVE conv2d_1_tf
|
||||
//!WIDTH conv2d_tf.w
|
||||
//!HEIGHT conv2d_tf.h
|
||||
//!COMPONENTS 4
|
||||
//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > *
|
||||
#define go_0(x_off, y_off) (max((conv2d_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max(-(conv2d_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.06215308, -0.054471835, 0.1285146, 0.037585296, -0.14467795, 0.0057610427, 0.006528968, 0.18607244, 0.03762581, -0.121003255, 0.0827445, 0.076479666, 0.07540097, 0.16371846, -0.18786757, -0.12048073) * go_0(-1.0, -1.0);
|
||||
result += mat4(-0.11520603, -0.22384967, 0.0970881, 0.045122143, -0.40358877, 0.12487416, -0.4489702, 0.04854906, -0.08240888, -0.0058777514, 0.19108902, 0.042189106, -0.07843178, 0.0012592699, -0.11303816, -0.1118517) * go_0(-1.0, 0.0);
|
||||
result += mat4(0.29387334, 0.08150406, -0.06009834, 0.07054583, -0.146034, 0.04053809, 0.23284695, -0.08233496, 0.0957811, 0.20221621, 0.13570721, -0.081069246, -0.031743366, -0.038912926, -0.059060514, 0.05190416) * go_0(-1.0, 1.0);
|
||||
result += mat4(0.18404631, -0.034244366, -0.13406059, 0.2242061, -0.23668705, -0.10359684, -0.09689738, -0.04932347, -0.0020525968, 0.15236467, -0.2634303, -0.029878438, 0.3283669, 0.09891668, -0.46656898, -0.03271751) * go_0(0.0, -1.0);
|
||||
result += mat4(-0.1824976, -1.0545974, 0.93027455, -0.13887188, 0.3128633, -0.2734884, -0.831517, -0.18065166, -0.2119423, 0.19241124, -0.13313763, -0.10523897, 0.2675327, -0.06853148, 0.007885104, 0.26000848) * go_0(0.0, 0.0);
|
||||
result += mat4(-0.18109167, -0.019768981, -0.14131357, -0.3181756, 0.22158594, 0.1431138, -0.12970252, -0.011459096, -0.03742945, 0.2316056, -0.054623842, -0.09360549, 0.10176328, -0.108150974, 0.122787155, 0.07614884) * go_0(0.0, 1.0);
|
||||
result += mat4(-0.02370754, -0.10264054, 0.030659392, 0.056694325, 0.034085, -0.0538203, 0.09111551, 0.0063995267, 0.0835243, -0.06623529, 0.20924146, 0.09457414, 0.27925664, 0.049511474, -0.22062886, 0.03312504) * go_0(1.0, -1.0);
|
||||
result += mat4(0.17009354, 0.34391564, -0.1680695, -0.051450633, -0.044037253, -0.1412577, 0.01097572, -0.049040757, 0.104024716, -0.34571946, 0.5213214, -0.17010914, -0.016452854, 0.3303069, -0.22249438, 0.23866816) * go_0(1.0, 0.0);
|
||||
result += mat4(0.20491506, 0.20098424, 0.015425732, -0.033999693, -0.0111842435, 0.09945295, -0.025766203, 0.17068656, 0.049262784, 0.0077788536, 0.068585835, 0.19229786, -0.013048818, 0.04877973, 0.024053875, -0.06846659) * go_0(1.0, 1.0);
|
||||
result += mat4(0.14208305, 0.09790381, -0.008420949, -0.016165754, 0.02445528, 0.08700781, 0.046639573, -0.22105917, -0.08529265, 0.06606378, 0.0947481, 0.08149193, -0.0959293, -0.037756894, -0.008136973, 0.046241503) * go_1(-1.0, -1.0);
|
||||
result += mat4(0.2577669, 0.13766493, 0.021107635, 0.018978242, 0.452542, 0.25566816, -0.68909633, 0.03804329, 0.06771752, 0.07894156, 0.22501312, -0.047511246, 0.00040517355, -0.0202232, -0.27541754, -0.040150844) * go_1(-1.0, 0.0);
|
||||
result += mat4(-0.30176973, -0.15739526, -0.038548045, -0.07003333, 0.32053417, 0.025467036, -0.044913124, 0.20454903, 0.12475206, -0.03966162, 0.07139637, 0.12101497, -0.10777517, -0.062379625, 0.06598757, -0.14795317) * go_1(-1.0, 1.0);
|
||||
result += mat4(0.12068516, 0.0026514034, -0.055378057, -0.0976728, 0.15887645, 0.15590422, 0.076294206, -0.15417404, -0.16548084, -0.18422292, -0.1670212, 0.041155312, -0.11765263, 0.16991171, -0.21535093, 0.01542368) * go_1(0.0, -1.0);
|
||||
result += mat4(-0.37845853, 0.5732961, 0.114283465, 0.14638355, -0.109194644, 0.087304994, -0.15938401, 0.58242995, -0.025850652, 0.02730721, -0.48582682, -0.2547883, 0.1899583, 0.24296008, -0.8162976, 0.018036429) * go_1(0.0, 0.0);
|
||||
result += mat4(0.1633212, -0.117295206, 0.021892091, 0.07762347, -0.09726402, -0.1364192, 0.10752197, 0.42020246, 0.06665656, -0.10822656, 0.1337331, 0.0552859, 0.04700212, 0.108017646, -0.2009353, -0.0435288) * go_1(0.0, 1.0);
|
||||
result += mat4(-0.045603696, 0.05774526, -0.0071174325, 0.24119262, -0.06899063, 0.016012343, 0.009982042, -0.19038968, -0.17796072, -0.12510185, 0.22739507, -0.1805478, -0.100294635, 0.017557602, 0.039842658, 0.13116726) * go_1(1.0, -1.0);
|
||||
result += mat4(0.0131523665, -0.20472725, 0.121814765, -0.17769355, 0.097669855, 0.09648846, -0.072887406, 0.22992326, -0.019087939, 0.35375193, -0.057155706, 0.17699116, 0.030690158, -0.423475, 0.03703492, -0.03429164) * go_1(1.0, 0.0);
|
||||
result += mat4(-0.12143413, -0.018402342, 0.04536776, -0.12743106, 0.03355068, -0.09694192, 0.09913357, -0.036602203, 0.11038047, 0.13236065, 0.12966877, -0.10163848, 0.0030612876, -0.116145626, 0.045318183, 0.11492169) * go_1(1.0, 1.0);
|
||||
result += vec4(0.05657016, -0.04848861, 0.10297782, -0.0076417355);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v3.2-Upscale-Denoise-CNN-x2-(M)-Conv-4x3x3x8
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_1_tf
|
||||
//!SAVE conv2d_2_tf
|
||||
//!WIDTH conv2d_1_tf.w
|
||||
//!HEIGHT conv2d_1_tf.h
|
||||
//!COMPONENTS 4
|
||||
//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > *
|
||||
#define go_0(x_off, y_off) (max((conv2d_1_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max(-(conv2d_1_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.088122115, -0.009916053, -0.124469265, -0.032139737, -0.13709281, 0.09177288, -0.06794775, -0.03962873, 0.17613642, -0.11064388, 0.2531882, -0.3817648, -0.1172188, -0.042132895, -0.098772734, -0.114560865) * go_0(-1.0, -1.0);
|
||||
result += mat4(0.18876404, -0.14613804, 0.23869626, 0.06580185, -0.13533239, 0.25754455, -0.29734856, 0.028218834, -0.39304733, -0.14716247, 0.19408274, -0.18518063, -0.31482637, -0.1508887, -0.3841371, 0.021975968) * go_0(-1.0, 0.0);
|
||||
result += mat4(-0.22316615, -0.0923483, 0.16932568, -0.13138154, 0.139829, 0.010975908, -0.0587337, -0.054484393, -0.13758336, -0.030077504, -0.050642505, -0.14933856, -0.040563874, -0.030220931, 0.2867556, 0.17022403) * go_0(-1.0, 1.0);
|
||||
result += mat4(0.12611523, -0.07087836, 0.08281469, 0.024588918, -0.023549056, -0.13102995, 0.17571726, 0.0740372, -0.3167631, 0.17491543, 0.4459055, -0.4687942, -0.19755729, 0.03723031, -0.06757113, 0.03502462) * go_0(0.0, -1.0);
|
||||
result += mat4(0.12098187, 0.12341856, -0.061940372, 0.7251308, 0.055730965, -0.5169302, 0.37959704, -0.08753306, -0.45700142, -0.4960699, 0.1690022, -0.40233734, 0.0262836, -0.13345262, 0.11002605, -0.16773209) * go_0(0.0, 0.0);
|
||||
result += mat4(-0.20428565, 0.117523015, -0.044863444, -0.1770644, 0.22925, 0.029694336, -0.23891294, 0.039587863, -0.11235541, -0.23890465, 0.037618574, -0.039127905, 0.14058869, 0.020599412, -0.074353516, 0.12343045) * go_0(0.0, 1.0);
|
||||
result += mat4(-0.04680316, -0.049870726, 0.06975308, -0.21486782, -0.08177838, 0.09760846, -0.031408366, 0.13881667, -0.14650045, 0.29182404, -0.080848776, -0.25525567, 0.018876432, -0.015662232, -0.016014043, -0.08435915) * go_0(1.0, -1.0);
|
||||
result += mat4(-0.100864016, -0.24647528, -0.007994345, 0.13047779, 0.14746517, 0.25517163, 0.054900885, -0.07251866, -0.29500577, -0.03758923, 0.05514366, -0.058372885, -0.03055354, -0.062586576, 0.017739896, 0.08644674) * go_0(1.0, 0.0);
|
||||
result += mat4(-0.029502464, -0.08905223, 0.0047584837, -0.09646073, 0.044714086, 0.15522493, -0.070930906, -0.026954453, 0.057949875, -0.017211404, -0.00566463, -0.0050975676, 0.0050182147, -0.010722001, 0.011812942, -0.04698445) * go_0(1.0, 1.0);
|
||||
result += mat4(0.18863353, -0.11575336, 0.26541254, -0.15280409, 0.14376, -0.05783716, 0.08554402, 0.27605456, 0.004611954, 0.074173525, -0.07963756, 0.082979314, 0.099553905, -0.06539344, 0.4330784, 0.07996894) * go_1(-1.0, -1.0);
|
||||
result += mat4(-0.31001288, 0.035875235, 0.049856357, -0.09614268, 0.23397788, -0.12425775, 0.45108303, 0.27973723, 0.0753222, 0.11388394, -0.043821793, -0.05610102, -0.06536777, 0.009822641, 0.7956708, -0.05798737) * go_1(-1.0, 0.0);
|
||||
result += mat4(0.19827974, 0.010130333, -0.13153136, 0.11593003, -0.15762039, -0.0040722084, 0.20404483, 0.28999883, 0.08152756, 0.07773477, 0.019730574, 0.0123460535, -0.034676805, -0.19133334, 0.01860159, -0.12945038) * go_1(-1.0, 1.0);
|
||||
result += mat4(-0.1861255, 0.039945368, 0.28345293, -0.17425321, 0.36748698, 0.03729066, -0.35957313, 0.11234573, -0.07122196, 0.012845119, -0.09049443, 0.10106711, 0.07425845, -0.14626606, 0.46169114, -0.2652126) * go_1(0.0, -1.0);
|
||||
result += mat4(-0.6222811, -0.08538015, 0.023319554, -0.7206892, -0.33495513, 0.2960924, -0.033479776, -0.29255456, 0.29802337, 0.47570458, 0.012769826, 0.19874385, -0.25652033, -0.4018595, 0.3055839, 0.1881051) * go_1(0.0, 0.0);
|
||||
result += mat4(0.32152474, 0.0024920676, -0.113435976, 0.14440896, -0.287736, 0.0251382, 0.28160754, 0.02769615, 0.067614004, 0.0832741, -0.095353454, -0.19792004, -0.40394694, -0.24224225, 0.3224996, 0.030300485) * go_1(0.0, 1.0);
|
||||
result += mat4(0.0045148246, -0.04621849, -0.026470715, 0.0588576, 0.14559188, 0.037437905, -0.13778603, 0.08173416, 0.033548757, -0.015654223, 0.15016593, 0.07761835, -0.016546778, 0.02640291, 0.112717085, 0.020371364) * go_1(1.0, -1.0);
|
||||
result += mat4(0.114227325, -0.0405595, -0.11662477, 0.014747093, 0.11170598, 0.58740836, -0.27560827, -0.1848705, -0.02491223, -0.15605451, 0.0028677192, -0.11290364, -0.12331832, -0.3191161, 0.3505101, 0.15236251) * go_1(1.0, 0.0);
|
||||
result += mat4(0.21131381, 0.13965495, -0.103683874, 0.26049778, -0.010777816, 0.015093082, 0.13207617, 0.14064828, -0.007847294, 0.025702007, -0.082993574, -0.04923462, -0.052900862, -0.006775377, 0.1432969, 0.09598549) * go_1(1.0, 1.0);
|
||||
result += vec4(0.08015534, 0.10264796, -0.031173404, 0.21282151);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v3.2-Upscale-Denoise-CNN-x2-(M)-Conv-4x3x3x8
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_2_tf
|
||||
//!SAVE conv2d_3_tf
|
||||
//!WIDTH conv2d_2_tf.w
|
||||
//!HEIGHT conv2d_2_tf.h
|
||||
//!COMPONENTS 4
|
||||
//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > *
|
||||
#define go_0(x_off, y_off) (max((conv2d_2_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max(-(conv2d_2_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.13262276, 0.18682314, -0.1433667, -0.0061677806, -0.15057871, -0.15389217, 0.40721065, -0.082456455, 0.028175479, -0.06136406, 0.13517159, -0.0066659097, -0.03311807, -0.056219388, 0.066265404, -0.017012158) * go_0(-1.0, -1.0);
|
||||
result += mat4(0.0652481, -0.02717338, -0.17586891, -0.1458622, 0.37166637, -0.13651049, -0.095090784, 0.1450258, -0.08856753, -0.029000161, -0.11024598, 0.14231622, 0.027118085, 0.060637098, -0.028174674, 0.020973917) * go_0(-1.0, 0.0);
|
||||
result += mat4(0.17137158, 0.015818363, -0.1761587, -0.07798954, -0.22039492, -0.08250406, 0.15350278, 0.05466543, 0.07231244, 0.124937475, -0.14530692, -0.036220204, -0.20202135, 0.16154502, -0.1472417, 0.045183204) * go_0(-1.0, 1.0);
|
||||
result += mat4(-0.06751513, 0.3630837, -0.23374555, -0.17641832, 0.23866339, -0.12625019, 0.14955078, 0.3757683, 0.25546572, -0.0009440543, -0.029705383, 0.12500505, 0.039303612, 0.02745342, 0.06280759, -0.027673393) * go_0(0.0, -1.0);
|
||||
result += mat4(-0.40253955, 0.5532656, 0.15580782, 0.23305601, 0.04307387, -0.37548792, 0.021682428, -0.14554474, -0.44655007, 0.12335231, 0.22693188, -0.19185324, -0.39905196, -0.36661598, 0.34626722, 0.3220371) * go_0(0.0, 0.0);
|
||||
result += mat4(0.13051705, -0.051269528, 0.027860573, 0.12866034, 0.095374286, 0.0072371624, 0.06641015, -0.040609945, 0.14411138, 0.03813084, 0.024812538, -0.069997884, -0.2398024, 0.16384888, 0.004522481, -0.2734798) * go_0(0.0, 1.0);
|
||||
result += mat4(-0.048976544, 0.36923414, -0.23769425, -0.02964149, 0.13426293, -0.070416726, -0.036279447, 0.21007125, -0.0062456504, 0.12307804, -0.18920022, 0.016429992, 0.091225415, -0.00714184, -0.079064, 0.050525308) * go_0(1.0, -1.0);
|
||||
result += mat4(0.007005748, -0.1929285, -0.27960134, -0.014070343, -0.012031938, -0.21320626, 0.22591045, 0.06750757, 0.038049847, -0.08933499, 0.15640227, 0.36653376, 0.11274315, 0.0015512784, -0.14319079, -0.41117874) * go_0(1.0, 0.0);
|
||||
result += mat4(0.039254356, 0.04123307, -0.14476523, 0.19676228, -0.1746638, 0.068685316, 0.19318552, -0.007086376, -0.08810745, 0.041937724, 0.1393943, 0.27539206, -0.08331265, 0.043064818, -0.02783017, -0.13006629) * go_0(1.0, 1.0);
|
||||
result += mat4(0.18761271, -0.009960496, -0.18572417, 0.010640895, 0.10240658, 0.036137953, -0.109363064, 0.05820501, -0.04092678, 0.11809751, -0.11843415, 0.11893309, -0.06356792, 0.1509876, -0.12252014, -0.0070098704) * go_1(-1.0, -1.0);
|
||||
result += mat4(-0.0012312894, 0.038436964, -0.046054237, 0.04859312, -0.4190657, 0.2529927, 0.23133701, -0.00065297337, -0.039581586, 0.00905735, 0.16532114, -0.12568031, 0.17818217, -0.28053075, 0.38509414, -0.03763847) * go_1(-1.0, 0.0);
|
||||
result += mat4(-0.0897875, 0.063593514, 0.07660054, 0.12268424, 0.21554653, -0.1025501, 0.2557211, 0.04492533, 0.10992355, -0.035215836, -0.009733763, -0.02165148, 0.08618596, -0.19276536, 0.18174514, -0.18021213) * go_1(-1.0, 1.0);
|
||||
result += mat4(-0.002999377, -0.12630916, -0.030010369, -0.2676409, -0.20229307, 0.15253967, -0.12200155, -0.1552754, -0.16193017, 0.10819683, 0.10696224, -0.1920264, -0.29354608, -0.32021165, 0.08644405, -0.16153689) * go_1(0.0, -1.0);
|
||||
result += mat4(0.49931613, -0.3669461, -0.49107462, -0.3654748, 0.32047966, 0.03246311, -0.06424334, 0.009108802, 0.2367612, -0.46587244, 0.16957493, 0.3237888, 0.93676794, 0.01834384, -0.9349752, -0.04654371) * go_1(0.0, 0.0);
|
||||
result += mat4(-0.112562165, 0.006074484, -0.12288025, -0.08560263, 0.25336134, 0.025205871, 0.25063732, 0.12370882, -0.40429187, 0.12992847, -0.2816234, 0.08179623, 0.27197668, 0.066299304, -0.12988937, 0.16257611) * go_1(0.0, 1.0);
|
||||
result += mat4(0.047864527, -0.05821779, -0.06311128, -0.0065775234, -0.065763995, 0.014864688, 0.09148591, -0.25059348, 0.008846306, -0.22123712, 0.4062609, -0.100248575, -0.50293785, -0.13373566, 0.21480446, -0.0841981) * go_1(1.0, -1.0);
|
||||
result += mat4(0.19313097, -0.061253734, -0.1801314, -0.20178059, -0.039574936, 0.08167749, 0.010974997, 0.069656976, -0.13193963, 0.35555324, 0.62686867, -0.28656846, -0.27831817, -0.0040086447, 0.4031064, 0.47767937) * go_1(1.0, 0.0);
|
||||
result += mat4(0.15396428, 0.069321476, -0.15190981, -0.24133344, 0.106151104, -0.11271092, 0.06878746, 0.14279713, -0.02006402, -0.36284852, -0.00926688, -0.39887694, -0.20926239, -0.021860912, 0.07588468, 0.2620174) * go_1(1.0, 1.0);
|
||||
result += vec4(-0.0073282495, -0.040352557, -0.063710704, 0.07255652);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v3.2-Upscale-Denoise-CNN-x2-(M)-Conv-4x3x3x8
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_3_tf
|
||||
//!SAVE conv2d_4_tf
|
||||
//!WIDTH conv2d_3_tf.w
|
||||
//!HEIGHT conv2d_3_tf.h
|
||||
//!COMPONENTS 4
|
||||
//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > *
|
||||
#define go_0(x_off, y_off) (max((conv2d_3_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max(-(conv2d_3_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(-0.17903937, -0.0014294779, 0.1824805, -0.19555633, -0.0052551827, -0.013796094, 0.06358042, 0.13301018, 0.008874768, 0.06605332, 0.06117636, 0.012946474, 0.048656575, 0.0060409275, -0.0671362, -0.06897735) * go_0(-1.0, -1.0);
|
||||
result += mat4(-0.16098012, 0.10772552, -0.13175552, -0.5299018, 0.068713695, -0.048258893, -0.49698257, 0.36581638, 0.21755004, -0.12125899, -0.27382872, -0.12268086, 0.014334542, 0.20573758, 0.45879167, -0.29648975) * go_0(-1.0, 0.0);
|
||||
result += mat4(0.06860283, -0.18047708, 0.024707617, 0.11900479, 0.09474589, -0.16559775, -0.054095846, -0.011377782, -0.008733984, 0.105020404, -0.040116277, -0.0022003972, 0.1453799, -0.032110006, -0.018741792, -0.12511599) * go_0(-1.0, 1.0);
|
||||
result += mat4(0.20024729, -0.01969923, -0.026999667, -0.39064395, -0.14559332, -0.11634086, -0.13226044, 0.11779975, -0.08838282, -0.0882447, -0.23166943, -0.15760234, 0.030928904, -0.032423917, 0.20324136, -0.19692755) * go_0(0.0, -1.0);
|
||||
result += mat4(0.49499384, 0.7327846, -0.6173799, -0.53821295, -0.15000962, 0.11169762, 0.6942423, 0.07956513, 0.06913002, -0.19037646, -0.19826908, 0.68080276, -0.2747096, -0.15832238, 0.47366706, 0.090432756) * go_0(0.0, 0.0);
|
||||
result += mat4(-0.18274948, 0.09204629, 0.16644076, 0.05641037, 0.03328184, -0.6218293, 0.26432592, -0.093742386, 0.33038342, -0.24853565, -0.23683667, -0.37430722, -0.20684583, -0.32283148, -0.07633969, -0.08765815) * go_0(0.0, 1.0);
|
||||
result += mat4(0.06821987, 0.06395764, -0.14685121, -0.15894371, -0.093540885, 0.057568345, -0.048376244, -0.009256543, -0.26325077, -0.03193119, -0.16857445, -0.02404981, 0.110593356, 0.042911418, 0.06626762, -0.0312436) * go_0(1.0, -1.0);
|
||||
result += mat4(0.3108626, 0.37123847, -0.082249805, -0.21339422, -0.3756041, -0.08518717, -0.16853802, 0.011641729, -0.30096757, 0.26942274, -0.08990497, -0.19451031, 0.21974437, -0.04231723, 0.26160353, -0.040834647) * go_0(1.0, 0.0);
|
||||
result += mat4(0.11795158, 0.24436565, 0.043223023, -0.0159957, -0.19689156, 0.13223267, -0.013983249, 0.09437164, -0.47648698, -0.00082660443, -0.085406005, 0.10885898, 0.104696035, -0.053257108, 0.024389362, 0.0282572) * go_0(1.0, 1.0);
|
||||
result += mat4(0.032890156, 0.0115719065, -0.01898909, -0.03034875, -0.041037276, -0.1026382, 0.03337663, 0.20108728, -0.00023235095, -0.018033072, -0.028535927, 0.07359915, 0.075182244, 0.02959868, 0.15107772, -0.09815672) * go_1(-1.0, -1.0);
|
||||
result += mat4(-0.004040557, 0.06707476, 0.039022792, 0.52437925, -0.08027356, 0.040488366, 0.035332825, 0.07683081, -0.03521227, -0.081861034, 0.090804815, 0.10580108, 0.20452882, -0.58755285, 0.04303056, 0.41562977) * go_1(-1.0, 0.0);
|
||||
result += mat4(0.09290062, 0.03495193, 0.02347216, -0.012873525, -0.076936446, 0.1453216, -0.03742271, -0.14174925, -0.058219753, 0.19095406, 0.055627216, 0.09437343, -0.010424211, -0.314692, 0.3314579, -0.053285643) * go_1(-1.0, 1.0);
|
||||
result += mat4(-0.053961687, 0.1483992, 0.042458896, -0.1966439, 0.13864957, 0.07587672, -0.06519269, 0.09530391, 0.04215073, 0.039545458, 0.21056756, 0.09972659, 0.02987125, -0.08102741, 0.07075036, 0.21867757) * go_1(0.0, -1.0);
|
||||
result += mat4(-0.5512795, 0.03104814, 0.27901977, 0.122875504, -0.2656715, 0.007895486, -0.6735937, 0.20810314, -0.31432617, 0.07420857, 0.2573659, -0.35361463, 0.19826569, -0.47774056, 0.15816487, -0.29203883) * go_1(0.0, 0.0);
|
||||
result += mat4(0.35078493, -0.07371588, -0.026663188, -0.20976657, -0.009644347, 0.037428845, -0.33933878, -0.010807704, 0.088060796, 0.16753472, -0.12296045, 0.17563403, 0.1501952, 0.07353703, 0.32531765, 0.11667607) * go_1(0.0, 1.0);
|
||||
result += mat4(0.096126616, -0.058021486, -0.03439203, 0.06868024, 0.047914367, 0.026945053, 0.04207778, 0.046023168, 0.16024022, 0.07846185, 0.004195093, 0.07272046, -0.10458233, -0.0904536, 0.16049337, 0.015941419) * go_1(1.0, -1.0);
|
||||
result += mat4(0.032256138, -0.055398785, 0.079738356, 0.113359064, 0.11975066, -0.074372105, 0.102006756, -0.011490042, 0.15155345, 0.0025528704, 0.23328577, -0.059241068, -0.067783386, -0.18220833, 0.0057692174, 0.039900843) * go_1(1.0, 0.0);
|
||||
result += mat4(-0.06173998, -0.07121991, -0.01118306, -0.063749574, -0.032665797, 0.0014987896, 0.03113169, 0.06916617, 0.0066490914, -0.052818965, -0.050131317, 0.10337558, -0.030870482, -0.14671221, 0.12152145, -0.05003445) * go_1(1.0, 1.0);
|
||||
result += vec4(-0.010524109, -0.008519857, -0.08958723, -0.07917139);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v3.2-Upscale-Denoise-CNN-x2-(M)-Conv-4x3x3x8
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_4_tf
|
||||
//!SAVE conv2d_5_tf
|
||||
//!WIDTH conv2d_4_tf.w
|
||||
//!HEIGHT conv2d_4_tf.h
|
||||
//!COMPONENTS 4
|
||||
//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > *
|
||||
#define go_0(x_off, y_off) (max((conv2d_4_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max(-(conv2d_4_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(0.11029161, 0.027180295, -0.115622066, 0.16493714, 0.29633296, -0.11739625, -0.36390316, 0.15221693, -0.009233659, -0.062213745, -0.07184558, 0.07418268, -0.05182182, 0.0066014086, -0.006811494, -0.010030367) * go_0(-1.0, -1.0);
|
||||
result += mat4(-0.18361749, 0.08565693, 0.24127418, -0.20478591, 0.6198113, -0.17994536, -0.011840256, 0.120292775, 0.2873902, -0.019704796, -0.062267166, 0.0104749305, -0.048370067, -0.028105626, 0.11494511, -0.15941763) * go_0(-1.0, 0.0);
|
||||
result += mat4(-0.08084502, 0.10195475, -0.03200553, 0.032734055, 0.030348243, -0.028927604, 0.045914374, 0.029237835, 0.07756032, -0.06346545, -0.290196, 0.057043966, 0.13982558, -0.12195619, -0.15895663, -0.10097537) * go_0(-1.0, 1.0);
|
||||
result += mat4(-0.12018707, -0.320156, -0.4089669, 0.26015735, 0.59622765, -0.05654362, 0.28581724, 0.32069868, -0.0013007161, -0.060870633, -0.2732852, 0.2357145, 0.2137239, 0.0110256495, -0.069258444, 0.113870576) * go_0(0.0, -1.0);
|
||||
result += mat4(0.54700065, -0.072552234, 0.27267826, -0.26660076, 0.7043544, 0.18192886, 0.80024594, 0.2447395, -0.3289639, -0.2681839, 0.063631415, -1.0118654, 0.45691678, 0.42904988, -0.2301862, -0.6652257) * go_0(0.0, 0.0);
|
||||
result += mat4(0.19215634, 0.030154131, 0.07679603, 0.50318545, 0.056434657, 0.028623195, -0.14471184, -0.13905096, -0.03254216, -0.1191584, -0.18907212, 0.49208716, 0.5069476, -0.1490824, -0.104480386, -0.06595394) * go_0(0.0, 1.0);
|
||||
result += mat4(-0.08893682, 0.13113782, 0.023672188, 0.013086517, -0.25986442, 0.038162243, -0.10951209, -0.2027832, -0.013547809, -0.029482972, -0.17670235, 0.13529542, -0.0621569, -0.0979757, -0.10714689, -0.08474307) * go_0(1.0, -1.0);
|
||||
result += mat4(-0.032828752, 0.00037559783, 0.023968933, -0.047482926, -0.20302027, 0.08830911, -0.20885307, -0.11137413, 0.16585048, -0.076796696, -0.030462325, -0.2020944, 0.048723634, -0.45607433, -0.29950324, -0.5867916) * go_0(1.0, 0.0);
|
||||
result += mat4(0.008863689, 0.061761267, -0.039097138, 0.24465923, -0.05917457, -0.21383028, -0.085846715, -0.14150433, 0.0988731, -0.0160538, -0.045119412, 0.095252946, -0.057551738, 0.21348421, -0.03480491, -0.26071647) * go_0(1.0, 1.0);
|
||||
result += mat4(-0.21351442, 0.10038809, 0.34001955, -0.100911774, 0.0208522, -0.028755441, 0.025793588, 0.013080005, 0.03849989, 0.13662058, 0.04311886, 0.17398632, -0.01397261, -0.016415505, -0.0070752064, 0.007656161) * go_1(-1.0, -1.0);
|
||||
result += mat4(-0.280189, 0.09252764, -0.077729605, 0.12662902, -0.10433321, 0.03644144, -0.06625324, 0.05696802, 0.15468478, 0.08328583, 0.069849946, 0.061947342, -0.05560477, -0.0074776993, -0.15365681, -0.03526299) * go_1(-1.0, 0.0);
|
||||
result += mat4(0.05886785, 0.15303846, 0.0066637015, -0.19983207, -0.07803175, -0.10772685, -0.12690999, -0.08275092, 0.033436153, 0.08424011, 0.17092863, 0.0043526487, 0.014620474, 0.044702258, 0.1686881, -0.016890949) * go_1(-1.0, 1.0);
|
||||
result += mat4(0.1833738, 0.14381635, -0.025888365, -0.14182197, -0.25804865, 0.07216123, 0.025790794, 0.14096753, 0.023591481, 0.15610993, 0.026975863, 0.008755717, -0.13039349, -0.063048325, -0.121329494, -0.12331732) * go_1(0.0, -1.0);
|
||||
result += mat4(0.0005065098, 0.44017914, 0.18493074, 0.13099027, -0.36087477, -0.37567857, -0.48981526, 0.5590752, -0.23918836, 0.19170256, 0.16816153, -0.29986876, -0.44738817, 0.018545123, 0.66217834, 0.31810755) * go_1(0.0, 0.0);
|
||||
result += mat4(-0.16725904, 0.05753713, 0.058880586, -0.336765, 0.013667228, 0.056172702, 0.13465533, -0.07573556, -0.06313958, 0.06746643, 0.18878669, 0.09404202, -0.21780397, 0.12862128, -0.09476746, -0.34096682) * go_1(0.0, 1.0);
|
||||
result += mat4(-0.07169524, 0.072302215, 0.052789338, -0.14035568, 0.078670934, -0.22246763, -0.0098074945, 0.024950746, 0.10949147, 0.06182366, 0.021721192, 0.12129548, 0.094007075, 0.06076156, 0.016474832, 0.08092115) * go_1(1.0, -1.0);
|
||||
result += mat4(-0.10960447, 0.1878152, -0.029822018, 0.10598909, 0.1582181, 0.086522795, 0.093725055, 0.12908185, 0.23202112, -0.28859115, 0.26614165, 0.124523655, 0.19427507, 0.059677128, 0.003624697, 0.44220912) * go_1(1.0, 0.0);
|
||||
result += mat4(-0.03620583, -0.102766834, 0.025527107, -0.11316131, -0.1507822, 0.0543862, -0.08225627, -0.06438472, 0.04580623, 0.6329729, 0.23854075, 0.35752076, 0.04363613, -0.12580468, -0.0006126687, -0.04995386) * go_1(1.0, 1.0);
|
||||
result += vec4(0.060475674, -0.042036578, 0.06406282, 0.05569301);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v3.2-Upscale-Denoise-CNN-x2-(M)-Conv-4x3x3x8
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_5_tf
|
||||
//!SAVE conv2d_6_tf
|
||||
//!WIDTH conv2d_5_tf.w
|
||||
//!HEIGHT conv2d_5_tf.h
|
||||
//!COMPONENTS 4
|
||||
//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > *
|
||||
#define go_0(x_off, y_off) (max((conv2d_5_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
#define go_1(x_off, y_off) (max(-(conv2d_5_tf_texOff(vec2(x_off, y_off))), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(0.008187961, -0.08433309, -0.17281345, 0.1306418, -0.2925821, 0.20668334, 0.14854355, -0.15960559, 0.08599311, -0.096088655, -0.10121403, 0.067429096, 0.049158614, 0.036637552, 0.22137405, -0.17016457) * go_0(-1.0, -1.0);
|
||||
result += mat4(0.024813082, 0.028489944, 0.06814137, -0.1245949, 0.54239255, 0.08648708, 0.28979865, 0.110916786, -0.1927179, -0.17756873, -0.1878214, 0.05795718, -0.080397904, 0.22125137, 0.1907366, -0.016493658) * go_0(-1.0, 0.0);
|
||||
result += mat4(0.027259264, 0.01494357, 0.04852894, 0.037580628, 0.031005561, 0.003570554, -0.072993, -0.053475574, 0.031119492, -0.14140029, -0.10386501, -0.015266508, 0.01153506, 0.16006693, 0.088294305, 0.04201491) * go_0(-1.0, 1.0);
|
||||
result += mat4(0.13026185, 0.097255, 0.49145448, -0.33619553, -0.21144676, 0.019042643, -0.27274492, 0.3033865, 0.14040698, -0.13656893, 0.28211337, -0.26930946, -0.1626638, 0.105105706, -0.50837296, 0.39536825) * go_0(0.0, -1.0);
|
||||
result += mat4(-0.42495522, 0.14972518, 0.0007564128, 0.37367433, 0.44553527, 0.3338494, -0.26058698, 0.087256804, -0.4324135, 0.20706014, 0.33552194, -0.13375738, -0.13469471, 0.22374928, -0.36969653, -0.34171587) * go_0(0.0, 0.0);
|
||||
result += mat4(0.26543954, -0.004381978, 0.10609993, -0.09718426, -0.15620759, -0.03287476, 0.093032375, 0.00028344034, -0.11699793, -0.016492033, 0.023340177, 0.0062737763, -0.14305823, -0.2721832, -0.160177, -0.06915171) * go_0(0.0, 1.0);
|
||||
result += mat4(0.03334679, 0.12436332, -0.13226178, 0.13868971, 0.017779246, -0.012697869, -0.11553709, 0.08638636, 0.0955215, -0.0309646, 0.040856246, -0.03978358, 0.023490254, -0.07178907, 0.23794931, -0.1714287) * go_0(1.0, -1.0);
|
||||
result += mat4(-0.11820261, 0.116130814, 0.58924234, -0.37785482, 0.016644944, -0.071019046, 0.0076222476, -0.024118654, -0.076183304, -0.14971451, 0.06356606, -0.07225465, -0.17400762, 0.030856986, 0.03957665, -0.0070553776) * go_0(1.0, 0.0);
|
||||
result += mat4(0.10954708, 0.063694, -0.058218896, 0.0010372304, 0.032423936, 0.006164447, -0.031383317, 0.012955956, -0.17115591, 0.16328962, 0.07279567, 0.06571465, 0.005532307, 0.13575353, 0.04082173, 0.041579492) * go_0(1.0, 1.0);
|
||||
result += mat4(0.03146011, -0.08227295, -0.03498218, 0.04772092, 0.12055223, -0.12383867, 0.05448358, -0.07948453, -0.019064998, -0.0964146, -0.024651276, 0.041473705, -0.06493721, -0.054806646, -0.21607941, 0.20078054) * go_1(-1.0, -1.0);
|
||||
result += mat4(-0.25740683, -0.33160943, -0.37422308, 0.12679969, -0.032204475, 0.41485202, 0.4538808, -0.082535125, 0.11784846, 0.10195789, 0.064491615, -0.10170162, -0.09500746, -0.15640756, -0.079364255, -0.12576963) * go_1(-1.0, 0.0);
|
||||
result += mat4(-0.02532797, -0.014487023, -0.09441118, -0.060885422, -0.41196415, -0.1359501, 0.07101173, -0.053279232, 0.010979353, 0.1914526, 0.054606825, 0.015926225, 0.10410896, 0.010272597, -0.048138764, -0.02698072) * go_1(-1.0, 1.0);
|
||||
result += mat4(-0.35856235, 0.099759184, -0.11972965, -0.03850837, -0.5143867, 0.3721666, -0.100802526, 0.21814734, -0.11864143, 0.15086797, 0.047075786, -0.14188164, 0.48882273, -0.12767795, 0.4937544, -0.41288656) * go_1(0.0, -1.0);
|
||||
result += mat4(0.21679138, 0.023770422, -0.5454043, 0.18567741, 0.15965948, -0.84900963, -0.4684333, -0.21884751, 0.5876668, -0.9346244, -0.30144307, 0.97177315, 0.24103107, 0.35953388, 0.2032729, 1.2934744) * go_1(0.0, 0.0);
|
||||
result += mat4(-0.5121466, -0.123357795, 0.1833694, 0.048652876, -0.20895603, 0.0619325, 0.064119816, 0.072841786, -0.21813762, -0.126957, -0.23441431, -0.009071302, -0.09766064, -0.12546945, 0.086008705, -0.0072638122) * go_1(0.0, 1.0);
|
||||
result += mat4(0.15312338, -0.051029235, 0.07638347, -0.14028431, 0.10694411, -0.14639509, 0.3193828, -0.22767228, -0.19987194, 0.18207504, -0.19648756, 0.24752761, -0.03402804, -0.04186147, -0.20177092, 0.09467012) * go_1(1.0, -1.0);
|
||||
result += mat4(-0.3587345, -0.20358992, -0.11016057, 0.21079709, -0.26201126, 0.040362626, 0.3186598, -0.059521858, 0.27564716, -0.041431133, 0.19315968, -0.30228892, 0.01191173, -0.10380854, 0.03030344, 0.026699625) * go_1(1.0, 0.0);
|
||||
result += mat4(0.13373446, -0.011457521, -0.24851708, 0.06563771, -0.051668253, 0.09096929, -0.013976447, 0.041433394, -0.046981215, -0.00015144625, 0.05696515, 0.024501698, 0.2714476, -0.017434085, 0.025333954, -0.054034695) * go_1(1.0, 1.0);
|
||||
result += vec4(0.06757453, -0.021112159, -0.015639946, 0.05520713);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v3.2-Upscale-Denoise-CNN-x2-(M)-Conv-4x1x1x56
|
||||
//!HOOK MAIN
|
||||
//!BIND conv2d_tf
|
||||
//!BIND conv2d_1_tf
|
||||
//!BIND conv2d_2_tf
|
||||
//!BIND conv2d_3_tf
|
||||
//!BIND conv2d_4_tf
|
||||
//!BIND conv2d_5_tf
|
||||
//!BIND conv2d_6_tf
|
||||
//!SAVE conv2d_last_tf
|
||||
//!WIDTH conv2d_tf.w
|
||||
//!HEIGHT conv2d_tf.h
|
||||
//!COMPONENTS 4
|
||||
//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > *
|
||||
#define g_0 (max((conv2d_tf_tex(conv2d_tf_pos)), 0.0))
|
||||
#define g_1 (max(-(conv2d_tf_tex(conv2d_tf_pos)), 0.0))
|
||||
#define g_2 (max((conv2d_1_tf_tex(conv2d_1_tf_pos)), 0.0))
|
||||
#define g_3 (max(-(conv2d_1_tf_tex(conv2d_1_tf_pos)), 0.0))
|
||||
#define g_4 (max((conv2d_2_tf_tex(conv2d_2_tf_pos)), 0.0))
|
||||
#define g_5 (max(-(conv2d_2_tf_tex(conv2d_2_tf_pos)), 0.0))
|
||||
#define g_6 (max((conv2d_3_tf_tex(conv2d_3_tf_pos)), 0.0))
|
||||
#define g_7 (max(-(conv2d_3_tf_tex(conv2d_3_tf_pos)), 0.0))
|
||||
#define g_8 (max((conv2d_4_tf_tex(conv2d_4_tf_pos)), 0.0))
|
||||
#define g_9 (max(-(conv2d_4_tf_tex(conv2d_4_tf_pos)), 0.0))
|
||||
#define g_10 (max((conv2d_5_tf_tex(conv2d_5_tf_pos)), 0.0))
|
||||
#define g_11 (max(-(conv2d_5_tf_tex(conv2d_5_tf_pos)), 0.0))
|
||||
#define g_12 (max((conv2d_6_tf_tex(conv2d_6_tf_pos)), 0.0))
|
||||
#define g_13 (max(-(conv2d_6_tf_tex(conv2d_6_tf_pos)), 0.0))
|
||||
vec4 hook() {
|
||||
vec4 result = mat4(0.03795613, 0.09572901, 0.019826923, 0.10568741, -0.0030050736, -0.018890928, 0.0095737, 0.00807826, -0.022741016, 0.0046556294, -0.017018225, -0.010523109, -0.017621946, -0.0006488902, -0.009405731, -0.0027796263) * g_0;
|
||||
result += mat4(-0.046617493, -0.018167915, -0.039274286, -0.027566826, -0.015821747, 0.003789104, -0.0020801623, 0.004032968, -0.05708595, -0.018440764, -0.032891296, 0.004184342, 0.047413353, 0.0034510887, 0.019148773, -0.0035636695) * g_1;
|
||||
result += mat4(-0.046619494, -0.017274255, -0.03372405, -0.011152855, 0.10981248, 0.036214054, 0.07969624, 0.05590572, -0.031791378, -0.00307391, -0.0032425344, 0.0025762853, 0.0053703627, -0.02076939, -0.00058634114, -0.012593452) * g_2;
|
||||
result += mat4(0.110471316, 0.031102506, 0.07860556, -0.018570926, -0.05038586, -0.07667239, -0.0819002, -0.08958284, 0.03846167, -0.007570915, 0.008598097, -0.0082979705, -0.03610172, -0.022735123, 0.02343143, 0.030037913) * g_3;
|
||||
result += mat4(-0.075562544, -0.020187575, -0.020969959, 0.0062222136, 0.019780673, 0.059694994, 0.019240001, 0.05951303, 0.004168261, 0.00041100322, -0.0013793377, 0.002048099, -0.040564027, -0.031818517, -0.015498987, -0.02695407) * g_4;
|
||||
result += mat4(-0.0016428401, 0.018965026, -0.013192817, -0.008289604, -0.044686675, -0.009061507, -0.049217258, -0.043777503, -0.07308355, -0.063734084, 0.019393511, -0.028853234, 0.057311818, 0.04126226, 0.086301416, 0.11784249) * g_5;
|
||||
result += mat4(-0.06087458, 0.046508487, -0.10723279, 0.017619802, 0.13637137, 0.2054238, 0.013641375, 0.091581754, 0.03556439, 0.0500333, 0.0696777, 0.0922045, -0.020914901, -0.025425691, -0.050319638, -0.049094327) * g_6;
|
||||
result += mat4(0.0030941095, -0.008679898, -0.05815756, -0.038728733, -0.062450465, -0.073838525, -0.030359933, -0.08355475, -0.039032117, -0.0689333, -0.04834296, -0.079471886, 0.09694701, 0.17491414, 0.093450785, 0.16742545) * g_7;
|
||||
result += mat4(0.035618782, -0.027659958, 0.055540156, 0.013073733, 0.12144545, 0.05981087, -0.015131131, -0.0476281, -0.090847984, 0.005347584, 0.015588529, 0.024184622, -0.10743599, -0.01785147, -0.08566232, -0.14611128) * g_8;
|
||||
result += mat4(-0.03812077, 0.018126076, -0.016625525, -0.06906415, -0.06267368, -0.058914356, 0.0009385371, -0.026746314, 0.048242237, 0.028906677, -0.028120263, -0.004209134, 0.009636235, 0.013206963, 0.07449269, 0.038961377) * g_9;
|
||||
result += mat4(-0.014510558, -0.021065345, 0.09356215, -0.005815953, 0.08807958, 0.067895725, 0.08723713, 0.057831496, -0.10227873, -0.07699344, -0.06321843, -0.07448854, 0.09820774, 0.007563063, -0.14045772, -0.014161681) * g_10;
|
||||
result += mat4(-0.18385889, 0.2255883, -0.29741547, 0.14618248, -0.08100661, -0.06860545, -0.112705804, -0.122642964, -0.06736901, 0.06971933, 0.12909706, -0.0418256, -0.32786265, 0.032497127, 0.4390302, 0.032726523) * g_11;
|
||||
result += mat4(0.10560793, 0.083280005, -0.20369564, -0.14290833, -0.119196005, -0.028741803, 0.020456403, -0.06509816, 0.073811695, 0.02724128, -0.08691891, 0.10240907, 0.16827166, -0.17502932, -0.18295282, 0.15154512) * g_12;
|
||||
result += mat4(0.0036247042, -0.002368346, 0.049646147, 0.058079436, 0.14403848, 0.07125248, 0.040327612, -0.013934329, 0.03871744, -0.1717596, 0.20666012, -0.24093682, -0.09846371, 0.011563227, 0.11973811, -0.0574434) * g_13;
|
||||
result += vec4(0.022095086, 0.021079032, 0.030224537, 0.02154015);
|
||||
return result;
|
||||
}
|
||||
//!DESC Anime4K-v3.2-Upscale-Denoise-CNN-x2-(M)-Depth-to-Space
|
||||
//!HOOK MAIN
|
||||
//!BIND MAIN
|
||||
//!BIND conv2d_last_tf
|
||||
//!SAVE MAIN
|
||||
//!WIDTH conv2d_last_tf.w 2 *
|
||||
//!HEIGHT conv2d_last_tf.h 2 *
|
||||
//!WHEN OUTPUT.w MAIN.w / 1.200 > OUTPUT.h MAIN.h / 1.200 > *
|
||||
vec4 hook() {
|
||||
vec2 f0 = fract(conv2d_last_tf_pos * conv2d_last_tf_size);
|
||||
ivec2 i0 = ivec2(f0 * vec2(2.0));
|
||||
float c0 = conv2d_last_tf_tex((vec2(0.5) - f0) * conv2d_last_tf_pt + conv2d_last_tf_pos)[i0.y * 2 + i0.x];
|
||||
float c1 = c0;
|
||||
float c2 = c1;
|
||||
float c3 = c2;
|
||||
return vec4(c0, c1, c2, c3) + MAIN_tex(MAIN_pos);
|
||||
}
|
277
mpv/shaders-old/Anime4K_Upscale_Original_x2.glsl
Executable file
277
mpv/shaders-old/Anime4K_Upscale_Original_x2.glsl
Executable file
|
@ -0,0 +1,277 @@
|
|||
// MIT License
|
||||
|
||||
// Copyright (c) 2019-2021 bloc97
|
||||
// All rights reserved.
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
|
||||
// The above copyright notice and this permission notice shall be included in all
|
||||
// copies or substantial portions of the Software.
|
||||
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
//!DESC Anime4K-v3.2-Upscale-Original-x2-Luma
|
||||
//!HOOK MAIN
|
||||
//!BIND HOOKED
|
||||
//!SAVE LINELUMA
|
||||
//!COMPONENTS 1
|
||||
|
||||
float get_luma(vec4 rgba) {
|
||||
return dot(vec4(0.299, 0.587, 0.114, 0.0), rgba);
|
||||
}
|
||||
|
||||
vec4 hook() {
|
||||
return vec4(get_luma(HOOKED_tex(HOOKED_pos)), 0.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
//!DESC Anime4K-v3.2-Upscale-Original-x2-Kernel-X
|
||||
//!HOOK MAIN
|
||||
//!BIND HOOKED
|
||||
//!BIND LINELUMA
|
||||
//!SAVE LUMAD
|
||||
//!WIDTH MAIN.w 2 *
|
||||
//!HEIGHT MAIN.h 2 *
|
||||
//!COMPONENTS 2
|
||||
|
||||
vec4 hook() {
|
||||
vec2 d = HOOKED_pt;
|
||||
|
||||
//[tl t tr]
|
||||
//[ l c r]
|
||||
//[bl b br]
|
||||
float l = LINELUMA_tex(HOOKED_pos + vec2(-d.x, 0.0)).x;
|
||||
float c = LINELUMA_tex(HOOKED_pos).x;
|
||||
float r = LINELUMA_tex(HOOKED_pos + vec2(d.x, 0.0)).x;
|
||||
|
||||
|
||||
//Horizontal Gradient
|
||||
//[-1 0 1]
|
||||
//[-2 0 2]
|
||||
//[-1 0 1]
|
||||
float xgrad = (-l + r);
|
||||
|
||||
//Vertical Gradient
|
||||
//[-1 -2 -1]
|
||||
//[ 0 0 0]
|
||||
//[ 1 2 1]
|
||||
float ygrad = (l + c + c + r);
|
||||
|
||||
//Computes the luminance's gradient
|
||||
return vec4(xgrad, ygrad, 0.0, 0.0);
|
||||
}
|
||||
|
||||
|
||||
//!DESC Anime4K-v3.2-Upscale-Original-x2-Kernel-Y
|
||||
//!HOOK MAIN
|
||||
//!BIND HOOKED
|
||||
//!BIND LUMAD
|
||||
//!SAVE LUMAD
|
||||
//!WIDTH MAIN.w 2 *
|
||||
//!HEIGHT MAIN.h 2 *
|
||||
//!COMPONENTS 2
|
||||
|
||||
|
||||
/* --------------------- SETTINGS --------------------- */
|
||||
|
||||
//Strength of edge refinement, good values are between 0.2 and 4
|
||||
#define REFINE_STRENGTH 0.5
|
||||
|
||||
|
||||
/* --- MODIFY THESE SETTINGS BELOW AT YOUR OWN RISK --- */
|
||||
|
||||
//Bias of the refinement function, good values are between 0 and 1
|
||||
#define REFINE_BIAS 0.0
|
||||
|
||||
//Polynomial fit obtained by minimizing MSE error on image
|
||||
#define P5 ( 11.68129591)
|
||||
#define P4 (-42.46906057)
|
||||
#define P3 ( 60.28286266)
|
||||
#define P2 (-41.84451327)
|
||||
#define P1 ( 14.05517353)
|
||||
#define P0 (-1.081521930)
|
||||
|
||||
/* ----------------- END OF SETTINGS ----------------- */
|
||||
|
||||
float power_function(float x) {
|
||||
float x2 = x * x;
|
||||
float x3 = x2 * x;
|
||||
float x4 = x2 * x2;
|
||||
float x5 = x2 * x3;
|
||||
|
||||
return P5*x5 + P4*x4 + P3*x3 + P2*x2 + P1*x + P0;
|
||||
}
|
||||
|
||||
vec4 hook() {
|
||||
vec2 d = HOOKED_pt;
|
||||
|
||||
//[tl t tr]
|
||||
//[ l cc r]
|
||||
//[bl b br]
|
||||
float tx = LUMAD_tex(HOOKED_pos + vec2(0.0, -d.y)).x;
|
||||
float cx = LUMAD_tex(HOOKED_pos).x;
|
||||
float bx = LUMAD_tex(HOOKED_pos + vec2(0.0, d.y)).x;
|
||||
|
||||
|
||||
float ty = LUMAD_tex(HOOKED_pos + vec2(0.0, -d.y)).y;
|
||||
//float cy = LUMAD_tex(HOOKED_pos).y;
|
||||
float by = LUMAD_tex(HOOKED_pos + vec2(0.0, d.y)).y;
|
||||
|
||||
|
||||
//Horizontal Gradient
|
||||
//[-1 0 1]
|
||||
//[-2 0 2]
|
||||
//[-1 0 1]
|
||||
float xgrad = (tx + cx + cx + bx);
|
||||
|
||||
//Vertical Gradient
|
||||
//[-1 -2 -1]
|
||||
//[ 0 0 0]
|
||||
//[ 1 2 1]
|
||||
float ygrad = (-ty + by);
|
||||
|
||||
//Computes the luminance's gradient
|
||||
float sobel_norm = clamp(sqrt(xgrad * xgrad + ygrad * ygrad), 0.0, 1.0);
|
||||
|
||||
float dval = clamp(power_function(clamp(sobel_norm, 0.0, 1.0)) * REFINE_STRENGTH + REFINE_BIAS, 0.0, 1.0);
|
||||
|
||||
return vec4(sobel_norm, dval, 0.0, 0.0);
|
||||
}
|
||||
|
||||
//!DESC Anime4K-v3.2-Upscale-Original-x2-Kernel-X
|
||||
//!HOOK MAIN
|
||||
//!BIND HOOKED
|
||||
//!BIND LUMAD
|
||||
//!SAVE LUMAMM
|
||||
//!WIDTH MAIN.w 2 *
|
||||
//!HEIGHT MAIN.h 2 *
|
||||
//!COMPONENTS 2
|
||||
|
||||
|
||||
vec4 hook() {
|
||||
vec2 d = HOOKED_pt;
|
||||
|
||||
if (LUMAD_tex(HOOKED_pos).y < 0.1) {
|
||||
return vec4(0.0);
|
||||
}
|
||||
|
||||
//[tl t tr]
|
||||
//[ l c r]
|
||||
//[bl b br]
|
||||
float l = LUMAD_tex(HOOKED_pos + vec2(-d.x, 0.0)).x;
|
||||
float c = LUMAD_tex(HOOKED_pos).x;
|
||||
float r = LUMAD_tex(HOOKED_pos + vec2(d.x, 0.0)).x;
|
||||
|
||||
//Horizontal Gradient
|
||||
//[-1 0 1]
|
||||
//[-2 0 2]
|
||||
//[-1 0 1]
|
||||
float xgrad = (-l + r);
|
||||
|
||||
//Vertical Gradient
|
||||
//[-1 -2 -1]
|
||||
//[ 0 0 0]
|
||||
//[ 1 2 1]
|
||||
float ygrad = (l + c + c + r);
|
||||
|
||||
|
||||
return vec4(xgrad, ygrad, 0.0, 0.0);
|
||||
}
|
||||
|
||||
|
||||
//!DESC Anime4K-v3.2-Upscale-Original-x2-Kernel-Y
|
||||
//!HOOK MAIN
|
||||
//!BIND HOOKED
|
||||
//!BIND LUMAD
|
||||
//!BIND LUMAMM
|
||||
//!SAVE LUMAMM
|
||||
//!WIDTH MAIN.w 2 *
|
||||
//!HEIGHT MAIN.h 2 *
|
||||
//!COMPONENTS 2
|
||||
|
||||
vec4 hook() {
|
||||
vec2 d = HOOKED_pt;
|
||||
|
||||
if (LUMAD_tex(HOOKED_pos).y < 0.1) {
|
||||
return vec4(0.0);
|
||||
}
|
||||
|
||||
//[tl t tr]
|
||||
//[ l cc r]
|
||||
//[bl b br]
|
||||
float tx = LUMAMM_tex(HOOKED_pos + vec2(0.0, -d.y)).x;
|
||||
float cx = LUMAMM_tex(HOOKED_pos).x;
|
||||
float bx = LUMAMM_tex(HOOKED_pos + vec2(0.0, d.y)).x;
|
||||
|
||||
float ty = LUMAMM_tex(HOOKED_pos + vec2(0.0, -d.y)).y;
|
||||
//float cy = LUMAMM_tex(HOOKED_pos).y;
|
||||
float by = LUMAMM_tex(HOOKED_pos + vec2(0.0, d.y)).y;
|
||||
|
||||
//Horizontal Gradient
|
||||
//[-1 0 1]
|
||||
//[-2 0 2]
|
||||
//[-1 0 1]
|
||||
float xgrad = (tx + cx + cx + bx);
|
||||
|
||||
//Vertical Gradient
|
||||
//[-1 -2 -1]
|
||||
//[ 0 0 0]
|
||||
//[ 1 2 1]
|
||||
float ygrad = (-ty + by);
|
||||
|
||||
float norm = sqrt(xgrad * xgrad + ygrad * ygrad);
|
||||
if (norm <= 0.001) {
|
||||
xgrad = 0.0;
|
||||
ygrad = 0.0;
|
||||
norm = 1.0;
|
||||
}
|
||||
|
||||
return vec4(xgrad/norm, ygrad/norm, 0.0, 0.0);
|
||||
}
|
||||
|
||||
|
||||
//!DESC Anime4K-v3.2-Upscale-Original-x2-Apply
|
||||
//!HOOK MAIN
|
||||
//!BIND HOOKED
|
||||
//!BIND LUMAD
|
||||
//!BIND LUMAMM
|
||||
//!WIDTH MAIN.w 2 *
|
||||
//!HEIGHT MAIN.h 2 *
|
||||
|
||||
|
||||
vec4 hook() {
|
||||
vec2 d = HOOKED_pt;
|
||||
|
||||
float dval = LUMAD_tex(HOOKED_pos).y;
|
||||
if (dval < 0.1) {
|
||||
return HOOKED_tex(HOOKED_pos);
|
||||
}
|
||||
|
||||
vec4 dc = LUMAMM_tex(HOOKED_pos);
|
||||
if (abs(dc.x + dc.y) <= 0.0001) {
|
||||
return HOOKED_tex(HOOKED_pos);
|
||||
}
|
||||
|
||||
float xpos = -sign(dc.x);
|
||||
float ypos = -sign(dc.y);
|
||||
|
||||
vec4 xval = HOOKED_tex(HOOKED_pos + vec2(d.x * xpos, 0.0));
|
||||
vec4 yval = HOOKED_tex(HOOKED_pos + vec2(0.0, d.y * ypos));
|
||||
|
||||
float xyratio = abs(dc.x) / (abs(dc.x) + abs(dc.y));
|
||||
|
||||
vec4 avg = xyratio * xval + (1.0 - xyratio) * yval;
|
||||
|
||||
return avg * dval + HOOKED_tex(HOOKED_pos) * (1.0 - dval);
|
||||
|
||||
}
|
453
mpv/shaders-old/FSR-sharp.glsl
Executable file
453
mpv/shaders-old/FSR-sharp.glsl
Executable file
|
@ -0,0 +1,453 @@
|
|||
// Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
// FidelityFX FSR v1.0.2 by AMD
|
||||
// ported to mpv by agyild
|
||||
|
||||
// Changelog
|
||||
// Made it compatible with pre-OpenGL 4.0 renderers
|
||||
// Made it directly operate on LUMA plane, since the original shader was operating on LUMA by deriving it from RGB. This should cause a major increase in performance, especially on OpenGL 4.0+ renderers (4+2 texture lookups vs. 12+5)
|
||||
// Removed transparency preservation mechanism since the alpha channel is a separate source plane than LUMA
|
||||
// Added optional performance-saving lossy optimizations to EASU (Credit: atyuwen, https://atyuwen.github.io/posts/optimizing-fsr/)
|
||||
//
|
||||
// Notes
|
||||
// Per AMD's guidelines only upscales content up to 4x (e.g., 1080p -> 2160p, 720p -> 1440p etc.) and everything else in between,
|
||||
// that means FSR will scale up to 4x at maximum, and any further scaling will be processed by mpv's scalers
|
||||
|
||||
//!HOOK LUMA
|
||||
//!BIND HOOKED
|
||||
//!SAVE EASUTEX
|
||||
//!DESC FidelityFX Super Resolution v1.0.2 (EASU)
|
||||
//!WHEN OUTPUT.w OUTPUT.h * LUMA.w LUMA.h * / 1.0 >
|
||||
//!WIDTH OUTPUT.w OUTPUT.w LUMA.w 2 * < * LUMA.w 2 * OUTPUT.w LUMA.w 2 * > * + OUTPUT.w OUTPUT.w LUMA.w 2 * = * +
|
||||
//!HEIGHT OUTPUT.h OUTPUT.h LUMA.h 2 * < * LUMA.h 2 * OUTPUT.h LUMA.h 2 * > * + OUTPUT.h OUTPUT.h LUMA.h 2 * = * +
|
||||
//!COMPONENTS 1
|
||||
|
||||
// User variables - EASU
|
||||
#define FSR_PQ 0 // Whether the source content has PQ gamma or not. Needs to be set to the same value for both passes. 0 or 1.
|
||||
#define FSR_EASU_DERING 1 // If set to 0, disables deringing for a small increase in performance. 0 or 1.
|
||||
#define FSR_EASU_SIMPLE_ANALYSIS 0 // If set to 1, uses a simpler single-pass direction and length analysis for an increase in performance. 0 or 1.
|
||||
#define FSR_EASU_QUIT_EARLY 0 // If set to 1, uses bilinear filtering for non-edge pixels and skips EASU on those regions for an increase in performance. 0 or 1.
|
||||
|
||||
// Shader code
|
||||
|
||||
#ifndef FSR_EASU_DIR_THRESHOLD
|
||||
#if (FSR_EASU_QUIT_EARLY == 1)
|
||||
#define FSR_EASU_DIR_THRESHOLD 64.0
|
||||
#elif (FSR_EASU_QUIT_EARLY == 0)
|
||||
#define FSR_EASU_DIR_THRESHOLD 32768.0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
float APrxLoRcpF1(float a) {
|
||||
return uintBitsToFloat(uint(0x7ef07ebb) - floatBitsToUint(a));
|
||||
}
|
||||
|
||||
float APrxLoRsqF1(float a) {
|
||||
return uintBitsToFloat(uint(0x5f347d74) - (floatBitsToUint(a) >> uint(1)));
|
||||
}
|
||||
|
||||
float AMin3F1(float x, float y, float z) {
|
||||
return min(x, min(y, z));
|
||||
}
|
||||
|
||||
float AMax3F1(float x, float y, float z) {
|
||||
return max(x, max(y, z));
|
||||
}
|
||||
|
||||
#if (FSR_PQ == 1)
|
||||
|
||||
float ToGamma2(float a) {
|
||||
return pow(a, 4.0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// Filtering for a given tap for the scalar.
|
||||
void FsrEasuTap(
|
||||
inout float aC, // Accumulated color, with negative lobe.
|
||||
inout float aW, // Accumulated weight.
|
||||
vec2 off, // Pixel offset from resolve position to tap.
|
||||
vec2 dir, // Gradient direction.
|
||||
vec2 len, // Length.
|
||||
float lob, // Negative lobe strength.
|
||||
float clp, // Clipping point.
|
||||
float c){ // Tap color.
|
||||
// Rotate offset by direction.
|
||||
vec2 v;
|
||||
v.x = (off.x * ( dir.x)) + (off.y * dir.y);
|
||||
v.y = (off.x * (-dir.y)) + (off.y * dir.x);
|
||||
// Anisotropy.
|
||||
v *= len;
|
||||
// Compute distance^2.
|
||||
float d2 = v.x * v.x + v.y * v.y;
|
||||
// Limit to the window as at corner, 2 taps can easily be outside.
|
||||
d2 = min(d2, clp);
|
||||
// Approximation of lancos2 without sin() or rcp(), or sqrt() to get x.
|
||||
// (25/16 * (2/5 * x^2 - 1)^2 - (25/16 - 1)) * (1/4 * x^2 - 1)^2
|
||||
// |_______________________________________| |_______________|
|
||||
// base window
|
||||
// The general form of the 'base' is,
|
||||
// (a*(b*x^2-1)^2-(a-1))
|
||||
// Where 'a=1/(2*b-b^2)' and 'b' moves around the negative lobe.
|
||||
float wB = float(2.0 / 5.0) * d2 + -1.0;
|
||||
float wA = lob * d2 + -1.0;
|
||||
wB *= wB;
|
||||
wA *= wA;
|
||||
wB = float(25.0 / 16.0) * wB + float(-(25.0 / 16.0 - 1.0));
|
||||
float w = wB * wA;
|
||||
// Do weighted average.
|
||||
aC += c * w;
|
||||
aW += w;
|
||||
}
|
||||
|
||||
// Accumulate direction and length.
|
||||
void FsrEasuSet(
|
||||
inout vec2 dir,
|
||||
inout float len,
|
||||
vec2 pp,
|
||||
#if (FSR_EASU_SIMPLE_ANALYSIS == 1)
|
||||
float b, float c,
|
||||
float i, float j, float f, float e,
|
||||
float k, float l, float h, float g,
|
||||
float o, float n
|
||||
#elif (FSR_EASU_SIMPLE_ANALYSIS == 0)
|
||||
bool biS, bool biT, bool biU, bool biV,
|
||||
float lA, float lB, float lC, float lD, float lE
|
||||
#endif
|
||||
){
|
||||
// Compute bilinear weight, branches factor out as predicates are compiler time immediates.
|
||||
// s t
|
||||
// u v
|
||||
#if (FSR_EASU_SIMPLE_ANALYSIS == 1)
|
||||
vec4 w = vec4(0.0);
|
||||
w.x = (1.0 - pp.x) * (1.0 - pp.y);
|
||||
w.y = pp.x * (1.0 - pp.y);
|
||||
w.z = (1.0 - pp.x) * pp.y;
|
||||
w.w = pp.x * pp.y;
|
||||
|
||||
float lA = dot(w, vec4(b, c, f, g));
|
||||
float lB = dot(w, vec4(e, f, i, j));
|
||||
float lC = dot(w, vec4(f, g, j, k));
|
||||
float lD = dot(w, vec4(g, h, k, l));
|
||||
float lE = dot(w, vec4(j, k, n, o));
|
||||
#elif (FSR_EASU_SIMPLE_ANALYSIS == 0)
|
||||
float w = 0.0;
|
||||
if (biS)
|
||||
w = (1.0 - pp.x) * (1.0 - pp.y);
|
||||
if (biT)
|
||||
w = pp.x * (1.0 - pp.y);
|
||||
if (biU)
|
||||
w = (1.0 - pp.x) * pp.y;
|
||||
if (biV)
|
||||
w = pp.x * pp.y;
|
||||
#endif
|
||||
// Direction is the '+' diff.
|
||||
// a
|
||||
// b c d
|
||||
// e
|
||||
// Then takes magnitude from abs average of both sides of 'c'.
|
||||
// Length converts gradient reversal to 0, smoothly to non-reversal at 1, shaped, then adding horz and vert terms.
|
||||
float dc = lD - lC;
|
||||
float cb = lC - lB;
|
||||
float lenX = max(abs(dc), abs(cb));
|
||||
lenX = APrxLoRcpF1(lenX);
|
||||
float dirX = lD - lB;
|
||||
lenX = clamp(abs(dirX) * lenX, 0.0, 1.0);
|
||||
lenX *= lenX;
|
||||
// Repeat for the y axis.
|
||||
float ec = lE - lC;
|
||||
float ca = lC - lA;
|
||||
float lenY = max(abs(ec), abs(ca));
|
||||
lenY = APrxLoRcpF1(lenY);
|
||||
float dirY = lE - lA;
|
||||
lenY = clamp(abs(dirY) * lenY, 0.0, 1.0);
|
||||
lenY *= lenY;
|
||||
#if (FSR_EASU_SIMPLE_ANALYSIS == 1)
|
||||
len = lenX + lenY;
|
||||
dir = vec2(dirX, dirY);
|
||||
#elif (FSR_EASU_SIMPLE_ANALYSIS == 0)
|
||||
dir += vec2(dirX, dirY) * w;
|
||||
len += dot(vec2(w), vec2(lenX, lenY));
|
||||
#endif
|
||||
}
|
||||
|
||||
vec4 hook() {
|
||||
// Result
|
||||
vec4 pix = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
// +---+---+
|
||||
// | | |
|
||||
// +--(0)--+
|
||||
// | b | c |
|
||||
// +---F---+---+---+
|
||||
// | e | f | g | h |
|
||||
// +--(1)--+--(2)--+
|
||||
// | i | j | k | l |
|
||||
// +---+---+---+---+
|
||||
// | n | o |
|
||||
// +--(3)--+
|
||||
// | | |
|
||||
// +---+---+
|
||||
// Get position of 'F'.
|
||||
vec2 pp = HOOKED_pos * HOOKED_size - vec2(0.5);
|
||||
vec2 fp = floor(pp);
|
||||
pp -= fp;
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
// 12-tap kernel.
|
||||
// b c
|
||||
// e f g h
|
||||
// i j k l
|
||||
// n o
|
||||
// Gather 4 ordering.
|
||||
// a b
|
||||
// r g
|
||||
// Allowing dead-code removal to remove the 'z's.
|
||||
#if (defined(HOOKED_gather) && (__VERSION__ >= 400 || (GL_ES && __VERSION__ >= 310)))
|
||||
vec4 bczzL = HOOKED_gather(vec2((fp + vec2(1.0, -1.0)) * HOOKED_pt), 0);
|
||||
vec4 ijfeL = HOOKED_gather(vec2((fp + vec2(0.0, 1.0)) * HOOKED_pt), 0);
|
||||
vec4 klhgL = HOOKED_gather(vec2((fp + vec2(2.0, 1.0)) * HOOKED_pt), 0);
|
||||
vec4 zzonL = HOOKED_gather(vec2((fp + vec2(1.0, 3.0)) * HOOKED_pt), 0);
|
||||
#else
|
||||
// pre-OpenGL 4.0 compatibility
|
||||
float b = HOOKED_tex(vec2((fp + vec2(0.5, -0.5)) * HOOKED_pt)).r;
|
||||
float c = HOOKED_tex(vec2((fp + vec2(1.5, -0.5)) * HOOKED_pt)).r;
|
||||
|
||||
float e = HOOKED_tex(vec2((fp + vec2(-0.5, 0.5)) * HOOKED_pt)).r;
|
||||
float f = HOOKED_tex(vec2((fp + vec2( 0.5, 0.5)) * HOOKED_pt)).r;
|
||||
float g = HOOKED_tex(vec2((fp + vec2( 1.5, 0.5)) * HOOKED_pt)).r;
|
||||
float h = HOOKED_tex(vec2((fp + vec2( 2.5, 0.5)) * HOOKED_pt)).r;
|
||||
|
||||
float i = HOOKED_tex(vec2((fp + vec2(-0.5, 1.5)) * HOOKED_pt)).r;
|
||||
float j = HOOKED_tex(vec2((fp + vec2( 0.5, 1.5)) * HOOKED_pt)).r;
|
||||
float k = HOOKED_tex(vec2((fp + vec2( 1.5, 1.5)) * HOOKED_pt)).r;
|
||||
float l = HOOKED_tex(vec2((fp + vec2( 2.5, 1.5)) * HOOKED_pt)).r;
|
||||
|
||||
float n = HOOKED_tex(vec2((fp + vec2(0.5, 2.5) ) * HOOKED_pt)).r;
|
||||
float o = HOOKED_tex(vec2((fp + vec2(1.5, 2.5) ) * HOOKED_pt)).r;
|
||||
|
||||
vec4 bczzL = vec4(b, c, 0.0, 0.0);
|
||||
vec4 ijfeL = vec4(i, j, f, e);
|
||||
vec4 klhgL = vec4(k, l, h, g);
|
||||
vec4 zzonL = vec4(0.0, 0.0, o, n);
|
||||
#endif
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
// Rename.
|
||||
float bL = bczzL.x;
|
||||
float cL = bczzL.y;
|
||||
float iL = ijfeL.x;
|
||||
float jL = ijfeL.y;
|
||||
float fL = ijfeL.z;
|
||||
float eL = ijfeL.w;
|
||||
float kL = klhgL.x;
|
||||
float lL = klhgL.y;
|
||||
float hL = klhgL.z;
|
||||
float gL = klhgL.w;
|
||||
float oL = zzonL.z;
|
||||
float nL = zzonL.w;
|
||||
|
||||
#if (FSR_PQ == 1)
|
||||
// Not the most performance-friendly solution, but should work until mpv adds proper gamma transformation functions for shaders
|
||||
bL = ToGamma2(bL);
|
||||
cL = ToGamma2(cL);
|
||||
iL = ToGamma2(iL);
|
||||
jL = ToGamma2(jL);
|
||||
fL = ToGamma2(fL);
|
||||
eL = ToGamma2(eL);
|
||||
kL = ToGamma2(kL);
|
||||
lL = ToGamma2(lL);
|
||||
hL = ToGamma2(hL);
|
||||
gL = ToGamma2(gL);
|
||||
oL = ToGamma2(oL);
|
||||
nL = ToGamma2(nL);
|
||||
#endif
|
||||
|
||||
// Accumulate for bilinear interpolation.
|
||||
vec2 dir = vec2(0.0);
|
||||
float len = 0.0;
|
||||
#if (FSR_EASU_SIMPLE_ANALYSIS == 1)
|
||||
FsrEasuSet(dir, len, pp, bL, cL, iL, jL, fL, eL, kL, lL, hL, gL, oL, nL);
|
||||
#elif (FSR_EASU_SIMPLE_ANALYSIS == 0)
|
||||
FsrEasuSet(dir, len, pp, true, false, false, false, bL, eL, fL, gL, jL);
|
||||
FsrEasuSet(dir, len, pp, false, true, false, false, cL, fL, gL, hL, kL);
|
||||
FsrEasuSet(dir, len, pp, false, false, true, false, fL, iL, jL, kL, nL);
|
||||
FsrEasuSet(dir, len, pp, false, false, false, true, gL, jL, kL, lL, oL);
|
||||
#endif
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
// Normalize with approximation, and cleanup close to zero.
|
||||
vec2 dir2 = dir * dir;
|
||||
float dirR = dir2.x + dir2.y;
|
||||
bool zro = dirR < float(1.0 / FSR_EASU_DIR_THRESHOLD);
|
||||
dirR = APrxLoRsqF1(dirR);
|
||||
#if (FSR_EASU_QUIT_EARLY == 1)
|
||||
if (zro) {
|
||||
vec4 w = vec4(0.0);
|
||||
w.x = (1.0 - pp.x) * (1.0 - pp.y);
|
||||
w.y = pp.x * (1.0 - pp.y);
|
||||
w.z = (1.0 - pp.x) * pp.y;
|
||||
w.w = pp.x * pp.y;
|
||||
|
||||
pix.r = clamp(dot(w, vec4(fL, gL, jL, kL)), 0.0, 1.0);
|
||||
return pix;
|
||||
}
|
||||
#elif (FSR_EASU_QUIT_EARLY == 0)
|
||||
dirR = zro ? 1.0 : dirR;
|
||||
dir.x = zro ? 1.0 : dir.x;
|
||||
#endif
|
||||
dir *= vec2(dirR);
|
||||
// Transform from {0 to 2} to {0 to 1} range, and shape with square.
|
||||
len = len * 0.5;
|
||||
len *= len;
|
||||
// Stretch kernel {1.0 vert|horz, to sqrt(2.0) on diagonal}.
|
||||
float stretch = (dir.x * dir.x + dir.y * dir.y) * APrxLoRcpF1(max(abs(dir.x), abs(dir.y)));
|
||||
// Anisotropic length after rotation,
|
||||
// x := 1.0 lerp to 'stretch' on edges
|
||||
// y := 1.0 lerp to 2x on edges
|
||||
vec2 len2 = vec2(1.0 + (stretch - 1.0) * len, 1.0 + -0.5 * len);
|
||||
// Based on the amount of 'edge',
|
||||
// the window shifts from +/-{sqrt(2.0) to slightly beyond 2.0}.
|
||||
float lob = 0.5 + float((1.0 / 4.0 - 0.04) - 0.5) * len;
|
||||
// Set distance^2 clipping point to the end of the adjustable window.
|
||||
float clp = APrxLoRcpF1(lob);
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
// Accumulation
|
||||
// b c
|
||||
// e f g h
|
||||
// i j k l
|
||||
// n o
|
||||
float aC = 0.0;
|
||||
float aW = 0.0;
|
||||
FsrEasuTap(aC, aW, vec2( 0.0,-1.0) - pp, dir, len2, lob, clp, bL); // b
|
||||
FsrEasuTap(aC, aW, vec2( 1.0,-1.0) - pp, dir, len2, lob, clp, cL); // c
|
||||
FsrEasuTap(aC, aW, vec2(-1.0, 1.0) - pp, dir, len2, lob, clp, iL); // i
|
||||
FsrEasuTap(aC, aW, vec2( 0.0, 1.0) - pp, dir, len2, lob, clp, jL); // j
|
||||
FsrEasuTap(aC, aW, vec2( 0.0, 0.0) - pp, dir, len2, lob, clp, fL); // f
|
||||
FsrEasuTap(aC, aW, vec2(-1.0, 0.0) - pp, dir, len2, lob, clp, eL); // e
|
||||
FsrEasuTap(aC, aW, vec2( 1.0, 1.0) - pp, dir, len2, lob, clp, kL); // k
|
||||
FsrEasuTap(aC, aW, vec2( 2.0, 1.0) - pp, dir, len2, lob, clp, lL); // l
|
||||
FsrEasuTap(aC, aW, vec2( 2.0, 0.0) - pp, dir, len2, lob, clp, hL); // h
|
||||
FsrEasuTap(aC, aW, vec2( 1.0, 0.0) - pp, dir, len2, lob, clp, gL); // g
|
||||
FsrEasuTap(aC, aW, vec2( 1.0, 2.0) - pp, dir, len2, lob, clp, oL); // o
|
||||
FsrEasuTap(aC, aW, vec2( 0.0, 2.0) - pp, dir, len2, lob, clp, nL); // n
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
// Normalize and dering.
|
||||
pix.r = aC / aW;
|
||||
#if (FSR_EASU_DERING == 1)
|
||||
float min1 = min(AMin3F1(fL, gL, jL), kL);
|
||||
float max1 = max(AMax3F1(fL, gL, jL), kL);
|
||||
pix.r = clamp(pix.r, min1, max1);
|
||||
#endif
|
||||
pix.r = clamp(pix.r, 0.0, 1.0);
|
||||
|
||||
return pix;
|
||||
}
|
||||
|
||||
//!HOOK LUMA
|
||||
//!BIND EASUTEX
|
||||
//!DESC FidelityFX Super Resolution v1.0.2 (RCAS)
|
||||
//!WIDTH EASUTEX.w
|
||||
//!HEIGHT EASUTEX.h
|
||||
//!COMPONENTS 1
|
||||
|
||||
// User variables - RCAS
|
||||
#define SHARPNESS 0.6 // Controls the amount of sharpening. The scale is {0.0 := maximum, to N>0, where N is the number of stops (halving) of the reduction of sharpness}. 0.0 to 2.0.
|
||||
#define FSR_RCAS_DENOISE 1 // If set to 1, lessens the sharpening on noisy areas. Can be disabled for better performance. 0 or 1.
|
||||
#define FSR_PQ 0 // Whether the source content has PQ gamma or not. Needs to be set to the same value for both passes. 0 or 1.
|
||||
|
||||
// Shader code
|
||||
|
||||
#define FSR_RCAS_LIMIT (0.25 - (1.0 / 16.0)) // This is set at the limit of providing unnatural results for sharpening.
|
||||
|
||||
float APrxMedRcpF1(float a) {
|
||||
float b = uintBitsToFloat(uint(0x7ef19fff) - floatBitsToUint(a));
|
||||
return b * (-b * a + 2.0);
|
||||
}
|
||||
|
||||
float AMax3F1(float x, float y, float z) {
|
||||
return max(x, max(y, z));
|
||||
}
|
||||
|
||||
float AMin3F1(float x, float y, float z) {
|
||||
return min(x, min(y, z));
|
||||
}
|
||||
|
||||
#if (FSR_PQ == 1)
|
||||
|
||||
float FromGamma2(float a) {
|
||||
return sqrt(sqrt(a));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
vec4 hook() {
|
||||
// Algorithm uses minimal 3x3 pixel neighborhood.
|
||||
// b
|
||||
// d e f
|
||||
// h
|
||||
#if (defined(EASUTEX_gather) && (__VERSION__ >= 400 || (GL_ES && __VERSION__ >= 310)))
|
||||
vec3 bde = EASUTEX_gather(EASUTEX_pos + EASUTEX_pt * vec2(-0.5), 0).xyz;
|
||||
float b = bde.z;
|
||||
float d = bde.x;
|
||||
float e = bde.y;
|
||||
|
||||
vec2 fh = EASUTEX_gather(EASUTEX_pos + EASUTEX_pt * vec2(0.5), 0).zx;
|
||||
float f = fh.x;
|
||||
float h = fh.y;
|
||||
#else
|
||||
float b = EASUTEX_texOff(vec2( 0.0, -1.0)).r;
|
||||
float d = EASUTEX_texOff(vec2(-1.0, 0.0)).r;
|
||||
float e = EASUTEX_tex(EASUTEX_pos).r;
|
||||
float f = EASUTEX_texOff(vec2(1.0, 0.0)).r;
|
||||
float h = EASUTEX_texOff(vec2(0.0, 1.0)).r;
|
||||
#endif
|
||||
|
||||
// Min and max of ring.
|
||||
float mn1L = min(AMin3F1(b, d, f), h);
|
||||
float mx1L = max(AMax3F1(b, d, f), h);
|
||||
|
||||
// Immediate constants for peak range.
|
||||
vec2 peakC = vec2(1.0, -1.0 * 4.0);
|
||||
|
||||
// Limiters, these need to be high precision RCPs.
|
||||
float hitMinL = min(mn1L, e) / (4.0 * mx1L);
|
||||
float hitMaxL = (peakC.x - max(mx1L, e)) / (4.0 * mn1L + peakC.y);
|
||||
float lobeL = max(-hitMinL, hitMaxL);
|
||||
float lobe = max(float(-FSR_RCAS_LIMIT), min(lobeL, 0.0)) * exp2(-clamp(float(SHARPNESS), 0.0, 2.0));
|
||||
|
||||
// Apply noise removal.
|
||||
#if (FSR_RCAS_DENOISE == 1)
|
||||
// Noise detection.
|
||||
float nz = 0.25 * b + 0.25 * d + 0.25 * f + 0.25 * h - e;
|
||||
nz = clamp(abs(nz) * APrxMedRcpF1(AMax3F1(AMax3F1(b, d, e), f, h) - AMin3F1(AMin3F1(b, d, e), f, h)), 0.0, 1.0);
|
||||
nz = -0.5 * nz + 1.0;
|
||||
lobe *= nz;
|
||||
#endif
|
||||
|
||||
// Resolve, which needs the medium precision rcp approximation to avoid visible tonality changes.
|
||||
float rcpL = APrxMedRcpF1(4.0 * lobe + 1.0);
|
||||
vec4 pix = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
pix.r = float((lobe * b + lobe * d + lobe * h + lobe * f + e) * rcpL);
|
||||
#if (FSR_PQ == 1)
|
||||
pix.r = FromGamma2(pix.r);
|
||||
#endif
|
||||
|
||||
return pix;
|
||||
}
|
453
mpv/shaders-old/FSR.glsl
Executable file
453
mpv/shaders-old/FSR.glsl
Executable file
|
@ -0,0 +1,453 @@
|
|||
// Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved.
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
// FidelityFX FSR v1.0.2 by AMD
|
||||
// ported to mpv by agyild
|
||||
|
||||
// Changelog
|
||||
// Made it compatible with pre-OpenGL 4.0 renderers
|
||||
// Made it directly operate on LUMA plane, since the original shader was operating on LUMA by deriving it from RGB. This should cause a major increase in performance, especially on OpenGL 4.0+ renderers (4+2 texture lookups vs. 12+5)
|
||||
// Removed transparency preservation mechanism since the alpha channel is a separate source plane than LUMA
|
||||
// Added optional performance-saving lossy optimizations to EASU (Credit: atyuwen, https://atyuwen.github.io/posts/optimizing-fsr/)
|
||||
//
|
||||
// Notes
|
||||
// Per AMD's guidelines only upscales content up to 4x (e.g., 1080p -> 2160p, 720p -> 1440p etc.) and everything else in between,
|
||||
// that means FSR will scale up to 4x at maximum, and any further scaling will be processed by mpv's scalers
|
||||
|
||||
//!HOOK LUMA
|
||||
//!BIND HOOKED
|
||||
//!SAVE EASUTEX
|
||||
//!DESC FidelityFX Super Resolution v1.0.2 (EASU)
|
||||
//!WHEN OUTPUT.w OUTPUT.h * LUMA.w LUMA.h * / 1.0 >
|
||||
//!WIDTH OUTPUT.w OUTPUT.w LUMA.w 2 * < * LUMA.w 2 * OUTPUT.w LUMA.w 2 * > * + OUTPUT.w OUTPUT.w LUMA.w 2 * = * +
|
||||
//!HEIGHT OUTPUT.h OUTPUT.h LUMA.h 2 * < * LUMA.h 2 * OUTPUT.h LUMA.h 2 * > * + OUTPUT.h OUTPUT.h LUMA.h 2 * = * +
|
||||
//!COMPONENTS 1
|
||||
|
||||
// User variables - EASU
|
||||
#define FSR_PQ 0 // Whether the source content has PQ gamma or not. Needs to be set to the same value for both passes. 0 or 1.
|
||||
#define FSR_EASU_DERING 1 // If set to 0, disables deringing for a small increase in performance. 0 or 1.
|
||||
#define FSR_EASU_SIMPLE_ANALYSIS 0 // If set to 1, uses a simpler single-pass direction and length analysis for an increase in performance. 0 or 1.
|
||||
#define FSR_EASU_QUIT_EARLY 0 // If set to 1, uses bilinear filtering for non-edge pixels and skips EASU on those regions for an increase in performance. 0 or 1.
|
||||
|
||||
// Shader code
|
||||
|
||||
#ifndef FSR_EASU_DIR_THRESHOLD
|
||||
#if (FSR_EASU_QUIT_EARLY == 1)
|
||||
#define FSR_EASU_DIR_THRESHOLD 64.0
|
||||
#elif (FSR_EASU_QUIT_EARLY == 0)
|
||||
#define FSR_EASU_DIR_THRESHOLD 32768.0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
float APrxLoRcpF1(float a) {
|
||||
return uintBitsToFloat(uint(0x7ef07ebb) - floatBitsToUint(a));
|
||||
}
|
||||
|
||||
float APrxLoRsqF1(float a) {
|
||||
return uintBitsToFloat(uint(0x5f347d74) - (floatBitsToUint(a) >> uint(1)));
|
||||
}
|
||||
|
||||
float AMin3F1(float x, float y, float z) {
|
||||
return min(x, min(y, z));
|
||||
}
|
||||
|
||||
float AMax3F1(float x, float y, float z) {
|
||||
return max(x, max(y, z));
|
||||
}
|
||||
|
||||
#if (FSR_PQ == 1)
|
||||
|
||||
float ToGamma2(float a) {
|
||||
return pow(a, 4.0);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// Filtering for a given tap for the scalar.
|
||||
void FsrEasuTap(
|
||||
inout float aC, // Accumulated color, with negative lobe.
|
||||
inout float aW, // Accumulated weight.
|
||||
vec2 off, // Pixel offset from resolve position to tap.
|
||||
vec2 dir, // Gradient direction.
|
||||
vec2 len, // Length.
|
||||
float lob, // Negative lobe strength.
|
||||
float clp, // Clipping point.
|
||||
float c){ // Tap color.
|
||||
// Rotate offset by direction.
|
||||
vec2 v;
|
||||
v.x = (off.x * ( dir.x)) + (off.y * dir.y);
|
||||
v.y = (off.x * (-dir.y)) + (off.y * dir.x);
|
||||
// Anisotropy.
|
||||
v *= len;
|
||||
// Compute distance^2.
|
||||
float d2 = v.x * v.x + v.y * v.y;
|
||||
// Limit to the window as at corner, 2 taps can easily be outside.
|
||||
d2 = min(d2, clp);
|
||||
// Approximation of lancos2 without sin() or rcp(), or sqrt() to get x.
|
||||
// (25/16 * (2/5 * x^2 - 1)^2 - (25/16 - 1)) * (1/4 * x^2 - 1)^2
|
||||
// |_______________________________________| |_______________|
|
||||
// base window
|
||||
// The general form of the 'base' is,
|
||||
// (a*(b*x^2-1)^2-(a-1))
|
||||
// Where 'a=1/(2*b-b^2)' and 'b' moves around the negative lobe.
|
||||
float wB = float(2.0 / 5.0) * d2 + -1.0;
|
||||
float wA = lob * d2 + -1.0;
|
||||
wB *= wB;
|
||||
wA *= wA;
|
||||
wB = float(25.0 / 16.0) * wB + float(-(25.0 / 16.0 - 1.0));
|
||||
float w = wB * wA;
|
||||
// Do weighted average.
|
||||
aC += c * w;
|
||||
aW += w;
|
||||
}
|
||||
|
||||
// Accumulate direction and length.
|
||||
void FsrEasuSet(
|
||||
inout vec2 dir,
|
||||
inout float len,
|
||||
vec2 pp,
|
||||
#if (FSR_EASU_SIMPLE_ANALYSIS == 1)
|
||||
float b, float c,
|
||||
float i, float j, float f, float e,
|
||||
float k, float l, float h, float g,
|
||||
float o, float n
|
||||
#elif (FSR_EASU_SIMPLE_ANALYSIS == 0)
|
||||
bool biS, bool biT, bool biU, bool biV,
|
||||
float lA, float lB, float lC, float lD, float lE
|
||||
#endif
|
||||
){
|
||||
// Compute bilinear weight, branches factor out as predicates are compiler time immediates.
|
||||
// s t
|
||||
// u v
|
||||
#if (FSR_EASU_SIMPLE_ANALYSIS == 1)
|
||||
vec4 w = vec4(0.0);
|
||||
w.x = (1.0 - pp.x) * (1.0 - pp.y);
|
||||
w.y = pp.x * (1.0 - pp.y);
|
||||
w.z = (1.0 - pp.x) * pp.y;
|
||||
w.w = pp.x * pp.y;
|
||||
|
||||
float lA = dot(w, vec4(b, c, f, g));
|
||||
float lB = dot(w, vec4(e, f, i, j));
|
||||
float lC = dot(w, vec4(f, g, j, k));
|
||||
float lD = dot(w, vec4(g, h, k, l));
|
||||
float lE = dot(w, vec4(j, k, n, o));
|
||||
#elif (FSR_EASU_SIMPLE_ANALYSIS == 0)
|
||||
float w = 0.0;
|
||||
if (biS)
|
||||
w = (1.0 - pp.x) * (1.0 - pp.y);
|
||||
if (biT)
|
||||
w = pp.x * (1.0 - pp.y);
|
||||
if (biU)
|
||||
w = (1.0 - pp.x) * pp.y;
|
||||
if (biV)
|
||||
w = pp.x * pp.y;
|
||||
#endif
|
||||
// Direction is the '+' diff.
|
||||
// a
|
||||
// b c d
|
||||
// e
|
||||
// Then takes magnitude from abs average of both sides of 'c'.
|
||||
// Length converts gradient reversal to 0, smoothly to non-reversal at 1, shaped, then adding horz and vert terms.
|
||||
float dc = lD - lC;
|
||||
float cb = lC - lB;
|
||||
float lenX = max(abs(dc), abs(cb));
|
||||
lenX = APrxLoRcpF1(lenX);
|
||||
float dirX = lD - lB;
|
||||
lenX = clamp(abs(dirX) * lenX, 0.0, 1.0);
|
||||
lenX *= lenX;
|
||||
// Repeat for the y axis.
|
||||
float ec = lE - lC;
|
||||
float ca = lC - lA;
|
||||
float lenY = max(abs(ec), abs(ca));
|
||||
lenY = APrxLoRcpF1(lenY);
|
||||
float dirY = lE - lA;
|
||||
lenY = clamp(abs(dirY) * lenY, 0.0, 1.0);
|
||||
lenY *= lenY;
|
||||
#if (FSR_EASU_SIMPLE_ANALYSIS == 1)
|
||||
len = lenX + lenY;
|
||||
dir = vec2(dirX, dirY);
|
||||
#elif (FSR_EASU_SIMPLE_ANALYSIS == 0)
|
||||
dir += vec2(dirX, dirY) * w;
|
||||
len += dot(vec2(w), vec2(lenX, lenY));
|
||||
#endif
|
||||
}
|
||||
|
||||
vec4 hook() {
|
||||
// Result
|
||||
vec4 pix = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
// +---+---+
|
||||
// | | |
|
||||
// +--(0)--+
|
||||
// | b | c |
|
||||
// +---F---+---+---+
|
||||
// | e | f | g | h |
|
||||
// +--(1)--+--(2)--+
|
||||
// | i | j | k | l |
|
||||
// +---+---+---+---+
|
||||
// | n | o |
|
||||
// +--(3)--+
|
||||
// | | |
|
||||
// +---+---+
|
||||
// Get position of 'F'.
|
||||
vec2 pp = HOOKED_pos * HOOKED_size - vec2(0.5);
|
||||
vec2 fp = floor(pp);
|
||||
pp -= fp;
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
// 12-tap kernel.
|
||||
// b c
|
||||
// e f g h
|
||||
// i j k l
|
||||
// n o
|
||||
// Gather 4 ordering.
|
||||
// a b
|
||||
// r g
|
||||
// Allowing dead-code removal to remove the 'z's.
|
||||
#if (defined(HOOKED_gather) && (__VERSION__ >= 400 || (GL_ES && __VERSION__ >= 310)))
|
||||
vec4 bczzL = HOOKED_gather(vec2((fp + vec2(1.0, -1.0)) * HOOKED_pt), 0);
|
||||
vec4 ijfeL = HOOKED_gather(vec2((fp + vec2(0.0, 1.0)) * HOOKED_pt), 0);
|
||||
vec4 klhgL = HOOKED_gather(vec2((fp + vec2(2.0, 1.0)) * HOOKED_pt), 0);
|
||||
vec4 zzonL = HOOKED_gather(vec2((fp + vec2(1.0, 3.0)) * HOOKED_pt), 0);
|
||||
#else
|
||||
// pre-OpenGL 4.0 compatibility
|
||||
float b = HOOKED_tex(vec2((fp + vec2(0.5, -0.5)) * HOOKED_pt)).r;
|
||||
float c = HOOKED_tex(vec2((fp + vec2(1.5, -0.5)) * HOOKED_pt)).r;
|
||||
|
||||
float e = HOOKED_tex(vec2((fp + vec2(-0.5, 0.5)) * HOOKED_pt)).r;
|
||||
float f = HOOKED_tex(vec2((fp + vec2( 0.5, 0.5)) * HOOKED_pt)).r;
|
||||
float g = HOOKED_tex(vec2((fp + vec2( 1.5, 0.5)) * HOOKED_pt)).r;
|
||||
float h = HOOKED_tex(vec2((fp + vec2( 2.5, 0.5)) * HOOKED_pt)).r;
|
||||
|
||||
float i = HOOKED_tex(vec2((fp + vec2(-0.5, 1.5)) * HOOKED_pt)).r;
|
||||
float j = HOOKED_tex(vec2((fp + vec2( 0.5, 1.5)) * HOOKED_pt)).r;
|
||||
float k = HOOKED_tex(vec2((fp + vec2( 1.5, 1.5)) * HOOKED_pt)).r;
|
||||
float l = HOOKED_tex(vec2((fp + vec2( 2.5, 1.5)) * HOOKED_pt)).r;
|
||||
|
||||
float n = HOOKED_tex(vec2((fp + vec2(0.5, 2.5) ) * HOOKED_pt)).r;
|
||||
float o = HOOKED_tex(vec2((fp + vec2(1.5, 2.5) ) * HOOKED_pt)).r;
|
||||
|
||||
vec4 bczzL = vec4(b, c, 0.0, 0.0);
|
||||
vec4 ijfeL = vec4(i, j, f, e);
|
||||
vec4 klhgL = vec4(k, l, h, g);
|
||||
vec4 zzonL = vec4(0.0, 0.0, o, n);
|
||||
#endif
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
// Rename.
|
||||
float bL = bczzL.x;
|
||||
float cL = bczzL.y;
|
||||
float iL = ijfeL.x;
|
||||
float jL = ijfeL.y;
|
||||
float fL = ijfeL.z;
|
||||
float eL = ijfeL.w;
|
||||
float kL = klhgL.x;
|
||||
float lL = klhgL.y;
|
||||
float hL = klhgL.z;
|
||||
float gL = klhgL.w;
|
||||
float oL = zzonL.z;
|
||||
float nL = zzonL.w;
|
||||
|
||||
#if (FSR_PQ == 1)
|
||||
// Not the most performance-friendly solution, but should work until mpv adds proper gamma transformation functions for shaders
|
||||
bL = ToGamma2(bL);
|
||||
cL = ToGamma2(cL);
|
||||
iL = ToGamma2(iL);
|
||||
jL = ToGamma2(jL);
|
||||
fL = ToGamma2(fL);
|
||||
eL = ToGamma2(eL);
|
||||
kL = ToGamma2(kL);
|
||||
lL = ToGamma2(lL);
|
||||
hL = ToGamma2(hL);
|
||||
gL = ToGamma2(gL);
|
||||
oL = ToGamma2(oL);
|
||||
nL = ToGamma2(nL);
|
||||
#endif
|
||||
|
||||
// Accumulate for bilinear interpolation.
|
||||
vec2 dir = vec2(0.0);
|
||||
float len = 0.0;
|
||||
#if (FSR_EASU_SIMPLE_ANALYSIS == 1)
|
||||
FsrEasuSet(dir, len, pp, bL, cL, iL, jL, fL, eL, kL, lL, hL, gL, oL, nL);
|
||||
#elif (FSR_EASU_SIMPLE_ANALYSIS == 0)
|
||||
FsrEasuSet(dir, len, pp, true, false, false, false, bL, eL, fL, gL, jL);
|
||||
FsrEasuSet(dir, len, pp, false, true, false, false, cL, fL, gL, hL, kL);
|
||||
FsrEasuSet(dir, len, pp, false, false, true, false, fL, iL, jL, kL, nL);
|
||||
FsrEasuSet(dir, len, pp, false, false, false, true, gL, jL, kL, lL, oL);
|
||||
#endif
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
// Normalize with approximation, and cleanup close to zero.
|
||||
vec2 dir2 = dir * dir;
|
||||
float dirR = dir2.x + dir2.y;
|
||||
bool zro = dirR < float(1.0 / FSR_EASU_DIR_THRESHOLD);
|
||||
dirR = APrxLoRsqF1(dirR);
|
||||
#if (FSR_EASU_QUIT_EARLY == 1)
|
||||
if (zro) {
|
||||
vec4 w = vec4(0.0);
|
||||
w.x = (1.0 - pp.x) * (1.0 - pp.y);
|
||||
w.y = pp.x * (1.0 - pp.y);
|
||||
w.z = (1.0 - pp.x) * pp.y;
|
||||
w.w = pp.x * pp.y;
|
||||
|
||||
pix.r = clamp(dot(w, vec4(fL, gL, jL, kL)), 0.0, 1.0);
|
||||
return pix;
|
||||
}
|
||||
#elif (FSR_EASU_QUIT_EARLY == 0)
|
||||
dirR = zro ? 1.0 : dirR;
|
||||
dir.x = zro ? 1.0 : dir.x;
|
||||
#endif
|
||||
dir *= vec2(dirR);
|
||||
// Transform from {0 to 2} to {0 to 1} range, and shape with square.
|
||||
len = len * 0.5;
|
||||
len *= len;
|
||||
// Stretch kernel {1.0 vert|horz, to sqrt(2.0) on diagonal}.
|
||||
float stretch = (dir.x * dir.x + dir.y * dir.y) * APrxLoRcpF1(max(abs(dir.x), abs(dir.y)));
|
||||
// Anisotropic length after rotation,
|
||||
// x := 1.0 lerp to 'stretch' on edges
|
||||
// y := 1.0 lerp to 2x on edges
|
||||
vec2 len2 = vec2(1.0 + (stretch - 1.0) * len, 1.0 + -0.5 * len);
|
||||
// Based on the amount of 'edge',
|
||||
// the window shifts from +/-{sqrt(2.0) to slightly beyond 2.0}.
|
||||
float lob = 0.5 + float((1.0 / 4.0 - 0.04) - 0.5) * len;
|
||||
// Set distance^2 clipping point to the end of the adjustable window.
|
||||
float clp = APrxLoRcpF1(lob);
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
// Accumulation
|
||||
// b c
|
||||
// e f g h
|
||||
// i j k l
|
||||
// n o
|
||||
float aC = 0.0;
|
||||
float aW = 0.0;
|
||||
FsrEasuTap(aC, aW, vec2( 0.0,-1.0) - pp, dir, len2, lob, clp, bL); // b
|
||||
FsrEasuTap(aC, aW, vec2( 1.0,-1.0) - pp, dir, len2, lob, clp, cL); // c
|
||||
FsrEasuTap(aC, aW, vec2(-1.0, 1.0) - pp, dir, len2, lob, clp, iL); // i
|
||||
FsrEasuTap(aC, aW, vec2( 0.0, 1.0) - pp, dir, len2, lob, clp, jL); // j
|
||||
FsrEasuTap(aC, aW, vec2( 0.0, 0.0) - pp, dir, len2, lob, clp, fL); // f
|
||||
FsrEasuTap(aC, aW, vec2(-1.0, 0.0) - pp, dir, len2, lob, clp, eL); // e
|
||||
FsrEasuTap(aC, aW, vec2( 1.0, 1.0) - pp, dir, len2, lob, clp, kL); // k
|
||||
FsrEasuTap(aC, aW, vec2( 2.0, 1.0) - pp, dir, len2, lob, clp, lL); // l
|
||||
FsrEasuTap(aC, aW, vec2( 2.0, 0.0) - pp, dir, len2, lob, clp, hL); // h
|
||||
FsrEasuTap(aC, aW, vec2( 1.0, 0.0) - pp, dir, len2, lob, clp, gL); // g
|
||||
FsrEasuTap(aC, aW, vec2( 1.0, 2.0) - pp, dir, len2, lob, clp, oL); // o
|
||||
FsrEasuTap(aC, aW, vec2( 0.0, 2.0) - pp, dir, len2, lob, clp, nL); // n
|
||||
//------------------------------------------------------------------------------------------------------------------------------
|
||||
// Normalize and dering.
|
||||
pix.r = aC / aW;
|
||||
#if (FSR_EASU_DERING == 1)
|
||||
float min1 = min(AMin3F1(fL, gL, jL), kL);
|
||||
float max1 = max(AMax3F1(fL, gL, jL), kL);
|
||||
pix.r = clamp(pix.r, min1, max1);
|
||||
#endif
|
||||
pix.r = clamp(pix.r, 0.0, 1.0);
|
||||
|
||||
return pix;
|
||||
}
|
||||
|
||||
//!HOOK LUMA
|
||||
//!BIND EASUTEX
|
||||
//!DESC FidelityFX Super Resolution v1.0.2 (RCAS)
|
||||
//!WIDTH EASUTEX.w
|
||||
//!HEIGHT EASUTEX.h
|
||||
//!COMPONENTS 1
|
||||
|
||||
// User variables - RCAS
|
||||
#define SHARPNESS 0.2 // Controls the amount of sharpening. The scale is {0.0 := maximum, to N>0, where N is the number of stops (halving) of the reduction of sharpness}. 0.0 to 2.0.
|
||||
#define FSR_RCAS_DENOISE 1 // If set to 1, lessens the sharpening on noisy areas. Can be disabled for better performance. 0 or 1.
|
||||
#define FSR_PQ 0 // Whether the source content has PQ gamma or not. Needs to be set to the same value for both passes. 0 or 1.
|
||||
|
||||
// Shader code
|
||||
|
||||
#define FSR_RCAS_LIMIT (0.25 - (1.0 / 16.0)) // This is set at the limit of providing unnatural results for sharpening.
|
||||
|
||||
float APrxMedRcpF1(float a) {
|
||||
float b = uintBitsToFloat(uint(0x7ef19fff) - floatBitsToUint(a));
|
||||
return b * (-b * a + 2.0);
|
||||
}
|
||||
|
||||
float AMax3F1(float x, float y, float z) {
|
||||
return max(x, max(y, z));
|
||||
}
|
||||
|
||||
float AMin3F1(float x, float y, float z) {
|
||||
return min(x, min(y, z));
|
||||
}
|
||||
|
||||
#if (FSR_PQ == 1)
|
||||
|
||||
float FromGamma2(float a) {
|
||||
return sqrt(sqrt(a));
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
vec4 hook() {
|
||||
// Algorithm uses minimal 3x3 pixel neighborhood.
|
||||
// b
|
||||
// d e f
|
||||
// h
|
||||
#if (defined(EASUTEX_gather) && (__VERSION__ >= 400 || (GL_ES && __VERSION__ >= 310)))
|
||||
vec3 bde = EASUTEX_gather(EASUTEX_pos + EASUTEX_pt * vec2(-0.5), 0).xyz;
|
||||
float b = bde.z;
|
||||
float d = bde.x;
|
||||
float e = bde.y;
|
||||
|
||||
vec2 fh = EASUTEX_gather(EASUTEX_pos + EASUTEX_pt * vec2(0.5), 0).zx;
|
||||
float f = fh.x;
|
||||
float h = fh.y;
|
||||
#else
|
||||
float b = EASUTEX_texOff(vec2( 0.0, -1.0)).r;
|
||||
float d = EASUTEX_texOff(vec2(-1.0, 0.0)).r;
|
||||
float e = EASUTEX_tex(EASUTEX_pos).r;
|
||||
float f = EASUTEX_texOff(vec2(1.0, 0.0)).r;
|
||||
float h = EASUTEX_texOff(vec2(0.0, 1.0)).r;
|
||||
#endif
|
||||
|
||||
// Min and max of ring.
|
||||
float mn1L = min(AMin3F1(b, d, f), h);
|
||||
float mx1L = max(AMax3F1(b, d, f), h);
|
||||
|
||||
// Immediate constants for peak range.
|
||||
vec2 peakC = vec2(1.0, -1.0 * 4.0);
|
||||
|
||||
// Limiters, these need to be high precision RCPs.
|
||||
float hitMinL = min(mn1L, e) / (4.0 * mx1L);
|
||||
float hitMaxL = (peakC.x - max(mx1L, e)) / (4.0 * mn1L + peakC.y);
|
||||
float lobeL = max(-hitMinL, hitMaxL);
|
||||
float lobe = max(float(-FSR_RCAS_LIMIT), min(lobeL, 0.0)) * exp2(-clamp(float(SHARPNESS), 0.0, 2.0));
|
||||
|
||||
// Apply noise removal.
|
||||
#if (FSR_RCAS_DENOISE == 1)
|
||||
// Noise detection.
|
||||
float nz = 0.25 * b + 0.25 * d + 0.25 * f + 0.25 * h - e;
|
||||
nz = clamp(abs(nz) * APrxMedRcpF1(AMax3F1(AMax3F1(b, d, e), f, h) - AMin3F1(AMin3F1(b, d, e), f, h)), 0.0, 1.0);
|
||||
nz = -0.5 * nz + 1.0;
|
||||
lobe *= nz;
|
||||
#endif
|
||||
|
||||
// Resolve, which needs the medium precision rcp approximation to avoid visible tonality changes.
|
||||
float rcpL = APrxMedRcpF1(4.0 * lobe + 1.0);
|
||||
vec4 pix = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
pix.r = float((lobe * b + lobe * d + lobe * h + lobe * f + e) * rcpL);
|
||||
#if (FSR_PQ == 1)
|
||||
pix.r = FromGamma2(pix.r);
|
||||
#endif
|
||||
|
||||
return pix;
|
||||
}
|
1148
mpv/shaders-old/FSRCNNX_x2_16-0-4-1.glsl
Executable file
1148
mpv/shaders-old/FSRCNNX_x2_16-0-4-1.glsl
Executable file
File diff suppressed because it is too large
Load diff
426
mpv/shaders-old/FSRCNNX_x2_8-0-4-1.glsl
Executable file
426
mpv/shaders-old/FSRCNNX_x2_8-0-4-1.glsl
Executable file
|
@ -0,0 +1,426 @@
|
|||
// Copyright (C) 2017-2021 igv
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public
|
||||
// License as published by the Free Software Foundation; either
|
||||
// version 3.0 of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
//!HOOK LUMA
|
||||
//!WHEN OUTPUT.w LUMA.w / 1.300 > OUTPUT.h LUMA.h / 1.300 > *
|
||||
//!DESC feature map 1
|
||||
//!BIND LUMA
|
||||
//!SAVE FEATURE1
|
||||
//!COMPONENTS 4
|
||||
vec4 hook()
|
||||
{
|
||||
vec4 res = vec4(-0.1572492271661758,-0.0120896836742759,0.0061487639322877,-0.2852848768234253);
|
||||
res += vec4(-0.0047900392673910,0.0537447109818459,-0.0000247144635068,0.0066653941757977) * float(LUMA_texOff(vec2(-2,-2)));
|
||||
res += vec4(0.0073144687339664,-0.0309004038572311,-0.0109181385487318,-0.0092840325087309) * float(LUMA_texOff(vec2(-2,-1)));
|
||||
res += vec4(0.0591700896620750,0.1974907070398331,-0.0197357516735792,-0.0546554848551750) * float(LUMA_texOff(vec2(-2,0)));
|
||||
res += vec4(-0.0011764382943511,-0.0299451071768999,0.0229587312787771,0.0021908886265010) * float(LUMA_texOff(vec2(-2,1)));
|
||||
res += vec4(0.0098101310431957,0.0080995410680771,-0.0030452020000666,-0.0132035519927740) * float(LUMA_texOff(vec2(-2,2)));
|
||||
res += vec4(-0.0168330334126949,-0.0743711441755295,-0.0259261634200811,0.0234480481594801) * float(LUMA_texOff(vec2(-1,-2)));
|
||||
res += vec4(0.0239933785051107,0.1896541714668274,0.0207756329327822,-0.0370332375168800) * float(LUMA_texOff(vec2(-1,-1)));
|
||||
res += vec4(0.0094799501821399,-0.0652511194348335,-0.0004292793164495,-0.0726212188601494) * float(LUMA_texOff(vec2(-1,0)));
|
||||
res += vec4(0.0297284796833992,-0.1210186630487442,-0.0202929321676493,-0.0574462898075581) * float(LUMA_texOff(vec2(-1,1)));
|
||||
res += vec4(-0.0318185277283192,0.0840775370597839,0.0110451309010386,0.0415569432079792) * float(LUMA_texOff(vec2(-1,2)));
|
||||
res += vec4(-0.0253141783177853,0.1168256178498268,0.1159729585051537,0.0963164269924164) * float(LUMA_texOff(vec2(0,-2)));
|
||||
res += vec4(-0.1103615835309029,-0.0276833958923817,-0.4999594092369080,0.1053867191076279) * float(LUMA_texOff(vec2(0,-1)));
|
||||
res += vec4(1.1100435256958008,0.0646764487028122,0.0154005717486143,0.8891586661338806) * float(LUMA_texOff(vec2(0,0)));
|
||||
res += vec4(0.1229330673813820,0.1719468832015991,0.5730338096618652,-0.1645544171333313) * float(LUMA_texOff(vec2(0,1)));
|
||||
res += vec4(-0.0090442728251219,-0.3023961782455444,-0.1589493155479431,0.0418574027717113) * float(LUMA_texOff(vec2(0,2)));
|
||||
res += vec4(0.0031942036002874,-0.1310926079750061,0.0075543406419456,-0.0016449346439913) * float(LUMA_texOff(vec2(1,-2)));
|
||||
res += vec4(-0.0995150282979012,-0.0701921209692955,-0.0130895879119635,0.1344170123338699) * float(LUMA_texOff(vec2(1,-1)));
|
||||
res += vec4(0.0060519003309309,-0.1533465683460236,0.0114194005727768,0.0264683905988932) * float(LUMA_texOff(vec2(1,0)));
|
||||
res += vec4(0.0244008023291826,0.1881769001483917,-0.0206351149827242,-0.0628309547901154) * float(LUMA_texOff(vec2(1,1)));
|
||||
res += vec4(0.0075713125988841,0.0508594363927841,0.0430423170328140,-0.0124188791960478) * float(LUMA_texOff(vec2(1,2)));
|
||||
res += vec4(-0.0166875869035721,-0.0047865519300103,0.0006719123339280,0.0316803231835365) * float(LUMA_texOff(vec2(2,-2)));
|
||||
res += vec4(-0.0058461269363761,0.0990798473358154,-0.0177743826061487,-0.0066122291609645) * float(LUMA_texOff(vec2(2,-1)));
|
||||
res += vec4(-0.0972401946783066,-0.0225446373224258,-0.0037693574558944,0.1953062713146210) * float(LUMA_texOff(vec2(2,0)));
|
||||
res += vec4(-0.0216837190091610,-0.1824268400669098,0.0069816261529922,0.0283037684857845) * float(LUMA_texOff(vec2(2,1)));
|
||||
res += vec4(-0.0025767991319299,0.0459827110171318,-0.0080216089263558,0.0084134787321091) * float(LUMA_texOff(vec2(2,2)));
|
||||
return res;
|
||||
}
|
||||
|
||||
//!HOOK LUMA
|
||||
//!WHEN OUTPUT.w LUMA.w / 1.300 > OUTPUT.h LUMA.h / 1.300 > *
|
||||
//!DESC feature map 2
|
||||
//!BIND LUMA
|
||||
//!SAVE FEATURE2
|
||||
//!COMPONENTS 4
|
||||
vec4 hook()
|
||||
{
|
||||
vec4 res = vec4(0.0541447550058365,0.0088306749239564,-0.0112389577552676,-0.0127860950306058);
|
||||
res += vec4(0.0142660010606050,0.0137931071221828,0.0061188107356429,-0.0104134222492576) * float(LUMA_texOff(vec2(-2,-2)));
|
||||
res += vec4(0.0147292809560895,-0.0289912857115269,0.0266769435256720,0.0933856964111328) * float(LUMA_texOff(vec2(-2,-1)));
|
||||
res += vec4(-0.1734338253736496,0.1116316691040993,-0.1973157376050949,-0.0581855811178684) * float(LUMA_texOff(vec2(-2,0)));
|
||||
res += vec4(0.0347507223486900,-0.0341566652059555,0.0061667622067034,0.0075258882716298) * float(LUMA_texOff(vec2(-2,1)));
|
||||
res += vec4(0.0069884369149804,-0.0194250214844942,0.0080830128863454,-0.0036874092184007) * float(LUMA_texOff(vec2(-2,2)));
|
||||
res += vec4(0.0233764201402664,0.0344744995236397,0.0162145942449570,0.0979529991745949) * float(LUMA_texOff(vec2(-1,-2)));
|
||||
res += vec4(0.1280796974897385,-0.1018339172005653,-0.0132977198809385,-0.0019474622095004) * float(LUMA_texOff(vec2(-1,-1)));
|
||||
res += vec4(0.4286882579326630,0.1222677752375603,0.7046694159507751,0.0945475697517395) * float(LUMA_texOff(vec2(-1,0)));
|
||||
res += vec4(0.1107441782951355,-0.0134433070197701,-0.0174900908023119,-0.1686445474624634) * float(LUMA_texOff(vec2(-1,1)));
|
||||
res += vec4(0.0321478620171547,0.0065357843413949,0.0300805997103453,0.0420113280415535) * float(LUMA_texOff(vec2(-1,2)));
|
||||
res += vec4(-0.1240341588854790,0.0950303301215172,-0.0129648456349969,-0.2681856453418732) * float(LUMA_texOff(vec2(0,-2)));
|
||||
res += vec4(0.4846960902214050,0.0351924635469913,0.0223043337464333,-0.1273630708456039) * float(LUMA_texOff(vec2(0,-1)));
|
||||
res += vec4(-1.9379507303237915,-0.2444442063570023,0.0291962660849094,-0.3835578560829163) * float(LUMA_texOff(vec2(0,0)));
|
||||
res += vec4(0.6396278142929077,-0.0765938311815262,-0.0552659817039967,0.4393545985221863) * float(LUMA_texOff(vec2(0,1)));
|
||||
res += vec4(-0.1969728022813797,-0.0607173256576061,0.0131113547831774,0.0542017817497253) * float(LUMA_texOff(vec2(0,2)));
|
||||
res += vec4(0.0091696009039879,-0.0031533432193100,-0.0368777588009834,-0.0459998287260532) * float(LUMA_texOff(vec2(1,-2)));
|
||||
res += vec4(0.1096992492675781,0.2597902715206146,0.0304869692772627,-0.0195200722664595) * float(LUMA_texOff(vec2(1,-1)));
|
||||
res += vec4(0.2889648377895355,-0.4275591969490051,-0.7414156794548035,0.2695442438125610) * float(LUMA_texOff(vec2(1,0)));
|
||||
res += vec4(0.0892018377780914,-0.0229137558490038,0.0244414471089840,-0.1926898956298828) * float(LUMA_texOff(vec2(1,1)));
|
||||
res += vec4(0.0576358586549759,0.0027846973389387,-0.0036861505359411,-0.0253547113388777) * float(LUMA_texOff(vec2(1,2)));
|
||||
res += vec4(0.0159624069929123,0.0319602824747562,0.0019470085389912,0.0089780492708087) * float(LUMA_texOff(vec2(2,-2)));
|
||||
res += vec4(0.0552792511880398,0.0543054342269897,0.0134062822908163,0.0545728243887424) * float(LUMA_texOff(vec2(2,-1)));
|
||||
res += vec4(-0.1170092225074768,0.1963327825069427,0.1503890156745911,0.1891828328371048) * float(LUMA_texOff(vec2(2,0)));
|
||||
res += vec4(-0.0084421783685684,0.1297017931938171,-0.0330600887537003,-0.0942063704133034) * float(LUMA_texOff(vec2(2,1)));
|
||||
res += vec4(0.0118440408259630,-0.0337875857949257,0.0055063469335437,0.0254479162395000) * float(LUMA_texOff(vec2(2,2)));
|
||||
return res;
|
||||
}
|
||||
|
||||
//!HOOK LUMA
|
||||
//!WHEN OUTPUT.w LUMA.w / 1.300 > OUTPUT.h LUMA.h / 1.300 > *
|
||||
//!DESC mapping 1_1
|
||||
//!BIND FEATURE1
|
||||
//!BIND FEATURE2
|
||||
//!SAVE MODEL21
|
||||
//!COMPONENTS 4
|
||||
vec4 hook()
|
||||
{
|
||||
vec4 res = vec4(-0.0445119962096214,-0.7632357478141785,0.0156328510493040,-0.2424548566341400);
|
||||
res += mat4(0.1279004216194153,-0.0275541823357344,0.2275633513927460,0.2241709381341934,0.0197204202413559,-0.0456816256046295,-0.1296672523021698,0.0564568229019642,-0.0241488646715879,-0.0237508192658424,-0.1899632662534714,0.4177669584751129,-0.1814560592174530,-0.0526473335921764,0.1154382973909378,-0.0715614855289459) * FEATURE1_texOff(vec2(-1,-1));
|
||||
res += mat4(-0.0660311505198479,0.0416736751794815,0.3146112561225891,0.1472041457891464,-0.3456672728061676,-0.0055983816273510,0.0022350433282554,0.0819796621799469,0.0057485047727823,0.1532524228096008,0.0204557459801435,-0.2500547170639038,-0.0524359568953514,-0.1911625266075134,-0.1078366711735725,-0.1296254843473434) * FEATURE2_texOff(vec2(-1,-1));
|
||||
res += mat4(0.0904538556933403,-0.0150672039017081,0.3322310745716095,0.0638923197984695,0.5975797176361084,-0.2452044337987900,-0.4947478473186493,-0.0783191770315170,0.5771877169609070,-0.0870653912425041,-0.8966570496559143,-0.2140965163707733,-0.0493861362338066,-0.0380848757922649,-0.1345319598913193,-0.0186063013970852) * FEATURE1_texOff(vec2(-1,0));
|
||||
res += mat4(-0.2523841261863708,0.1387074738740921,0.7878478765487671,-0.2251627445220947,0.2277439534664154,0.5417668819427490,0.0866540968418121,-0.1707777529954910,-0.0598246827721596,-0.4717158675193787,-1.2242834568023682,0.0454643070697784,-0.3503442704677582,0.0573085807263851,0.2530198395252228,-0.0207283068448305) * FEATURE2_texOff(vec2(-1,0));
|
||||
res += mat4(0.0168380383402109,-0.2142438590526581,-0.0207892972975969,0.3628533780574799,0.2431225180625916,0.3098322153091431,0.4073205888271332,-0.2762102782726288,-0.0197229012846947,0.1305596232414246,-0.5697882771492004,-0.2976251542568207,-0.0551432967185974,0.2614036500453949,-0.1410341411828995,-0.2906406223773956) * FEATURE1_texOff(vec2(-1,1));
|
||||
res += mat4(-0.0498303361237049,0.0224859956651926,0.1952174901962280,-0.0311204437166452,0.2501715123653412,-0.5893352627754211,-1.0793941020965576,0.0160885509103537,0.5081620812416077,0.0482814386487007,0.0546359121799469,-0.0501569248735905,0.1400523334741592,-0.0106841633096337,-0.0940591320395470,-0.1791856139898300) * FEATURE2_texOff(vec2(-1,1));
|
||||
res += mat4(0.0393299944698811,0.2232691347599030,-0.1055066883563995,-0.1607919186353683,-0.1567825973033905,-0.0042221010662615,-0.0548228211700916,0.2352052628993988,0.1483389288187027,0.7503526806831360,0.0797731876373291,-0.0049001369625330,-0.0242983382195234,-0.0308702979236841,0.0828925222158432,0.0561857633292675) * FEATURE1_texOff(vec2(0,-1));
|
||||
res += mat4(0.0926392748951912,-0.0418718457221985,-0.3060409128665924,-0.1883587390184402,0.0284292586147785,-0.3584854304790497,-0.7909982800483704,-0.0187337957322598,-0.2496993243694305,-0.7520986795425415,0.3771523833274841,-0.0259053874760866,0.0337998159229755,0.2209153026342392,0.0708771497011185,-0.2814430892467499) * FEATURE2_texOff(vec2(0,-1));
|
||||
res += mat4(-0.5287809371948242,0.5777525901794434,0.0880500450730324,-0.8452472090721130,-0.3393408954143524,-0.2273543328046799,-0.1298527419567108,0.4990308582782745,1.2613251209259033,-0.7636719942092896,1.5694186687469482,-0.4087363779544830,0.0874531939625740,0.7067158818244934,-0.3419588804244995,-0.3265531957149506) * FEATURE1_texOff(vec2(0,0));
|
||||
res += mat4(0.8229957222938538,-0.1236215904355049,-0.1859253048896790,1.6684840917587280,0.2000777721405029,-0.1239093989133835,1.5623438358306885,0.1779983490705490,0.1017884835600853,-0.3707404434680939,1.0626678466796875,-0.3124029338359833,0.0659058541059494,-0.3585464656352997,-0.1866402775049210,0.6733445525169373) * FEATURE2_texOff(vec2(0,0));
|
||||
res += mat4(-0.5544115900993347,-0.1892931908369064,0.2460739761590958,-0.1056193932890892,-0.4318082630634308,0.1257930994033813,-0.2672747671604156,-0.1690235435962677,0.0018221997888759,-0.4397548139095306,-0.3007801771163940,0.1068472340703011,0.3506655991077423,0.1143834441900253,0.1363849341869354,-0.1417382210493088) * FEATURE1_texOff(vec2(0,1));
|
||||
res += mat4(-0.0505668744444847,0.1831464916467667,0.3957343697547913,-0.2295413911342621,-0.3892803490161896,0.5436951518058777,0.1217770799994469,0.0223295800387859,-0.4462866187095642,-0.4055982232093811,-0.3771279454231262,0.0807068347930908,0.2116729617118835,0.0281026475131512,-0.0229265503585339,0.2868605256080627) * FEATURE2_texOff(vec2(0,1));
|
||||
res += mat4(0.1962712109088898,-0.2373334914445877,-2.5208437442779541,-0.1988540291786194,0.2224564403295517,-0.1783192902803421,-0.3962321281433105,-0.1685980409383774,0.1910390257835388,0.2554391324520111,0.4586416482925415,0.2779130041599274,-0.2002453953027725,-0.0061091855168343,1.3808131217956543,0.0434907525777817) * FEATURE1_texOff(vec2(1,-1));
|
||||
res += mat4(-0.0307611189782619,-0.0524470545351505,-0.5897512435913086,-0.0816674903035164,0.4052906930446625,0.2542210817337036,-1.9041002988815308,0.0835462361574173,-0.2484460622072220,-0.0184739269316196,0.4510098397731781,0.2587619423866272,0.1537084281444550,0.1503131389617920,-0.0742949545383453,0.0613216012716293) * FEATURE2_texOff(vec2(1,-1));
|
||||
res += mat4(0.1772638261318207,0.0948876664042473,0.0083848545327783,-0.2919732332229614,0.2566950321197510,0.0288751143962145,-0.4624863862991333,-0.0608786940574646,0.3310996592044830,-0.0104284398257732,0.6334818005561829,-0.0027201652992517,-0.0342350602149963,0.1938806027173996,-0.2464301586151123,0.0125883584842086) * FEATURE1_texOff(vec2(1,0));
|
||||
res += mat4(0.4839433431625366,-0.0502159744501114,-1.1114163398742676,-0.3965759575366974,0.2117286175489426,0.0414481423795223,-0.1332397013902664,-0.0549883767962456,-0.1275007277727127,0.7844302654266357,-0.0095163453370333,0.0961041301488876,-0.4759134948253632,-0.4284025132656097,-0.2072399407625198,-0.3953579664230347) * FEATURE2_texOff(vec2(1,0));
|
||||
res += mat4(0.1605869531631470,-0.1715892106294632,0.0865620598196983,-0.0464400537312031,-0.2688548862934113,0.1722514480352402,0.0167612321674824,-0.0032994034700096,-0.3451044559478760,-0.2280300110578537,-0.0029796555172652,-0.1597652435302734,0.0500137843191624,0.1023071259260178,-0.0407028235495090,0.2228624969720840) * FEATURE1_texOff(vec2(1,1));
|
||||
res += mat4(0.6999920010566711,0.0839441940188408,0.0815469548106194,-0.1509176045656204,-0.0690853074193001,-0.3200871348381042,0.0780162736773491,-0.1449639797210693,0.2868815064430237,0.3962450027465820,-0.3439113497734070,0.2657423913478851,0.0988137871026993,0.3471299111843109,-0.2186402678489685,-0.0648017078638077) * FEATURE2_texOff(vec2(1,1));
|
||||
res = max(res, vec4(0.0)) + vec4(1.0311057567596436,0.1051208898425102,0.1158760935068130,0.0466635078191757) * min(res, vec4(0.0));
|
||||
return res;
|
||||
}
|
||||
|
||||
//!HOOK LUMA
|
||||
//!WHEN OUTPUT.w LUMA.w / 1.300 > OUTPUT.h LUMA.h / 1.300 > *
|
||||
//!DESC mapping 1_2
|
||||
//!BIND FEATURE1
|
||||
//!BIND FEATURE2
|
||||
//!SAVE MODEL22
|
||||
//!COMPONENTS 4
|
||||
vec4 hook()
|
||||
{
|
||||
vec4 res = vec4(0.0713458731770515,-0.1403961777687073,-0.0019562745001167,0.0153338573873043);
|
||||
res += mat4(-0.0950641855597496,-0.1496641039848328,-0.0653550028800964,0.0655386000871658,-0.0118882004171610,0.2012491524219513,-0.2844599783420563,-0.4794720113277435,0.1128025799989700,-0.0173030979931355,-0.0558849945664406,-0.2957552075386047,0.0128202112391591,0.0199047476053238,-0.0091027505695820,-0.0789640173316002) * FEATURE1_texOff(vec2(-1,-1));
|
||||
res += mat4(0.1597457975149155,-0.0476507246494293,0.1466529071331024,0.0859163030982018,0.0797316282987595,-0.3380981683731079,0.2370245009660721,-0.1145931258797646,-0.0352988094091415,-0.0444888733327389,-0.2100716233253479,0.1305520236492157,-0.1359029710292816,0.1097442805767059,0.0449938289821148,-0.1155664771795273) * FEATURE2_texOff(vec2(-1,-1));
|
||||
res += mat4(-0.0333916284143925,0.2415594160556793,0.0520512908697128,0.1228107511997223,-0.0491011217236519,0.4408806562423706,0.4631956815719604,0.2014560103416443,-0.3688595592975616,0.0367180295288563,0.2484581321477890,-0.1113442853093147,0.1283355057239532,0.0418004281818867,-0.0171243026852608,-0.1231943219900131) * FEATURE1_texOff(vec2(-1,0));
|
||||
res += mat4(0.3493446409702301,0.4550022482872009,0.0368724688887596,0.0748724937438965,0.5001406073570251,0.0145555436611176,0.1236629858613014,0.3143120706081390,-0.1951988488435745,-0.0157914645969868,0.0937998965382576,-0.2233840376138687,0.5033411383628845,-0.3183194100856781,-0.2259195148944855,0.3639536798000336) * FEATURE2_texOff(vec2(-1,0));
|
||||
res += mat4(-0.0742707476019859,-0.1287801116704941,-0.2533137500286102,0.0666435658931732,-0.0185621567070484,0.1427449285984039,-0.0724751204252243,-0.0781485065817833,-0.2270648330450058,-0.2314778864383698,0.3814929425716400,-0.1655400246381760,0.0408568829298019,-0.1139645278453827,0.1797397136688232,-0.0245632305741310) * FEATURE1_texOff(vec2(-1,1));
|
||||
res += mat4(0.1184135973453522,0.0439366139471531,0.0225226897746325,-0.0038526873104274,0.1292685419321060,0.0629177838563919,0.3455114960670471,-0.1857204884290695,-0.4921502172946930,-0.1171003505587578,0.0188624169677496,-0.1101682260632515,0.0676844567060471,0.5154085755348206,-0.0898379907011986,0.3413280248641968) * FEATURE2_texOff(vec2(-1,1));
|
||||
res += mat4(-0.2631838321685791,0.0215514600276947,0.3092688918113708,-0.0200904365628958,0.0678770467638969,0.1769931465387344,-0.3653681278228760,-0.3274513185024261,0.4608019888401031,-0.1544784456491470,0.1189439669251442,0.7015876173973083,0.2732816934585571,-0.0545057803392410,-0.3474545478820801,-0.0253226496279240) * FEATURE1_texOff(vec2(0,-1));
|
||||
res += mat4(0.0994316861033440,0.0642566010355949,0.2031503319740295,0.2276959568262100,-0.1094077304005623,0.4463521838188171,0.0921792611479759,-0.3033096492290497,-0.0953373983502388,-0.1331395804882050,0.2615413069725037,-0.2874414622783661,-0.0389687754213810,0.0338272154331207,0.2804331183433533,-0.3443813025951385) * FEATURE2_texOff(vec2(0,-1));
|
||||
res += mat4(-0.1806042939424515,-0.4840798676013947,0.4222546219825745,0.1238701492547989,0.0117481639608741,-0.5986865758895874,0.3057619929313660,0.1934896260499954,-0.7086342573165894,-0.8567376136779785,0.6944998502731323,-1.4599204063415527,0.0886754393577576,-0.4293498098850250,-0.1524195969104767,0.2418079674243927) * FEATURE1_texOff(vec2(0,0));
|
||||
res += mat4(2.1706113815307617,0.3525652289390564,-0.7008359432220459,-0.4825965166091919,-0.3203429281711578,0.8500943183898926,-0.7993509769439697,0.4329842329025269,0.2106771767139435,1.1103280782699585,1.2092385292053223,1.4814503192901611,-0.4147390127182007,-0.7046836614608765,-0.1443170011043549,-0.6811133027076721) * FEATURE2_texOff(vec2(0,0));
|
||||
res += mat4(-0.1489356607198715,0.1400019824504852,0.2425604313611984,-0.2098473459482193,-0.1580564379692078,0.1463224738836288,-0.2187854647636414,0.5174596905708313,-0.0143817225471139,-0.0362622961401939,-0.0068237944506109,0.4749472737312317,0.2914732992649078,-0.3306328952312469,-0.2444777786731720,-0.1171946674585342) * FEATURE1_texOff(vec2(0,1));
|
||||
res += mat4(0.0455239675939083,0.3496046066284180,0.1297491937875748,-0.2541095912456512,0.3605501055717468,0.2339573651552200,-0.0188565086573362,-0.0526181310415268,0.1471424549818039,0.8212822079658508,0.0819099843502045,-0.0851665437221527,0.3739568293094635,0.1304695755243301,0.1481167376041412,-0.2134698331356049) * FEATURE2_texOff(vec2(0,1));
|
||||
res += mat4(-0.2076720446348190,-0.0932599306106567,0.0648527294397354,-0.2374770641326904,-0.0927826911211014,0.1848200261592865,0.4131188094615936,0.3280069231987000,-0.2099185734987259,0.2130926996469498,-0.0362745784223080,0.0191331822425127,0.1590368449687958,0.0303016249090433,0.1207325309514999,0.2451425045728683) * FEATURE1_texOff(vec2(1,-1));
|
||||
res += mat4(-0.0135009605437517,-0.0101303057745099,0.0752487555146217,0.0533373840153217,-0.0253537259995937,0.1318614929914474,-0.1263181120157242,0.0249524712562561,-0.1477261483669281,0.3236559033393860,0.0773291289806366,-0.1439673304557800,-0.2005890905857086,0.0892757251858711,0.0398719944059849,0.3675192892551422) * FEATURE2_texOff(vec2(1,-1));
|
||||
res += mat4(-0.0193535499274731,-0.2256918102502823,0.0341436080634594,0.0795947611331940,0.1496857404708862,-0.2784725725650787,-0.0582313314080238,-0.2786065340042114,-0.1666128039360046,-0.6534121036529541,0.2695854306221008,-0.0179719906300306,0.0015976354479790,0.0139929885044694,-0.1706486046314240,-0.3274765610694885) * FEATURE1_texOff(vec2(1,0));
|
||||
res += mat4(-0.7170836329460144,0.0868831276893616,0.1829078495502472,-0.0076045366004109,0.1525912433862686,-0.2558896839618683,0.0893209800124168,-0.3426039516925812,-0.2871107757091522,-0.2445062994956970,0.1676304638385773,0.2116415053606033,0.0883995518088341,-0.3880331516265869,0.2636835277080536,-0.2514505982398987) * FEATURE2_texOff(vec2(1,0));
|
||||
res += mat4(-0.1861270815134048,0.2000686377286911,-0.1501186788082123,0.1525203883647919,0.1969228833913803,0.1174068301916122,-0.1281060427427292,-0.0854888409376144,0.0290613435208797,-0.0538076497614384,-0.0251582786440849,0.0692845508456230,0.0384319014847279,0.2888138592243195,0.1151804402470589,0.0990421250462532) * FEATURE1_texOff(vec2(1,1));
|
||||
res += mat4(-0.0344385802745819,0.1270371377468109,0.0922426953911781,-0.0426749102771282,-0.1656492203474045,-0.3273328542709351,-0.0282224025577307,0.1099396124482155,-0.1113230437040329,0.2943290174007416,-0.2181112915277481,-0.3177657723426819,-0.1096536740660667,-0.0508293099701405,-0.0256164856255054,-0.0388228967785835) * FEATURE2_texOff(vec2(1,1));
|
||||
res = max(res, vec4(0.0)) + vec4(0.7142407894134521,0.0686190053820610,0.3999933302402496,-1.0247212648391724) * min(res, vec4(0.0));
|
||||
return res;
|
||||
}
|
||||
|
||||
//!HOOK LUMA
|
||||
//!WHEN OUTPUT.w LUMA.w / 1.300 > OUTPUT.h LUMA.h / 1.300 > *
|
||||
//!DESC mapping 2_1
|
||||
//!BIND MODEL21
|
||||
//!BIND MODEL22
|
||||
//!SAVE MODEL1
|
||||
//!COMPONENTS 4
|
||||
vec4 hook()
|
||||
{
|
||||
vec4 res = vec4(0.0203563515096903,0.1902436912059784,-0.0757935121655464,0.0393617525696754);
|
||||
res += mat4(-0.1080558672547340,-0.0400269515812397,0.1042881682515144,-0.1994346678256989,0.0172465778887272,-0.0829331055283546,-0.1278677284717560,-0.0762506872415543,-0.0593080408871174,-0.0305212251842022,0.1326192617416382,-0.3380933105945587,-0.0722763314843178,-0.1975518912076950,-0.0223602931946516,0.2251029163599014) * MODEL21_texOff(vec2(-1,-1));
|
||||
res += mat4(0.1747678220272064,0.0297168865799904,0.1054855734109879,0.0803295820951462,-0.0338115766644478,-0.3885377943515778,-0.3540246784687042,-0.0719623491168022,-0.0656022280454636,-0.0469004511833191,0.1379419565200806,0.0319863893091679,0.0799935683608055,-0.0099127553403378,0.1698455959558487,-0.0108015276491642) * MODEL22_texOff(vec2(-1,-1));
|
||||
res += mat4(0.1587898135185242,0.3995443880558014,-0.0333226583898067,0.2373267263174057,-0.1616930961608887,0.0659186244010925,0.0141129801049829,-0.0541022196412086,-0.5743742585182190,0.1121487766504288,0.4259817600250244,0.0280795227736235,-0.3721714317798615,-0.3496374189853668,0.0997273251414299,-0.0079920450225472) * MODEL21_texOff(vec2(-1,0));
|
||||
res += mat4(0.0928084030747414,0.3107658624649048,0.1375299990177155,0.1550617516040802,-0.0780353918671608,-0.0102957757189870,-0.2056752145290375,-0.3927979469299316,-1.2112152576446533,0.0213295854628086,0.1396545022726059,0.0492016039788723,-0.0569122135639191,-0.1691886335611343,-0.1535325646400452,0.2800904810428619) * MODEL22_texOff(vec2(-1,0));
|
||||
res += mat4(0.2494744062423706,-0.0363066755235195,0.0959179550409317,-0.0048101749271154,-0.0195793900638819,0.0451166369020939,0.1470773071050644,-0.0050059854984283,0.2886958122253418,-0.3221147954463959,-0.7062104344367981,0.1646659970283508,-0.0092520527541637,-0.1254461258649826,0.0217506736516953,-0.0678806379437447) * MODEL21_texOff(vec2(-1,1));
|
||||
res += mat4(-0.0686557441949844,-0.0414490625262260,-0.1855954080820084,0.0264346338808537,-0.0296857114881277,-0.0431593284010887,0.0669397041201591,-0.0946076661348343,-0.2036914378404617,-0.1336101740598679,-0.2099903970956802,-0.1327936947345734,-0.1002155169844627,-0.0368575826287270,-0.1660962998867035,0.0728288888931274) * MODEL22_texOff(vec2(-1,1));
|
||||
res += mat4(0.5504320859909058,0.2939232587814331,0.4704743027687073,0.2129514217376709,0.0843106731772423,-0.1978624463081360,-0.3298224806785583,0.1919094175100327,0.1980742365121841,-0.0644423812627792,0.0091170109808445,-0.2124856859445572,0.0804558470845222,-0.1130188927054405,-0.6276652812957764,0.1861163526773453) * MODEL21_texOff(vec2(0,-1));
|
||||
res += mat4(-0.3357668519020081,0.2093413323163986,0.4355416595935822,0.1550502777099609,-0.6510964035987854,-0.1751857399940491,-0.2060168534517288,-0.1710205078125000,-0.1202360317111015,-0.2500316798686981,0.1074745431542397,-0.2418434321880341,0.0133954072371125,-0.0555886104702950,0.1514673978090286,0.2739115655422211) * MODEL22_texOff(vec2(0,-1));
|
||||
res += mat4(-0.3006273508071899,-0.2699472010135651,-0.1982013583183289,-0.0032952548936009,0.0307833012193441,0.3671586215496063,-0.0966020002961159,-0.2836556434631348,0.4297264218330383,0.6171903610229492,0.6723483800888062,0.2705117464065552,-0.1438141316175461,-0.0873940736055374,-0.7001031041145325,-0.2052250355482101) * MODEL21_texOff(vec2(0,0));
|
||||
res += mat4(-0.2875024676322937,-1.6230558156967163,-0.6733398437500000,-0.9642448425292969,-0.1964960694313049,0.2485812455415726,0.1236900389194489,-1.1423941850662231,-0.0412602946162224,0.3412002623081207,0.3962794244289398,-0.2490761876106262,-0.0058065578341484,-0.4578708708286285,-0.2418260127305984,0.5357795953750610) * MODEL22_texOff(vec2(0,0));
|
||||
res += mat4(0.0062361713498831,0.1925230026245117,0.0824977159500122,0.0561275146901608,0.0929671525955200,0.0698546022176743,0.3816939592361450,0.0395248420536518,-0.0719512030482292,0.0564917400479317,-0.1297784000635147,0.1245511695742607,0.0012355837970972,-0.0990515723824501,0.4213519692420959,-0.1645816713571548) * MODEL21_texOff(vec2(0,1));
|
||||
res += mat4(-0.0611936338245869,-0.0220258161425591,-0.0040935277938843,-0.1060328409075737,-0.0583154149353504,-0.0171997752040625,0.1058546081185341,0.2793170809745789,-0.2339317053556442,-0.1972009539604187,-0.0600687190890312,-0.0684379041194916,0.0243016034364700,-0.2111079394817352,-0.2042971849441528,0.0724857896566391) * MODEL22_texOff(vec2(0,1));
|
||||
res += mat4(-0.0833447948098183,-0.0533220991492271,0.0767802372574806,0.1182348504662514,-0.0223299078643322,-0.0479344800114632,-0.0119727496057749,0.0524821877479553,-0.0334780365228653,0.0719002187252045,0.0439689308404922,0.0475181229412556,0.0764308497309685,0.0086713796481490,-0.1700707823038101,0.0657354295253754) * MODEL21_texOff(vec2(1,-1));
|
||||
res += mat4(0.1391696482896805,0.0739523395895958,0.0565792545676231,-0.0430364646017551,0.0943084582686424,0.0102064209058881,0.0120795257389545,-0.0841303989291191,0.1573246121406555,0.0164279472082853,0.0988841354846954,-0.1430613398551941,-0.0572808869183064,-0.0844292491674423,0.0621565617620945,0.0923799052834511) * MODEL22_texOff(vec2(1,-1));
|
||||
res += mat4(-0.1223107874393463,-0.2441930323839188,-0.2410650849342346,-0.0162935722619295,0.0695567727088928,-0.0028583710081875,-0.0059417244046926,0.0715164169669151,-0.0668491795659065,-0.1499572396278381,0.0869924053549767,0.0553652904927731,0.2729566097259521,0.1370039582252502,-0.1282183527946472,-0.1451860070228577) * MODEL21_texOff(vec2(1,0));
|
||||
res += mat4(0.1331952214241028,0.0021079662255943,-0.1116734445095062,-0.4168601930141449,0.0534659475088120,0.0037860786542296,-0.0366065911948681,0.1047701835632324,0.1491260826587677,0.0782341659069061,0.0949895009398460,-0.1160908639431000,-0.1057133302092552,-0.2699718773365021,-0.1193305626511574,0.2142304331064224) * MODEL22_texOff(vec2(1,0));
|
||||
res += mat4(0.0041565205901861,-0.1065499857068062,-0.0629659667611122,-0.1144768893718719,0.0318886637687683,-0.0562519319355488,0.0043422472663224,0.0226082988083363,-0.1456198990345001,-0.2398656159639359,-0.2625046670436859,-0.0710547044873238,0.0067904205061495,0.0018544088816270,0.1019348874688148,-0.0186133962124586) * MODEL21_texOff(vec2(1,1));
|
||||
res += mat4(0.0732532218098640,0.1516859829425812,0.0580205544829369,0.1968977004289627,-0.0066619524732232,-0.1597842127084732,-0.0990600511431694,-0.1059188917279243,0.0718481168150902,-0.2222738713026047,-0.1675696671009064,-0.1500017195940018,-0.0568779110908508,-0.0582777932286263,-0.0844587534666061,-0.0263266414403915) * MODEL22_texOff(vec2(1,1));
|
||||
res = max(res, vec4(0.0)) + vec4(-0.2459529191255569,0.7563464641571045,-0.0705636814236641,-0.0094820559024811) * min(res, vec4(0.0));
|
||||
return res;
|
||||
}
|
||||
|
||||
//!HOOK LUMA
|
||||
//!WHEN OUTPUT.w LUMA.w / 1.300 > OUTPUT.h LUMA.h / 1.300 > *
|
||||
//!DESC mapping 2_2
|
||||
//!BIND MODEL21
|
||||
//!BIND MODEL22
|
||||
//!SAVE MODEL2
|
||||
//!COMPONENTS 4
|
||||
vec4 hook()
|
||||
{
|
||||
vec4 res = vec4(-0.0448397286236286,-0.1649267971515656,-0.1192543581128120,-0.0061073559336364);
|
||||
res += mat4(0.0724840760231018,-0.0480341166257858,-0.1082391515374184,-0.1447021961212158,0.0723197236657143,0.0481830574572086,0.0009448126656935,0.0353565886616707,-0.0653375908732414,0.0029647622723132,-0.0016588598955423,-0.2075651884078979,0.0403469167649746,0.3929971158504486,0.0342363268136978,0.1427230089902878) * MODEL21_texOff(vec2(-1,-1));
|
||||
res += mat4(-0.0743464827537537,0.1844420731067657,0.0256296340376139,-0.2808582782745361,0.0351609662175179,0.3277008235454559,-0.0205841138958931,-0.5355809330940247,0.0681906566023827,0.2058052271604538,-0.0479847639799118,-0.3735262751579285,-0.0261550359427929,-0.1148884072899818,-0.2329017966985703,0.0728458985686302) * MODEL22_texOff(vec2(-1,-1));
|
||||
res += mat4(-0.1236097738146782,0.1251334398984909,-0.1339431256055832,0.0198749266564846,-0.1325920224189758,-2.2431972026824951,-0.0680834427475929,-0.5671764612197876,-0.3431925177574158,-0.0983135104179382,-0.2207138091325760,-0.2374879121780396,0.0127309206873178,1.3076044321060181,0.0848151743412018,-0.1928595900535583) * MODEL21_texOff(vec2(-1,0));
|
||||
res += mat4(-0.0471093133091927,-0.1513628512620926,-0.0134263765066862,-0.1519252359867096,-0.5260242223739624,0.2291621714830399,0.4088975787162781,-0.4315340518951416,0.0933236032724380,-1.0386694669723511,0.0015958193689585,-0.2737887501716614,-0.0246253963559866,-0.2722961604595184,-0.1770633459091187,-0.2291279733181000) * MODEL22_texOff(vec2(-1,0));
|
||||
res += mat4(-0.0017552347853780,0.1903935521841049,-0.0740704238414764,-0.0917679518461227,0.0323882810771465,-0.3029108047485352,0.0532565414905548,-0.0651542618870735,0.4868686199188232,0.8539272546768188,0.4151960313320160,0.2619662582874298,-0.0413270294666290,0.1404227763414383,0.1027320474386215,0.3274228572845459) * MODEL21_texOff(vec2(-1,1));
|
||||
res += mat4(0.1828346252441406,0.0274682324379683,-0.1169882863759995,0.0327291004359722,0.1786244213581085,-0.6569546461105347,-0.0609031207859516,-0.1676601022481918,-0.1481092721223831,0.2889067530632019,0.1246089115738869,0.2203597426414490,-0.0366856977343559,0.1539470851421356,0.0069492300972342,-0.1544002443552017) * MODEL22_texOff(vec2(-1,1));
|
||||
res += mat4(0.2073992937803268,-0.0717074573040009,-0.0196173377335072,-0.0956910699605942,0.0728898122906685,0.0484567955136299,0.3063069283962250,-0.3200540542602539,0.0291527546942234,-0.0265460256487131,0.1168476045131683,-0.2479970753192902,0.1224220171570778,0.0745823010802269,0.1868897676467896,-0.1958049237728119) * MODEL21_texOff(vec2(0,-1));
|
||||
res += mat4(0.0019954447634518,-0.0225235987454653,0.0812198966741562,0.0295672398060560,-0.2016931176185608,-0.2239151000976562,-0.2481262385845184,-0.2381946444511414,-0.0520484372973442,-0.1200495883822441,0.2121954560279846,-0.1573531329631805,-0.0198472067713737,0.1001087054610252,-0.1084884032607079,-0.3126969039440155) * MODEL22_texOff(vec2(0,-1));
|
||||
res += mat4(0.3838330209255219,0.1678779572248459,0.6496244072914124,0.3783606290817261,-0.2198582738637924,-0.2351343184709549,-0.2852248847484589,0.6310021877288818,0.8083020448684692,0.0039323624223471,-0.0901831910014153,0.0797894075512886,-0.2271467447280884,0.7082978487014771,0.1513756662607193,0.2188975960016251) * MODEL21_texOff(vec2(0,0));
|
||||
res += mat4(-0.2871031761169434,0.2316448241472244,0.4947948157787323,0.3308620452880859,-0.0623455122113228,-0.1314185708761215,-0.2664661705493927,0.8725078701972961,0.4541083276271820,0.1433589160442352,-1.1269453763961792,0.6427971124649048,-0.1016561388969421,0.3418317139148712,-0.0991155728697777,-1.0508837699890137) * MODEL22_texOff(vec2(0,0));
|
||||
res += mat4(-0.2179604172706604,0.1258949041366577,-0.1155700981616974,-0.0536149404942989,-0.0140614463016391,-0.0091438721865416,-0.0501774959266186,-0.3570724725723267,-0.5832386016845703,0.2004123181104660,0.2986239194869995,-0.8139168024063110,0.0142666567116976,0.0681498944759369,0.1293468028306961,-0.1001938357949257) * MODEL21_texOff(vec2(0,1));
|
||||
res += mat4(0.1952836811542511,-0.3092494010925293,0.3063779771327972,0.1934849917888641,0.0746696740388870,-0.3533902466297150,-0.1269576102495193,-0.2237875163555145,0.2470717132091522,-0.2640363574028015,-0.2862776815891266,0.1740108281373978,-0.0963631942868233,0.2631850540637970,0.0400718413293362,-0.3590607047080994) * MODEL22_texOff(vec2(0,1));
|
||||
res += mat4(-0.5299927592277527,0.0979989692568779,0.1666737496852875,-0.1547524333000183,-0.0043443185277283,0.1540203243494034,0.0594348423182964,-0.0167275425046682,-0.1043610796332359,0.0504250898957253,0.0456700921058655,0.2525034546852112,0.2241353541612625,-0.1678503304719925,0.1532667279243469,0.2901742458343506) * MODEL21_texOff(vec2(1,-1));
|
||||
res += mat4(0.0998796448111534,0.0385462641716003,-0.0762400180101395,-0.1255892217159271,0.0281430184841156,-0.0304958485066891,-0.1440480053424835,-0.1001605167984962,-0.2257689833641052,0.2056092917919159,0.0248535349965096,-0.1383949518203735,-0.0951708629727364,0.0997417271137238,0.0275330394506454,-0.5728432536125183) * MODEL22_texOff(vec2(1,-1));
|
||||
res += mat4(0.4256163835525513,0.1745115518569946,-0.2409395426511765,0.3139856457710266,-0.0036795330233872,0.1819283962249756,-0.0864531323313713,0.0102691333740950,-0.3397279977798462,0.1107075437903404,-0.0035228815395385,-0.2207705229520798,-0.1779139339923859,-0.2106117755174637,0.0352664291858673,0.3615589439868927) * MODEL21_texOff(vec2(1,0));
|
||||
res += mat4(-0.0345224253833294,-0.0669926702976227,0.0907212942838669,-0.3758732676506042,-0.0452554710209370,-0.1134464666247368,-0.0358871109783649,-0.1858227252960205,-0.0233245138078928,-0.0495684742927551,0.1976234614849091,-0.1165761798620224,-0.0340447537600994,0.1095624342560768,0.0110175255686045,-0.8269239664077759) * MODEL22_texOff(vec2(1,0));
|
||||
res += mat4(-0.1379280686378479,0.1004267781972885,0.0723998174071312,-0.1510958224534988,0.0610648579895496,0.0451720170676708,-0.0231927260756493,-0.0251553766429424,0.2306085377931595,0.1033207178115845,-0.1316205114126205,0.1130664870142937,-0.0458516106009483,-0.1152514070272446,-0.0088650323450565,-0.0214479379355907) * MODEL21_texOff(vec2(1,1));
|
||||
res += mat4(-0.0545783303678036,-0.0620098188519478,0.0347074456512928,0.1096799224615097,0.0036664425861090,-0.0413107499480247,0.1443250179290771,-0.1161036714911461,-0.0061624986119568,-0.0252977479249239,0.3230019211769104,-0.2536626160144806,-0.0565439648926258,0.0827583819627762,-0.0071726376190782,-0.1983329951763153) * MODEL22_texOff(vec2(1,1));
|
||||
res = max(res, vec4(0.0)) + vec4(-0.6312188506126404,-0.1215368881821632,0.2487443536520004,0.4051703512668610) * min(res, vec4(0.0));
|
||||
return res;
|
||||
}
|
||||
|
||||
//!HOOK LUMA
|
||||
//!WHEN OUTPUT.w LUMA.w / 1.300 > OUTPUT.h LUMA.h / 1.300 > *
|
||||
//!DESC mapping 3_1
|
||||
//!BIND MODEL1
|
||||
//!BIND MODEL2
|
||||
//!SAVE MODEL21
|
||||
//!COMPONENTS 4
|
||||
vec4 hook()
|
||||
{
|
||||
vec4 res = vec4(-0.0410279631614685,-0.1111723631620407,-0.0406232848763466,-0.0939496159553528);
|
||||
res += mat4(0.1221675798296928,0.0083215842023492,-0.0162804014980793,0.0316714197397232,-0.2205813378095627,0.1500435769557953,0.2109555304050446,0.2741867899894714,0.0956874340772629,-0.0896854698657990,-0.1657065600156784,-0.1349759399890900,0.0601499564945698,-0.1523845940828323,-0.1828087568283081,-0.2727653682231903) * MODEL1_texOff(vec2(-1,-1));
|
||||
res += mat4(-0.0918163508176804,0.1564485579729080,0.1133174449205399,0.2215953171253204,-0.0623677000403404,-0.0497728772461414,-0.0372809022665024,-0.0258478187024593,-0.1364922970533371,0.1053884625434875,0.3292874991893768,0.2693256139755249,-0.0347631797194481,-0.1470523178577423,0.0096792401745915,-0.0542853325605392) * MODEL2_texOff(vec2(-1,-1));
|
||||
res += mat4(0.1331177949905396,-0.0964357852935791,-0.0706946700811386,0.1593225002288818,-0.4815943241119385,0.1224092170596123,-0.0870430991053581,0.0005010276800022,-0.0242684502154589,-0.2256436049938202,0.1367238312959671,0.0474774017930031,0.6886650323867798,-0.0065326127223670,0.1841574758291245,-0.1354993879795074) * MODEL1_texOff(vec2(-1,0));
|
||||
res += mat4(-0.1049591675400734,0.0515934228897095,0.1128631457686424,0.1688040047883987,-0.0084041170775890,-0.0006375144002959,-0.0598374009132385,0.1424416452646255,-0.0048398924991488,0.1832167655229568,0.0231959503144026,0.0816788375377655,-0.1321710795164108,0.0397678017616272,-0.0058345394209027,0.5784573554992676) * MODEL2_texOff(vec2(-1,0));
|
||||
res += mat4(0.1438693851232529,-0.0694608166813850,-0.0428275354206562,0.1599996536970139,-0.1651254445314407,0.1388883888721466,-0.0895452573895454,0.2569831907749176,0.3150432109832764,-0.0910519883036613,0.0367441214621067,0.1903669685125351,0.2805841267108917,-0.0444608181715012,0.0059385276399553,-0.2585869431495667) * MODEL1_texOff(vec2(-1,1));
|
||||
res += mat4(-0.1217494234442711,0.0191769022494555,-0.0065453462302685,0.1391217857599258,0.0998920649290085,-0.0162798929959536,0.0502282194793224,0.0370145924389362,0.0290782172232866,-0.0099554909393191,0.0142515478655696,0.1248661577701569,-0.0076912571676075,0.0251651499420404,0.2190572917461395,0.0020069130696356) * MODEL2_texOff(vec2(-1,1));
|
||||
res += mat4(0.2666685581207275,-0.1625511497259140,-0.3938800692558289,-0.0253848694264889,0.0987015441060066,0.2033616453409195,0.3128099143505096,0.4608893990516663,0.0620003379881382,-0.1389972567558289,-0.3095863461494446,-0.4023511111736298,-0.1105777546763420,0.1115406602621078,0.3639950752258301,0.0645622834563255) * MODEL1_texOff(vec2(0,-1));
|
||||
res += mat4(-0.2135885655879974,-0.1035343706607819,0.1795026361942291,0.1828210204839706,0.0780984908342361,0.0656728670001030,0.0033678691834211,0.1361345648765564,0.1712654232978821,-0.0172833092510700,-0.0502183400094509,0.2910411655902863,0.0691247656941414,0.1935720741748810,0.0652214139699936,0.1608240753412247) * MODEL2_texOff(vec2(0,-1));
|
||||
res += mat4(0.8243460655212402,-0.0979344248771667,-0.0366373993456364,0.1692261099815369,0.5517869591712952,0.3282494544982910,-0.7905511856079102,-0.4462923705577850,-0.0803156569600105,0.1172509342432022,0.1864327639341354,0.1471016854047775,0.1296005547046661,-0.1004103720188141,0.3174172043800354,-0.1181766316294670) * MODEL1_texOff(vec2(0,0));
|
||||
res += mat4(0.0259374529123306,-0.0934808850288391,0.3008874654769897,0.3957927823066711,-0.4048821926116943,0.1461934000253677,-0.1819096356630325,-0.1908810287714005,0.3193186521530151,-0.7438099980354309,0.1919509470462799,-0.2065188735723495,0.1752236187458038,-0.6840037107467651,0.1588519066572189,-0.3956064879894257) * MODEL2_texOff(vec2(0,0));
|
||||
res += mat4(0.1574442386627197,-0.0114925103262067,-0.1208277940750122,0.2058266401290894,0.2879209220409393,-0.0419875606894493,-0.1902059614658356,-0.2723863720893860,-0.1086223348975182,-0.0870924964547157,0.8605937957763672,0.2656622231006622,-0.1653763055801392,0.0816384851932526,-0.0137870563194156,0.1433854848146439) * MODEL1_texOff(vec2(0,1));
|
||||
res += mat4(-0.1565909236669540,-0.0307490080595016,-0.1055604666471481,0.2573592662811279,-0.1186821162700653,0.1141471788287163,-0.0272745657712221,-0.1049114838242531,0.2445316016674042,-0.0027864547446370,-0.1759569346904755,-0.1556979566812515,0.0550616309046745,0.1704383641481400,0.0853662937879562,0.3280856907367706) * MODEL2_texOff(vec2(0,1));
|
||||
res += mat4(0.1460669338703156,0.4202052652835846,-0.3638312816619873,-0.0958623066544533,-0.0492525361478329,-0.3664234280586243,0.0794373303651810,0.0399017669260502,0.0629198029637337,0.1662959158420563,-0.1001493930816650,-0.0587460733950138,-0.0396478697657585,0.0017320754704997,0.0314909480512142,-0.0202700830996037) * MODEL1_texOff(vec2(1,-1));
|
||||
res += mat4(-0.0964399129152298,0.0380319654941559,0.0396055467426777,0.0265473183244467,-0.0161637403070927,-0.1872924566268921,0.1670000404119492,0.0029466480482370,-0.1093841269612312,-0.3629201948642731,-0.0562992505729198,0.1792684197425842,-0.0203859098255634,0.0983991250395775,0.0058611719869077,0.1627455651760101) * MODEL2_texOff(vec2(1,-1));
|
||||
res += mat4(-0.1117974221706390,0.7562329173088074,-0.2046248912811279,0.1677842289209366,-0.2063486129045486,-0.6023545265197754,-0.5739209651947021,0.5110496878623962,-0.0715268924832344,-0.1373793482780457,0.1251420378684998,-0.0477442294359207,0.4961377978324890,0.2688887119293213,0.3146316707134247,-0.5197153687477112) * MODEL1_texOff(vec2(1,0));
|
||||
res += mat4(-0.1314805448055267,0.0746279135346413,0.3457699418067932,0.2564856410026550,0.0839370116591454,-0.6136511564254761,-0.4646295011043549,0.0612256154417992,-0.1910563558340073,-0.0935136750340462,-0.2426030039787292,0.2102959007024765,0.1575350016355515,0.6145061254501343,0.3368154168128967,-0.0974092856049538) * MODEL2_texOff(vec2(1,0));
|
||||
res += mat4(0.0565315335988998,0.2393359094858170,-0.0932938233017921,0.1555283814668655,0.0123879108577967,-0.1247719228267670,-0.0564610138535500,-0.1125799044966698,-0.0104600470513105,0.0482629500329494,0.2316472232341766,0.1083717569708824,-0.0525921434164047,0.0643989592790604,-0.0525734610855579,-0.0503251366317272) * MODEL1_texOff(vec2(1,1));
|
||||
res += mat4(-0.1835366338491440,0.0978360474109650,-0.1111819595098495,0.2109299153089523,0.0509372949600220,-0.1992686837911606,0.0677929744124413,-0.0870024710893631,-0.0412262082099915,-0.0697719156742096,-0.0967373847961426,0.0137308547273278,0.0195730421692133,0.0410240143537521,0.1157210171222687,0.2283479571342468) * MODEL2_texOff(vec2(1,1));
|
||||
res = max(res, vec4(0.0)) + vec4(0.1991519331932068,-0.1275756657123566,-0.0622864030301571,0.1586369574069977) * min(res, vec4(0.0));
|
||||
return res;
|
||||
}
|
||||
|
||||
//!HOOK LUMA
|
||||
//!WHEN OUTPUT.w LUMA.w / 1.300 > OUTPUT.h LUMA.h / 1.300 > *
|
||||
//!DESC mapping 3_2
|
||||
//!BIND MODEL1
|
||||
//!BIND MODEL2
|
||||
//!SAVE MODEL22
|
||||
//!COMPONENTS 4
|
||||
vec4 hook()
|
||||
{
|
||||
vec4 res = vec4(-0.0089084329083562,-0.0336172059178352,0.0177190825343132,0.0529975406825542);
|
||||
res += mat4(-0.0275970958173275,0.0141968233510852,0.1181544512510300,-0.0572245270013809,0.1161347925662994,-0.1156444773077965,-0.2549640238285065,0.0882879272103310,-0.0715355500578880,0.0151285668835044,0.1079384386539459,0.0650847703218460,-0.1597152203321457,0.0669793561100960,0.2084401696920395,-0.0951152443885803) * MODEL1_texOff(vec2(-1,-1));
|
||||
res += mat4(0.0404323227703571,-0.0206144321709871,-0.1080420613288879,-0.2038477361202240,0.0248847268521786,-0.0064681121148169,0.0389525443315506,0.0011026862775907,0.0885242074728012,0.0295896343886852,-0.3323790132999420,0.1935138553380966,-0.0466548874974251,0.1023886054754257,0.1257870644330978,-0.1541756242513657) * MODEL2_texOff(vec2(-1,-1));
|
||||
res += mat4(-0.0076520540751517,0.0361139886081219,0.1749804913997650,-0.2051989138126373,0.0022692133206874,-0.0282937753945589,-0.2039019316434860,-0.2343468815088272,-0.0357327871024609,-0.0570764988660812,0.2925858795642853,-0.1988349705934525,-0.0584560707211494,-0.0341510921716690,0.1300961822271347,0.5184492468833923) * MODEL1_texOff(vec2(-1,0));
|
||||
res += mat4(0.0884973928332329,0.0333527140319347,0.0180535931140184,-0.2655122876167297,0.0433661043643951,0.0104369185864925,0.0010909073753282,-0.0705273598432541,-0.0602585524320602,0.2420269846916199,-0.4731841087341309,-0.8040290474891663,0.3066828548908234,-0.2466925680637360,0.0938910692930222,-0.2002603262662888) * MODEL2_texOff(vec2(-1,0));
|
||||
res += mat4(0.0549152903258801,0.0291299298405647,0.0946277007460594,-0.0581608228385448,0.0669180899858475,-0.0635575056076050,-0.2427970170974731,-0.2677550315856934,0.2226776182651520,0.1301570236682892,-0.1519709974527359,0.0671724304556847,-0.0526433289051056,0.1898351758718491,0.2383745312690735,0.2191711813211441) * MODEL1_texOff(vec2(-1,1));
|
||||
res += mat4(-0.0234222635626793,0.0238620284944773,0.0427630320191383,-0.1080563366413116,0.0332126952707767,-0.0039051575586200,0.0293126031756401,0.0161924213171005,0.0453971028327942,0.0131999952718616,-0.0689036697149277,0.2349009960889816,0.1013344153761864,0.2706570029258728,0.1191426888108253,-0.2830821871757507) * MODEL2_texOff(vec2(-1,1));
|
||||
res += mat4(0.0181465242058039,-0.0571886636316776,0.4875229001045227,-0.4244020283222198,0.4331104159355164,0.1066712513566017,-0.5277034044265747,0.1110567077994347,-0.1179447323083878,-0.0273578558117151,0.1798476576805115,-0.2829602360725403,0.1012385115027428,-0.2528488039970398,0.1697608679533005,0.1121710017323494) * MODEL1_texOff(vec2(0,-1));
|
||||
res += mat4(-0.1404130905866623,-0.0984055623412132,-0.0279541295021772,-0.1321212500333786,-0.0841855704784393,0.1336171030998230,-0.1458790600299835,-0.0044095455668867,0.2203754037618637,0.1455714553594589,-0.2362042963504791,-0.0329121425747871,-0.1683547794818878,0.0289597529917955,0.3424547612667084,0.0143845872953534) * MODEL2_texOff(vec2(0,-1));
|
||||
res += mat4(0.0287246014922857,0.1948280781507492,0.5998955368995667,0.1192114129662514,-0.6269109249114990,0.8724324703216553,-0.6399638652801514,-0.4201497733592987,-0.3355066180229187,-0.1566904038190842,-0.4396412074565887,0.1525828838348389,0.5573399066925049,0.2324324846267700,0.2762884795665741,0.0406046211719513) * MODEL1_texOff(vec2(0,0));
|
||||
res += mat4(0.3890096545219421,-0.0574061162769794,-0.1468243300914764,-0.5953360199928284,-0.1363215148448944,-0.2224670499563217,-0.2237723320722580,0.2738097012042999,-0.4868114292621613,-0.5029351711273193,-0.3570256233215332,-0.1776263266801834,-0.0176672954112291,-0.4318660795688629,1.0395888090133667,0.1728395074605942) * MODEL2_texOff(vec2(0,0));
|
||||
res += mat4(0.1337304115295410,-0.0809440389275551,0.1600498855113983,-0.1108811497688293,-0.2376178801059723,-0.1532768607139587,-0.0447455830872059,0.2515332102775574,0.4848278462886810,-0.0915748402476311,-0.0336527302861214,-0.2141884714365005,0.2125129699707031,0.3237875998020172,0.0022272330243140,-0.0167857185006142) * MODEL1_texOff(vec2(0,1));
|
||||
res += mat4(0.0457934997975826,0.0510537698864937,-0.0519523508846760,-0.4506326615810394,-0.1029204949736595,0.0116113182157278,-0.1750748157501221,-0.0048758201301098,0.1506977379322052,0.0633068457245827,-0.1628549993038177,-0.0144928665831685,0.1408756822347641,0.2896180152893066,0.0803691521286964,-0.4930096566677094) * MODEL2_texOff(vec2(0,1));
|
||||
res += mat4(-0.0484248884022236,0.1371297985315323,-0.1235475391149521,-0.2618594765663147,-0.0280395895242691,0.0248795989900827,0.1204105168581009,0.3246576189994812,0.0426272377371788,-0.0520061068236828,0.0575957447290421,-0.2613646090030670,0.1165295541286469,-0.0390013493597507,-0.0470846109092236,-0.0014663023175672) * MODEL1_texOff(vec2(1,-1));
|
||||
res += mat4(-0.1066762879490852,-0.0869804695248604,-0.0099332248792052,-0.1355892717838287,-0.0760413780808449,0.1377770304679871,-0.0263407956808805,0.0880135521292686,0.1496269851922989,-0.0487459264695644,0.1286851912736893,0.2218491584062576,0.1723349541425705,-0.0165541302412748,-0.0690477639436722,-0.2388458102941513) * MODEL2_texOff(vec2(1,-1));
|
||||
res += mat4(-0.4236431121826172,0.0465179122984409,-0.1526456624269485,0.1426440477371216,0.5913932919502258,-0.1082349196076393,0.2731275856494904,-0.2687640488147736,-0.4628683030605316,-0.0537119321525097,-0.1597615629434586,0.0528527684509754,-0.3485085070133209,0.1395110934972763,0.0642972290515900,0.0323829315602779) * MODEL1_texOff(vec2(1,0));
|
||||
res += mat4(0.0066713397391140,-0.0482029877603054,-0.1707276403903961,-0.1001396998763084,0.0539822019636631,-0.1624453216791153,0.4913550019264221,0.3687861263751984,0.0491421781480312,0.1311376541852951,0.0992425829172134,-0.4636098444461823,-0.3415873646736145,-0.0153833786025643,-0.0270162131637335,-0.0935514941811562) * MODEL2_texOff(vec2(1,0));
|
||||
res += mat4(-0.1738258153200150,0.0458541549742222,-0.0653749182820320,-0.0156540926545858,-0.0357586294412613,-0.1486178338527679,0.1798035055398941,-0.1310307979583740,0.0783249065279961,-0.0261360015720129,-0.1047066971659660,0.3385537564754486,-0.0339452810585499,0.2299628853797913,-0.1408322304487228,-0.0352708548307419) * MODEL1_texOff(vec2(1,1));
|
||||
res += mat4(0.0463018082082272,0.0565674640238285,-0.0538956597447395,-0.2354862987995148,0.0297824125736952,0.0307939313352108,0.1271791011095047,-0.1025698855519295,0.1060482114553452,-0.0703211054205894,-0.0083062350749969,0.0474255047738552,0.0442508421838284,0.1569559425115585,-0.0442709513008595,-0.1188704669475555) * MODEL2_texOff(vec2(1,1));
|
||||
res = max(res, vec4(0.0)) + vec4(0.7366524934768677,1.0013850927352905,-0.0276311747729778,0.0734841898083687) * min(res, vec4(0.0));
|
||||
return res;
|
||||
}
|
||||
|
||||
//!HOOK LUMA
|
||||
//!WHEN OUTPUT.w LUMA.w / 1.300 > OUTPUT.h LUMA.h / 1.300 > *
|
||||
//!DESC mapping 4_1
|
||||
//!BIND MODEL21
|
||||
//!BIND MODEL22
|
||||
//!SAVE MODEL1
|
||||
//!COMPONENTS 4
|
||||
vec4 hook()
|
||||
{
|
||||
vec4 res = vec4(-0.1306160986423492,-0.0808217376470566,-0.2880123555660248,0.0099629526957870);
|
||||
res += mat4(-0.1033539846539497,0.0541300140321255,-0.0804840475320816,-0.0334571413695812,-0.0264753755182028,0.1118840202689171,0.1186013221740723,-0.0127575425431132,0.2236593365669250,0.0025286162272096,0.0985530614852905,0.0685181617736816,-0.1884875595569611,0.0530862808227539,-0.0482063069939613,0.0375233069062233) * MODEL21_texOff(vec2(-1,-1));
|
||||
res += mat4(0.1837068796157837,-0.0632847175002098,0.0016613919287920,0.0392861217260361,0.2923883199691772,-0.1713902205228806,0.1907587945461273,0.0550456829369068,0.0644215345382690,-0.1046456992626190,0.0187383033335209,0.0770180150866508,0.1933846622705460,-0.0455715768039227,0.0375007353723049,-0.1053109914064407) * MODEL22_texOff(vec2(-1,-1));
|
||||
res += mat4(-0.0972480997443199,0.2820451855659485,0.0114549007266760,-0.0954328626394272,0.0706252008676529,0.4829064607620239,-0.6371517181396484,0.0005180989392102,0.3280143439769745,0.0665246024727821,-0.0503116399049759,-0.1261110603809357,0.1114177703857422,-0.2053108513355255,0.1428771317005157,0.3926100134849548) * MODEL21_texOff(vec2(-1,0));
|
||||
res += mat4(-0.2571723163127899,0.1627264618873596,-0.4940335154533386,-0.1361546218395233,0.0804422944784164,-0.4231885373592377,0.0650202706456184,0.0518481098115444,-0.0502478554844856,-0.1305799931287766,0.1814480125904083,0.0090866927057505,-0.0510044656693935,-0.1691461503505707,0.0922467112541199,-0.0314207412302494) * MODEL22_texOff(vec2(-1,0));
|
||||
res += mat4(0.1270498335361481,0.0563284493982792,-0.0435525141656399,0.1569847911596298,0.0576847903430462,0.3461692929267883,-0.0325655154883862,-0.2688976824283600,-0.1341977864503860,-0.1382253766059875,0.2293784171342850,-0.1111817285418510,-0.1402447521686554,-0.3257531225681305,0.0598510466516018,0.1008039116859436) * MODEL21_texOff(vec2(-1,1));
|
||||
res += mat4(0.1698816716670990,0.3491003513336182,-0.1367681026458740,-0.1165873408317566,-0.2091718912124634,-0.1487034261226654,-0.0569749698042870,-0.2100717276334763,0.0404917001724243,-0.1372035890817642,0.0689046755433083,-0.0367818064987659,-0.0325474888086319,-0.0114965448155999,-0.0137249026447535,-0.0279692262411118) * MODEL22_texOff(vec2(-1,1));
|
||||
res += mat4(-0.0563433989882469,0.0132494345307350,-0.2434540390968323,0.0796563774347305,-0.2109155058860779,0.0387088693678379,-0.0591037571430206,0.0955820381641388,0.4660535752773285,-0.1204202473163605,0.1332369595766068,-0.0285425651818514,-0.3886952698230743,-0.0434980578720570,-0.0849134400486946,0.0802380964159966) * MODEL21_texOff(vec2(0,-1));
|
||||
res += mat4(0.0412235632538795,0.1571959257125854,0.2050069272518158,-0.1138664111495018,0.1962715685367584,0.0594439841806889,0.0351715497672558,-0.0129811102524400,0.2055217623710632,-0.0647534057497978,0.0373471938073635,0.0877277255058289,-0.5734645724296570,0.1188675239682198,-0.1145943328738213,-0.1182733029127121) * MODEL22_texOff(vec2(0,-1));
|
||||
res += mat4(-0.2004909217357635,-0.4817073047161102,0.5596802830696106,-0.0327854752540588,0.0989314392209053,0.4127818942070007,0.7265836596488953,-0.2692042589187622,0.5195841789245605,-0.2357539832592010,-0.3819393217563629,0.1755530238151550,0.6578183770179749,0.1075539961457253,-0.2688144743442535,0.3242723941802979) * MODEL21_texOff(vec2(0,0));
|
||||
res += mat4(-0.3221310675144196,0.2978510260581970,0.2269985526800156,-0.3184116482734680,0.4845580160617828,0.4407236874103546,0.0099756307899952,-0.3121858239173889,-0.3810067176818848,-0.0553649961948395,0.0202834140509367,0.0409953594207764,0.2532750964164734,0.2731618583202362,0.1237529441714287,0.0134243080392480) * MODEL22_texOff(vec2(0,0));
|
||||
res += mat4(0.1835541725158691,0.0549701862037182,-0.1749316602945328,-0.2030028849840164,0.0263462308794260,0.2781440317630768,0.0372458845376968,0.3643021881580353,-0.4047883749008179,0.0660117194056511,0.4863115549087524,-0.2024163603782654,-0.6403482556343079,0.2765505611896515,0.1417075097560883,0.5064445734024048) * MODEL21_texOff(vec2(0,1));
|
||||
res += mat4(0.6106975078582764,-0.1570862233638763,-0.3223383128643036,-0.2497926801443100,-0.4854303300380707,0.0132978223264217,-0.0609334111213684,0.1285556703805923,-0.1412864029407501,-0.1379042416810989,-0.0258826259523630,0.1357705891132355,-0.1285902857780457,-0.0577826797962189,0.0550044551491737,0.1717510819435120) * MODEL22_texOff(vec2(0,1));
|
||||
res += mat4(0.1389609426259995,0.0835867226123810,0.0309768319129944,-0.0278116948902607,-0.0390677824616432,-0.0111810686066747,-0.0025318188127130,0.0069569633342326,0.0347319357097149,0.0191543344408274,0.0314339138567448,-0.0228427499532700,0.0416300334036350,0.0249234102666378,0.1210031509399414,0.1142473593354225) * MODEL21_texOff(vec2(1,-1));
|
||||
res += mat4(0.0607251487672329,0.0386395826935768,-0.0219341218471527,-0.1102298423647881,0.1487188935279846,0.0602982006967068,-0.0280748903751373,-0.0211924221366644,0.0042894422076643,-0.0269144997000694,0.0814756453037262,-0.0314031280577183,-0.0213186051696539,-0.1362965404987335,0.0382767543196678,-0.0669511556625366) * MODEL22_texOff(vec2(1,-1));
|
||||
res += mat4(-0.2397561967372894,0.3023172020912170,-0.2398054003715515,0.0041919997893274,-0.1016605198383331,-0.1521034836769104,-0.1526568531990051,0.0272433310747147,0.0741761848330498,0.1116370111703873,0.1149727106094360,-0.0809784531593323,-0.1448147594928741,-0.0943927690386772,-0.0086280042305589,0.1243222951889038) * MODEL21_texOff(vec2(1,0));
|
||||
res += mat4(-0.0469366572797298,-0.1655988991260529,-0.1029584184288979,-0.1347874104976654,0.2064601778984070,0.0521226711571217,-0.1366733759641647,-0.0041872998699546,0.1077186539769173,0.0184442866593599,-0.2309073060750961,-0.1637075096368790,-0.0417953692376614,-0.3190860450267792,-0.1593534499406815,0.0136412177234888) * MODEL22_texOff(vec2(1,0));
|
||||
res += mat4(0.1698798984289169,0.0232755411416292,-0.0876034423708916,-0.3008348643779755,0.0789884999394417,0.0034748215693980,-0.0064704762771726,0.0057828431017697,-0.0190630126744509,-0.0334153175354004,-0.0195646341890097,0.0105131156742573,0.0995147302746773,-0.3130289018154144,-0.0724022984504700,0.0113303456455469) * MODEL21_texOff(vec2(1,1));
|
||||
res += mat4(-0.0027791252359748,-0.0193455871194601,-0.0415000133216381,0.0568981170654297,-0.2745247483253479,0.1222846284508705,0.1899162530899048,0.1067754998803139,-0.0561975166201591,-0.1500336527824402,0.0526139959692955,-0.3491798937320709,-0.0692384615540504,-0.0307095069438219,0.0498757846653461,0.0019003645284101) * MODEL22_texOff(vec2(1,1));
|
||||
res = max(res, vec4(0.0)) + vec4(0.1552927196025848,0.0782765746116638,0.7966942191123962,-1.1619627475738525) * min(res, vec4(0.0));
|
||||
return res;
|
||||
}
|
||||
|
||||
//!HOOK LUMA
|
||||
//!WHEN OUTPUT.w LUMA.w / 1.300 > OUTPUT.h LUMA.h / 1.300 > *
|
||||
//!DESC mapping 4_2
|
||||
//!BIND MODEL21
|
||||
//!BIND MODEL22
|
||||
//!SAVE MODEL2
|
||||
//!COMPONENTS 4
|
||||
vec4 hook()
|
||||
{
|
||||
vec4 res = vec4(-0.1443098634481430,-0.1343899369239807,-0.0624338127672672,-0.1094277128577232);
|
||||
res += mat4(-0.0689977407455444,-0.1693786680698395,0.0109281269833446,0.0609922930598259,0.0296908002346754,0.1195700988173485,-0.0694077461957932,0.0971287414431572,0.0253518298268318,0.1213042959570885,0.0703809782862663,0.0055739870294929,-0.1595942378044128,-0.1336689442396164,-0.0622441768646240,-0.0428023114800453) * MODEL21_texOff(vec2(-1,-1));
|
||||
res += mat4(0.0860001668334007,-0.0226618759334087,0.1602241247892380,0.0431661494076252,0.1526461094617844,0.2752982378005981,0.0960300788283348,-0.0536719262599945,-0.0171773489564657,0.0457364916801453,-0.0360932648181915,-0.0397153608500957,-0.0277090407907963,0.0729821547865868,-0.0145150292664766,0.0252893269062042) * MODEL22_texOff(vec2(-1,-1));
|
||||
res += mat4(-0.1407091915607452,-0.4007499516010284,-0.0302001200616360,-0.0606933943927288,-0.2960600554943085,-0.2263117432594299,0.0721478462219238,-0.4578711986541748,0.0960150733590126,-0.1606502830982208,0.2444226741790771,0.0000882153908606,0.1472496986389160,0.3256779909133911,-0.2132861614227295,0.0339313484728336) * MODEL21_texOff(vec2(-1,0));
|
||||
res += mat4(-0.1477648764848709,-0.1487885862588882,-0.1973863691091537,0.0717295333743095,0.0843430235981941,0.6259996294975281,-0.1214931011199951,-0.1274987608194351,0.2359549105167389,0.3002171218395233,-0.0825233608484268,-0.0157950688153505,0.0706149637699127,0.1762917637825012,-0.0611497573554516,-0.0859689489006996) * MODEL22_texOff(vec2(-1,0));
|
||||
res += mat4(0.0174895934760571,-0.0567042417824268,0.0409146919846535,0.0258173532783985,0.1421577036380768,0.1234543323516846,-0.1721662431955338,0.1492216140031815,0.1100751459598541,0.0501539446413517,0.1100447699427605,-0.1086079254746437,-0.0608497932553291,0.0087817469611764,0.0714464113116264,-0.1285197436809540) * MODEL21_texOff(vec2(-1,1));
|
||||
res += mat4(-0.0017177806003019,-0.1463395059108734,-0.1085453778505325,0.1650195866823196,0.0813829153776169,0.1102061793208122,-0.0578421875834465,-0.0232036896049976,-0.1239888817071915,0.0155465165153146,0.1079114526510239,-0.0420837886631489,-0.0775837749242783,0.0148941157385707,-0.0502299368381500,-0.0654754191637039) * MODEL22_texOff(vec2(-1,1));
|
||||
res += mat4(0.0918162539601326,0.0440697595477104,-0.0515748932957649,0.0417411290109158,0.0353216230869293,0.1535954177379608,0.0439723692834377,-0.1288845241069794,0.1076577678322792,-0.1306740194559097,0.0715952813625336,-0.0681907683610916,-0.3798767924308777,0.1023928597569466,-0.0970670804381371,0.0077168666757643) * MODEL21_texOff(vec2(0,-1));
|
||||
res += mat4(0.0634560957551003,-0.0550306066870689,0.2073986232280731,0.0520241297781467,0.1162287592887878,-0.2218665480613708,0.3199682831764221,0.0606246069073677,-0.0058511858806014,-0.0667045339941978,-0.0449917949736118,0.0707788690924644,-0.3323366343975067,-0.0763893201947212,-0.0997853428125381,-0.1181001588702202) * MODEL22_texOff(vec2(0,-1));
|
||||
res += mat4(-0.3101258873939514,0.2616009712219238,0.0584651045501232,0.1656491309404373,-0.0069236233830452,0.2573371529579163,-0.1793291717767715,-0.2718756198883057,0.0953581258654594,0.0524105131626129,0.1183085516095161,0.0583294369280338,0.5036848187446594,-0.5763167142868042,-0.2119628041982651,-0.3140562772750854) * MODEL21_texOff(vec2(0,0));
|
||||
res += mat4(-0.2497755438089371,-0.0146329319104552,-0.2741575539112091,0.2459975033998489,0.3562706708908081,-0.6528629064559937,-0.4287456274032593,0.2055913358926773,0.1739019453525543,-0.3855968713760376,-0.0958273336291313,-0.7066691517829895,0.2365748286247253,-0.3046728968620300,-0.2590373754501343,-0.0496727414429188) * MODEL22_texOff(vec2(0,0));
|
||||
res += mat4(-0.0844531357288361,-0.0321611948311329,-0.0951840654015541,0.0577518045902252,-0.1606003493070602,0.2776086628437042,-0.1355003118515015,-0.0880064144730568,-0.1277643740177155,-0.0514567233622074,0.1522682905197144,-0.1040910631418228,-0.2767944037914276,-0.1452194601297379,0.0089118303731084,0.0231996178627014) * MODEL21_texOff(vec2(0,1));
|
||||
res += mat4(0.2603267133235931,0.0167464651167393,-0.2064073234796524,0.1782064288854599,0.4890212416648865,0.0559245310723782,0.1221160590648651,-0.0202587731182575,-0.4056585729122162,-0.1839511841535568,0.2775998413562775,0.0024275144096464,-0.2624500989913940,-0.0619418807327747,0.0153478365391493,0.0123427547514439) * MODEL22_texOff(vec2(0,1));
|
||||
res += mat4(0.0816635638475418,-0.0134946266189218,0.0594766475260258,-0.0551253929734230,0.0134431896731257,-0.0652195811271667,-0.0563635528087616,-0.0066532371565700,-0.0004114551993553,0.0105680683627725,0.1324467360973358,0.0467248968780041,0.0301312971860170,-0.1073397025465965,-0.0363437235355377,-0.0474153012037277) * MODEL21_texOff(vec2(1,-1));
|
||||
res += mat4(0.0199097190052271,0.0901319086551666,0.0448978282511234,0.0505443066358566,0.0438878424465656,-0.0494784042239189,0.0724927335977554,-0.0070675504393876,-0.0012125011999160,0.0295279901474714,0.0705125033855438,0.0555334389209747,-0.0403393507003784,-0.1271172016859055,0.0017914215568453,0.1462216079235077) * MODEL22_texOff(vec2(1,-1));
|
||||
res += mat4(-0.2827299833297729,0.2052399665117264,0.0042732120491564,-0.3969024717807770,-0.0782120972871780,0.1960176974534988,-0.0675340741872787,0.0027962317690253,0.0516129024326801,-0.0352642722427845,0.0546326488256454,0.0065340655855834,-0.1062376946210861,0.1364430636167526,-0.0536947809159756,0.2098117172718048) * MODEL21_texOff(vec2(1,0));
|
||||
res += mat4(0.0045875865034759,0.2162927240133286,-0.2158576399087906,-0.0047327815555036,0.1251590698957443,0.1279677897691727,-0.1188964918255806,0.0328494384884834,0.0076038073748350,-0.0561547242105007,0.0335608273744583,0.4332321286201477,0.0021786799188703,0.0844521671533585,-0.2102309316396713,-0.0189208015799522) * MODEL22_texOff(vec2(1,0));
|
||||
res += mat4(0.0933093801140785,0.1548244059085846,-0.0598701611161232,0.0357220247387886,-0.1141726672649384,0.0536412484943867,-0.0159156844019890,-0.0445508137345314,0.1883231997489929,-0.1547038406133652,0.0530619807541370,0.0059371814131737,0.0602529086172581,-0.0435577929019928,0.0083390390500426,0.0191930737346411) * MODEL21_texOff(vec2(1,1));
|
||||
res += mat4(-0.0351041629910469,0.2119503468275070,-0.0841927304863930,0.0079463515430689,0.0683520361781120,-0.1657009869813919,0.0611055232584476,-0.0063667562790215,0.0330024957656860,-0.1810818463563919,0.0872574150562286,0.1485669612884521,-0.1305806934833527,0.0041402997449040,0.0223289318382740,-0.0141495745629072) * MODEL22_texOff(vec2(1,1));
|
||||
res = max(res, vec4(0.0)) + vec4(0.5769761204719543,0.1716064810752869,-0.0821026712656021,0.2092144042253494) * min(res, vec4(0.0));
|
||||
return res;
|
||||
}
|
||||
|
||||
//!HOOK LUMA
|
||||
//!WHEN OUTPUT.w LUMA.w / 1.300 > OUTPUT.h LUMA.h / 1.300 > *
|
||||
//!DESC sub-band residuals 1
|
||||
//!BIND MODEL1
|
||||
//!BIND MODEL2
|
||||
//!BIND FEATURE1
|
||||
//!SAVE RES1
|
||||
//!COMPONENTS 4
|
||||
vec4 hook()
|
||||
{
|
||||
vec4 res = vec4(0.0245648548007011,-0.4467784762382507,0.0197526942938566,-0.0110000418499112);
|
||||
res += mat4(0.0302665308117867,-0.9262221455574036,-0.1161134764552116,-0.0506900474429131,0.2716045379638672,-0.0485871583223343,0.0044713355600834,-0.4274623394012451,0.0749531090259552,-0.3700785338878632,0.0350039415061474,-0.0540786534547806,-0.0607390031218529,-0.8019900321960449,0.0923245251178741,0.1258827745914459) * MODEL1_texOff(0);
|
||||
res += mat4(-0.0649135261774063,0.0815236791968346,0.0067334296181798,0.1277425885200500,-0.0051357815973461,-0.1485908329486847,0.0074226572178304,0.0050623500719666,0.0588018335402012,-0.0692552924156189,0.1288725286722183,-0.0989386290311813,0.0427936837077141,0.0967708528041840,-0.0455632135272026,-0.0711275041103363) * MODEL2_texOff(0);
|
||||
res += FEATURE1_texOff(0);
|
||||
res = max(res, vec4(0.0)) + vec4(0.9927186965942383,0.0570580027997494,1.3226752281188965,1.0069466829299927) * min(res, vec4(0.0));
|
||||
return res;
|
||||
}
|
||||
|
||||
//!HOOK LUMA
|
||||
//!WHEN OUTPUT.w LUMA.w / 1.300 > OUTPUT.h LUMA.h / 1.300 > *
|
||||
//!DESC sub-band residuals 2
|
||||
//!BIND MODEL1
|
||||
//!BIND MODEL2
|
||||
//!BIND FEATURE2
|
||||
//!SAVE RES2
|
||||
//!COMPONENTS 4
|
||||
vec4 hook()
|
||||
{
|
||||
vec4 res = vec4(-0.0425243787467480,-0.3715015351772308,-0.0256227850914001,-0.2774516046047211);
|
||||
res += mat4(0.0238118842244148,0.0295480657368898,-0.0066418983042240,0.1021223962306976,-0.0568209178745747,-0.4355100393295288,-0.2700522541999817,-0.2060186564922333,-0.0689613372087479,-0.1689691990613937,-0.0306748505681753,-0.2461252212524414,-0.0057375836186111,-0.1892303228378296,-0.0285871494561434,-0.5032613277435303) * MODEL1_texOff(0);
|
||||
res += mat4(0.5463213324546814,0.0972800329327583,0.0307560767978430,0.0678058937191963,-0.0356063023209572,-0.7013865113258362,0.1890443563461304,-0.1036657467484474,-0.1745826154947281,-0.2942218780517578,-0.0485423319041729,-0.2983124554157257,-0.0524431839585304,-0.3261034786701202,0.3217246532440186,0.1958018541336060) * MODEL2_texOff(0);
|
||||
res += FEATURE2_texOff(0);
|
||||
res = max(res, vec4(0.0)) + vec4(0.1391339898109436,0.0960328355431557,0.6235341429710388,0.1177272796630859) * min(res, vec4(0.0));
|
||||
return res;
|
||||
}
|
||||
|
||||
//!HOOK LUMA
|
||||
//!WHEN OUTPUT.w LUMA.w / 1.300 > OUTPUT.h LUMA.h / 1.300 > *
|
||||
//!DESC sub-pixel convolution 1
|
||||
//!BIND RES1
|
||||
//!BIND RES2
|
||||
//!SAVE SUBCONV1
|
||||
//!COMPONENTS 4
|
||||
vec4 hook()
|
||||
{
|
||||
vec4 res = vec4(0.2010385394096375,0.2058132737874985,0.1918809115886688,0.1961363703012466);
|
||||
res += mat4x4(-0.0005980331334285,-0.0095877395942807,-0.0149448839947581,-0.0026380482595414,0.0320665836334229,-0.0706205591559410,-0.0054677254520357,0.0215112231671810,-0.0025710910558701,-0.0000433265340689,0.0044494951143861,-0.0034823501482606,-0.0050858515314758,0.0109513988718390,0.0208286065608263,-0.0032168829347938) * RES1_texOff(vec2(-1,-1));
|
||||
res += mat4x4(-0.0145305208861828,0.0246876608580351,-0.0038286084309220,-0.0033089490607381,-0.0920709222555161,-0.0767898634076118,0.0012083095498383,-0.0751532614231110,0.0001302754972130,-0.0107085108757019,-0.0010383903281763,-0.0059571005403996,0.0809685289859772,0.0414833538234234,0.0227938480675220,-0.0211347509175539) * RES2_texOff(vec2(-1,-1));
|
||||
res += mat4x4(0.0160999298095703,0.0364215746521950,-0.0377063788473606,-0.0449111759662628,-0.0476365163922310,0.1522845029830933,-0.0131391752511263,-0.0476671792566776,-0.0378389135003090,0.0235454943031073,0.0224007442593575,-0.0010372076649219,-0.0089435689151287,-0.0293026417493820,0.0274190884083509,0.0469092652201653) * RES1_texOff(vec2(-1,0));
|
||||
res += mat4x4(0.0297575183212757,-0.0132508194074035,-0.0044682323932648,-0.0096222748979926,0.2525918781757355,0.1873829364776611,-0.5599535703659058,-0.2372044622898102,0.0033207221422344,0.0256173480302095,0.0294605866074562,0.0323960892856121,-0.1679904460906982,-0.1278967708349228,0.3168168365955353,0.1978507637977600) * RES2_texOff(vec2(-1,0));
|
||||
res += mat4x4(-0.0047590560279787,-0.0149335600435734,0.0033453819341958,-0.0012247267877683,0.1112466752529144,0.0147760482504964,0.0031189601868391,0.0391573049128056,-0.0028154491446912,-0.0036881719715893,-0.0116015253588557,-0.0037573333829641,0.0047581391409039,0.0071071563288569,-0.0033221673220396,0.0004882142529823) * RES1_texOff(vec2(-1,1));
|
||||
res += mat4x4(-0.0025197160430253,-0.0018677815096453,0.0038254233077168,0.0041981274262071,-0.1321131736040115,-0.0494364202022552,0.0760654658079147,-0.1386690139770508,-0.0016222692793235,-0.0060105528682470,0.0010201989207417,0.0092753591015935,-0.0194614846259356,0.0087382243946195,-0.0606758072972298,0.0156162241473794) * RES2_texOff(vec2(-1,1));
|
||||
res += mat4x4(-0.0073722628876567,0.0012844242155552,0.0241398401558399,-0.0075527969747782,-0.0865194946527481,-0.0610522404313087,0.0289319511502981,-0.0994452014565468,0.0281447004526854,-0.0250582899898291,0.0044891634024680,-0.0246205236762762,0.0112307453528047,-0.0010844616917893,-0.0223584957420826,0.0177635718137026) * RES1_texOff(vec2(0,-1));
|
||||
res += mat4x4(-0.0585863515734673,0.0953190475702286,-0.0555586628615856,0.1033507287502289,0.1560877263545990,-0.0690897777676582,-0.0341389514505863,-0.0661668032407761,0.0531073249876499,-0.0266165956854820,-0.0203275382518768,0.0017760475166142,-0.1300747394561768,0.1810652017593384,0.0381597876548767,0.1397419273853302) * RES2_texOff(vec2(0,-1));
|
||||
res += mat4x4(0.6259804368019104,0.6062518954277039,0.5450409054756165,0.5966195464134216,-0.0423948727548122,0.0760537460446358,-0.0113651463761926,0.3007817566394806,-0.3218322694301605,0.2713021934032440,-0.3143473267555237,0.2303840517997742,0.3493050038814545,0.3590726852416992,0.4138027429580688,0.3391666412353516) * RES1_texOff(vec2(0,0));
|
||||
res += mat4x4(0.0790478289127350,-0.0978994593024254,0.0779844969511032,-0.0823706611990929,0.0094470111653209,0.1671760678291321,0.1201528310775757,-0.2016288936138153,0.3667598366737366,0.3651430010795593,-0.3612343966960907,-0.2978236973285675,-0.4231655597686768,0.0091423410922289,-0.1918412446975708,0.4224558770656586) * RES2_texOff(vec2(0,0));
|
||||
res += mat4x4(-0.0186564289033413,0.0274957418441772,-0.0064405309967697,0.0056951809674501,0.4864942431449890,-0.2563461959362030,0.4357284605503082,-0.2976118028163910,0.0374982468783855,0.0167757049202919,0.0305800959467888,0.0232830215245485,0.0138373551890254,-0.0191283021122217,0.0032355054281652,0.0055057541467249) * RES1_texOff(vec2(0,1));
|
||||
res += mat4x4(-0.0276355985552073,0.0048149987123907,-0.0251619722694159,-0.0057246969081461,0.0271473955363035,-0.0042668608948588,-0.0594691745936871,0.2255926281213760,-0.0203660242259502,0.0721646770834923,0.0137230781838298,-0.0650938376784325,-0.3049557507038116,0.2035628110170364,-0.2509683668613434,0.1962853819131851) * RES2_texOff(vec2(0,1));
|
||||
res += mat4x4(0.0109980758279562,-0.0053752651438117,-0.0112550277262926,0.0024017230607569,0.0362104885280132,0.0084348218515515,-0.0106990104541183,-0.0207723993808031,-0.0014961160486564,0.0066790678538382,0.0028113177977502,0.0025022011250257,-0.0093937022611499,0.0016421369509771,0.0035362334456295,-0.0058064293116331) * RES1_texOff(vec2(1,-1));
|
||||
res += mat4x4(0.0138889988884330,-0.0078343702480197,0.0061464929021895,0.0202130675315857,-0.0257590841501951,-0.0366640128195286,0.0250097587704659,-0.0498071312904358,-0.0103149358183146,-0.0001786737266229,-0.0099909817799926,0.0062733208760619,0.0131437368690968,-0.0005469865864143,-0.0388854071497917,0.0612070746719837) * RES2_texOff(vec2(1,-1));
|
||||
res += mat4x4(0.0052813654765487,0.0215748809278011,0.0107395220547915,-0.0079439217224717,0.0382786765694618,0.0697424262762070,-0.0415962152183056,0.0657853558659554,0.0209470037370920,-0.0218399092555046,-0.0447359494864941,0.0407319553196430,-0.0040902681648731,-0.0196106657385826,-0.0018554026028141,0.0203906055539846) * RES1_texOff(vec2(1,0));
|
||||
res += mat4x4(-0.0106181986629963,0.0084018819034100,0.0131329754367471,-0.0198754761368036,0.1117177084088326,0.0990846082568169,-0.0732304081320763,0.0163581725209951,-0.0648830309510231,-0.0451613292098045,0.0206844564527273,0.0031441387254745,-0.0106161693111062,-0.0567689687013626,0.0782861113548279,-0.0306094046682119) * RES2_texOff(vec2(1,0));
|
||||
res += mat4x4(0.0012452082009986,-0.0026056850329041,-0.0096226977184415,-0.0037850935477763,-0.0190967041999102,0.0534373670816422,0.1599360853433609,0.0834670960903168,-0.0070255175232887,0.0012873009545729,0.0030876772943884,-0.0093916896730661,-0.0033529615029693,0.0043485122732818,0.0089034689590335,-0.0067489291541278) * RES1_texOff(vec2(1,1));
|
||||
res += mat4x4(0.0004713654634543,-0.0034161377698183,-0.0026913962792605,0.0053522582165897,-0.0040974905714393,0.0273330621421337,-0.0333138220012188,-0.0701237097382545,0.0082997502759099,-0.0183656588196754,-0.0122841577976942,-0.0052855615504086,-0.0023795007728040,-0.0438593104481697,-0.1101513057947159,-0.0182559806853533) * RES2_texOff(vec2(1,1));
|
||||
return vec4(res);
|
||||
}
|
||||
|
||||
//!HOOK LUMA
|
||||
//!WHEN OUTPUT.w LUMA.w / 1.300 > OUTPUT.h LUMA.h / 1.300 > *
|
||||
//!WIDTH LUMA.w 2 *
|
||||
//!HEIGHT LUMA.h 2 *
|
||||
//!DESC aggregation
|
||||
//!BIND SUBCONV1
|
||||
vec4 hook()
|
||||
{
|
||||
vec2 fcoord = fract(SUBCONV1_pos * SUBCONV1_size);
|
||||
vec2 base = SUBCONV1_pos + (vec2(0.5) - fcoord) * SUBCONV1_pt;
|
||||
ivec2 index = ivec2(fcoord * vec2(2));
|
||||
vec4 res = SUBCONV1_tex(base);
|
||||
return vec4(res[index.x * 2 + index.y], 0, 0, 1);
|
||||
}
|
319
mpv/shaders-old/fxaa.glsl
Executable file
319
mpv/shaders-old/fxaa.glsl
Executable file
|
@ -0,0 +1,319 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright (c) 2011 NVIDIA Corporation. All rights reserved.
|
||||
*
|
||||
* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED
|
||||
* *AS IS* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS
|
||||
* OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, NONINFRINGEMENT,IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA
|
||||
* OR ITS SUPPLIERS BE LIABLE FOR ANY DIRECT, SPECIAL, INCIDENTAL, INDIRECT, OR
|
||||
* CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS
|
||||
* OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR ANY
|
||||
* OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE,
|
||||
* EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#if defined(VERTEX)
|
||||
|
||||
#if __VERSION__ >= 130
|
||||
#define COMPAT_VARYING out
|
||||
#define COMPAT_ATTRIBUTE in
|
||||
#define COMPAT_TEXTURE texture
|
||||
#else
|
||||
#define COMPAT_VARYING varying
|
||||
#define COMPAT_ATTRIBUTE attribute
|
||||
#define COMPAT_TEXTURE texture2D
|
||||
#endif
|
||||
|
||||
#ifdef GL_ES
|
||||
#define COMPAT_PRECISION mediump
|
||||
#else
|
||||
#define COMPAT_PRECISION
|
||||
#endif
|
||||
|
||||
COMPAT_ATTRIBUTE vec4 VertexCoord;
|
||||
COMPAT_ATTRIBUTE vec4 COLOR;
|
||||
COMPAT_ATTRIBUTE vec4 TexCoord;
|
||||
COMPAT_VARYING vec4 COL0;
|
||||
COMPAT_VARYING vec4 TEX0;
|
||||
|
||||
vec4 _oPosition1;
|
||||
uniform mat4 MVPMatrix;
|
||||
uniform COMPAT_PRECISION int FrameDirection;
|
||||
uniform COMPAT_PRECISION int FrameCount;
|
||||
uniform COMPAT_PRECISION vec2 OutputSize;
|
||||
uniform COMPAT_PRECISION vec2 TextureSize;
|
||||
uniform COMPAT_PRECISION vec2 InputSize;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = MVPMatrix * VertexCoord;
|
||||
COL0 = COLOR;
|
||||
TEX0.xy = TexCoord.xy;
|
||||
}
|
||||
|
||||
#elif defined(FRAGMENT)
|
||||
|
||||
#if __VERSION__ >= 130
|
||||
#define COMPAT_VARYING in
|
||||
#define COMPAT_TEXTURE texture
|
||||
out vec4 FragColor;
|
||||
#else
|
||||
#define COMPAT_VARYING varying
|
||||
#define COMPAT_TEXTURE texture2D
|
||||
#define FragColor gl_FragColor
|
||||
#endif
|
||||
|
||||
#ifdef GL_ES
|
||||
#ifdef GL_FRAGMENT_PRECISION_HIGH
|
||||
precision highp float;
|
||||
#else
|
||||
precision mediump float;
|
||||
#endif
|
||||
#define COMPAT_PRECISION mediump
|
||||
#else
|
||||
#define COMPAT_PRECISION
|
||||
#endif
|
||||
|
||||
uniform COMPAT_PRECISION int FrameDirection;
|
||||
uniform COMPAT_PRECISION int FrameCount;
|
||||
uniform COMPAT_PRECISION vec2 OutputSize;
|
||||
uniform COMPAT_PRECISION vec2 TextureSize;
|
||||
uniform COMPAT_PRECISION vec2 InputSize;
|
||||
uniform sampler2D Texture;
|
||||
COMPAT_VARYING vec4 TEX0;
|
||||
|
||||
// compatibility #defines
|
||||
#define Source Texture
|
||||
#define vTexCoord TEX0.xy
|
||||
#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
|
||||
#define outsize vec4(OutputSize, 1.0 / OutputSize)
|
||||
|
||||
|
||||
|
||||
/*
|
||||
FXAA_PRESET - Choose compile-in knob preset 0-5.
|
||||
------------------------------------------------------------------------------
|
||||
FXAA_EDGE_THRESHOLD - The minimum amount of local contrast required
|
||||
to apply algorithm.
|
||||
1.0/3.0 - too little
|
||||
1.0/4.0 - good start
|
||||
1.0/8.0 - applies to more edges
|
||||
1.0/16.0 - overkill
|
||||
------------------------------------------------------------------------------
|
||||
FXAA_EDGE_THRESHOLD_MIN - Trims the algorithm from processing darks.
|
||||
Perf optimization.
|
||||
1.0/32.0 - visible limit (smaller isn't visible)
|
||||
1.0/16.0 - good compromise
|
||||
1.0/12.0 - upper limit (seeing artifacts)
|
||||
------------------------------------------------------------------------------
|
||||
FXAA_SEARCH_STEPS - Maximum number of search steps for end of span.
|
||||
------------------------------------------------------------------------------
|
||||
FXAA_SEARCH_THRESHOLD - Controls when to stop searching.
|
||||
1.0/4.0 - seems to be the best quality wise
|
||||
------------------------------------------------------------------------------
|
||||
FXAA_SUBPIX_TRIM - Controls sub-pixel aliasing removal.
|
||||
1.0/2.0 - low removal
|
||||
1.0/3.0 - medium removal
|
||||
1.0/4.0 - default removal
|
||||
1.0/8.0 - high removal
|
||||
0.0 - complete removal
|
||||
------------------------------------------------------------------------------
|
||||
FXAA_SUBPIX_CAP - Insures fine detail is not completely removed.
|
||||
This is important for the transition of sub-pixel detail,
|
||||
like fences and wires.
|
||||
3.0/4.0 - default (medium amount of filtering)
|
||||
7.0/8.0 - high amount of filtering
|
||||
1.0 - no capping of sub-pixel aliasing removal
|
||||
*/
|
||||
|
||||
#ifndef FXAA_PRESET
|
||||
#define FXAA_PRESET 5
|
||||
#endif
|
||||
#if (FXAA_PRESET == 3)
|
||||
#define FXAA_EDGE_THRESHOLD (1.0/8.0)
|
||||
#define FXAA_EDGE_THRESHOLD_MIN (1.0/16.0)
|
||||
#define FXAA_SEARCH_STEPS 16
|
||||
#define FXAA_SEARCH_THRESHOLD (1.0/4.0)
|
||||
#define FXAA_SUBPIX_CAP (3.0/4.0)
|
||||
#define FXAA_SUBPIX_TRIM (1.0/4.0)
|
||||
#endif
|
||||
#if (FXAA_PRESET == 4)
|
||||
#define FXAA_EDGE_THRESHOLD (1.0/8.0)
|
||||
#define FXAA_EDGE_THRESHOLD_MIN (1.0/24.0)
|
||||
#define FXAA_SEARCH_STEPS 24
|
||||
#define FXAA_SEARCH_THRESHOLD (1.0/4.0)
|
||||
#define FXAA_SUBPIX_CAP (3.0/4.0)
|
||||
#define FXAA_SUBPIX_TRIM (1.0/4.0)
|
||||
#endif
|
||||
#if (FXAA_PRESET == 5)
|
||||
#define FXAA_EDGE_THRESHOLD (1.0/8.0)
|
||||
#define FXAA_EDGE_THRESHOLD_MIN (1.0/24.0)
|
||||
#define FXAA_SEARCH_STEPS 32
|
||||
#define FXAA_SEARCH_THRESHOLD (1.0/4.0)
|
||||
#define FXAA_SUBPIX_CAP (3.0/4.0)
|
||||
#define FXAA_SUBPIX_TRIM (1.0/4.0)
|
||||
#endif
|
||||
|
||||
#define FXAA_SUBPIX_TRIM_SCALE (1.0/(1.0 - FXAA_SUBPIX_TRIM))
|
||||
|
||||
// Return the luma, the estimation of luminance from rgb inputs.
|
||||
// This approximates luma using one FMA instruction,
|
||||
// skipping normalization and tossing out blue.
|
||||
// FxaaLuma() will range 0.0 to 2.963210702.
|
||||
COMPAT_PRECISION float FxaaLuma(vec3 rgb) {
|
||||
return rgb.y * (0.587/0.299) + rgb.x;
|
||||
}
|
||||
|
||||
vec3 FxaaLerp3(vec3 a, vec3 b, float amountOfA) {
|
||||
return (vec3(-amountOfA) * b) + ((a * vec3(amountOfA)) + b);
|
||||
}
|
||||
|
||||
vec4 FxaaTexOff(sampler2D tex, vec2 pos, ivec2 off, vec2 rcpFrame) {
|
||||
float x = pos.x + float(off.x) * rcpFrame.x;
|
||||
float y = pos.y + float(off.y) * rcpFrame.y;
|
||||
return COMPAT_TEXTURE(tex, vec2(x, y));
|
||||
}
|
||||
|
||||
// pos is the output of FxaaVertexShader interpolated across screen.
|
||||
// xy -> actual texture position {0.0 to 1.0}
|
||||
// rcpFrame should be a uniform equal to {1.0/frameWidth, 1.0/frameHeight}
|
||||
vec3 FxaaPixelShader(vec2 pos, sampler2D tex, vec2 rcpFrame)
|
||||
{
|
||||
vec3 rgbN = FxaaTexOff(tex, pos.xy, ivec2( 0,-1), rcpFrame).xyz;
|
||||
vec3 rgbW = FxaaTexOff(tex, pos.xy, ivec2(-1, 0), rcpFrame).xyz;
|
||||
vec3 rgbM = FxaaTexOff(tex, pos.xy, ivec2( 0, 0), rcpFrame).xyz;
|
||||
vec3 rgbE = FxaaTexOff(tex, pos.xy, ivec2( 1, 0), rcpFrame).xyz;
|
||||
vec3 rgbS = FxaaTexOff(tex, pos.xy, ivec2( 0, 1), rcpFrame).xyz;
|
||||
|
||||
float lumaN = FxaaLuma(rgbN);
|
||||
float lumaW = FxaaLuma(rgbW);
|
||||
float lumaM = FxaaLuma(rgbM);
|
||||
float lumaE = FxaaLuma(rgbE);
|
||||
float lumaS = FxaaLuma(rgbS);
|
||||
float rangeMin = min(lumaM, min(min(lumaN, lumaW), min(lumaS, lumaE)));
|
||||
float rangeMax = max(lumaM, max(max(lumaN, lumaW), max(lumaS, lumaE)));
|
||||
|
||||
float range = rangeMax - rangeMin;
|
||||
if(range < max(FXAA_EDGE_THRESHOLD_MIN, rangeMax * FXAA_EDGE_THRESHOLD))
|
||||
{
|
||||
return rgbM;
|
||||
}
|
||||
|
||||
vec3 rgbL = rgbN + rgbW + rgbM + rgbE + rgbS;
|
||||
|
||||
float lumaL = (lumaN + lumaW + lumaE + lumaS) * 0.25;
|
||||
float rangeL = abs(lumaL - lumaM);
|
||||
float blendL = max(0.0, (rangeL / range) - FXAA_SUBPIX_TRIM) * FXAA_SUBPIX_TRIM_SCALE;
|
||||
blendL = min(FXAA_SUBPIX_CAP, blendL);
|
||||
|
||||
vec3 rgbNW = FxaaTexOff(tex, pos.xy, ivec2(-1,-1), rcpFrame).xyz;
|
||||
vec3 rgbNE = FxaaTexOff(tex, pos.xy, ivec2( 1,-1), rcpFrame).xyz;
|
||||
vec3 rgbSW = FxaaTexOff(tex, pos.xy, ivec2(-1, 1), rcpFrame).xyz;
|
||||
vec3 rgbSE = FxaaTexOff(tex, pos.xy, ivec2( 1, 1), rcpFrame).xyz;
|
||||
rgbL += (rgbNW + rgbNE + rgbSW + rgbSE);
|
||||
rgbL *= vec3(1.0/9.0);
|
||||
|
||||
float lumaNW = FxaaLuma(rgbNW);
|
||||
float lumaNE = FxaaLuma(rgbNE);
|
||||
float lumaSW = FxaaLuma(rgbSW);
|
||||
float lumaSE = FxaaLuma(rgbSE);
|
||||
|
||||
float edgeVert =
|
||||
abs((0.25 * lumaNW) + (-0.5 * lumaN) + (0.25 * lumaNE)) +
|
||||
abs((0.50 * lumaW ) + (-1.0 * lumaM) + (0.50 * lumaE )) +
|
||||
abs((0.25 * lumaSW) + (-0.5 * lumaS) + (0.25 * lumaSE));
|
||||
float edgeHorz =
|
||||
abs((0.25 * lumaNW) + (-0.5 * lumaW) + (0.25 * lumaSW)) +
|
||||
abs((0.50 * lumaN ) + (-1.0 * lumaM) + (0.50 * lumaS )) +
|
||||
abs((0.25 * lumaNE) + (-0.5 * lumaE) + (0.25 * lumaSE));
|
||||
|
||||
bool horzSpan = edgeHorz >= edgeVert;
|
||||
float lengthSign = horzSpan ? -rcpFrame.y : -rcpFrame.x;
|
||||
|
||||
if(!horzSpan)
|
||||
{
|
||||
lumaN = lumaW;
|
||||
lumaS = lumaE;
|
||||
}
|
||||
|
||||
float gradientN = abs(lumaN - lumaM);
|
||||
float gradientS = abs(lumaS - lumaM);
|
||||
lumaN = (lumaN + lumaM) * 0.5;
|
||||
lumaS = (lumaS + lumaM) * 0.5;
|
||||
|
||||
if (gradientN < gradientS)
|
||||
{
|
||||
lumaN = lumaS;
|
||||
lumaN = lumaS;
|
||||
gradientN = gradientS;
|
||||
lengthSign *= -1.0;
|
||||
}
|
||||
|
||||
vec2 posN;
|
||||
posN.x = pos.x + (horzSpan ? 0.0 : lengthSign * 0.5);
|
||||
posN.y = pos.y + (horzSpan ? lengthSign * 0.5 : 0.0);
|
||||
|
||||
gradientN *= FXAA_SEARCH_THRESHOLD;
|
||||
|
||||
vec2 posP = posN;
|
||||
vec2 offNP = horzSpan ? vec2(rcpFrame.x, 0.0) : vec2(0.0, rcpFrame.y);
|
||||
float lumaEndN = lumaN;
|
||||
float lumaEndP = lumaN;
|
||||
bool doneN = false;
|
||||
bool doneP = false;
|
||||
posN += offNP * vec2(-1.0, -1.0);
|
||||
posP += offNP * vec2( 1.0, 1.0);
|
||||
|
||||
for(int i = 0; i < FXAA_SEARCH_STEPS; i++) {
|
||||
if(!doneN)
|
||||
{
|
||||
lumaEndN = FxaaLuma(COMPAT_TEXTURE(tex, posN.xy).xyz);
|
||||
}
|
||||
if(!doneP)
|
||||
{
|
||||
lumaEndP = FxaaLuma(COMPAT_TEXTURE(tex, posP.xy).xyz);
|
||||
}
|
||||
|
||||
doneN = doneN || (abs(lumaEndN - lumaN) >= gradientN);
|
||||
doneP = doneP || (abs(lumaEndP - lumaN) >= gradientN);
|
||||
|
||||
if(doneN && doneP)
|
||||
{
|
||||
break;
|
||||
}
|
||||
if(!doneN)
|
||||
{
|
||||
posN -= offNP;
|
||||
}
|
||||
if(!doneP)
|
||||
{
|
||||
posP += offNP;
|
||||
}
|
||||
}
|
||||
|
||||
float dstN = horzSpan ? pos.x - posN.x : pos.y - posN.y;
|
||||
float dstP = horzSpan ? posP.x - pos.x : posP.y - pos.y;
|
||||
bool directionN = dstN < dstP;
|
||||
lumaEndN = directionN ? lumaEndN : lumaEndP;
|
||||
|
||||
if(((lumaM - lumaN) < 0.0) == ((lumaEndN - lumaN) < 0.0))
|
||||
{
|
||||
lengthSign = 0.0;
|
||||
}
|
||||
|
||||
|
||||
float spanLength = (dstP + dstN);
|
||||
dstN = directionN ? dstN : dstP;
|
||||
float subPixelOffset = (0.5 + (dstN * (-1.0/spanLength))) * lengthSign;
|
||||
vec3 rgbF = COMPAT_TEXTURE(tex, vec2(
|
||||
pos.x + (horzSpan ? 0.0 : subPixelOffset),
|
||||
pos.y + (horzSpan ? subPixelOffset : 0.0))).xyz;
|
||||
return FxaaLerp3(rgbL, rgbF, blendL);
|
||||
}
|
||||
|
||||
void main()
|
||||
{
|
||||
FragColor = vec4(FxaaPixelShader(vTexCoord, Source, vec2(SourceSize.z, SourceSize.w)), 1.0) * 1.0;
|
||||
}
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue