-
Notifications
You must be signed in to change notification settings - Fork 28
/
hq2x2.glsl
executable file
·155 lines (155 loc) · 5.51 KB
/
hq2x2.glsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
// GLSL shader autogenerated by cg2glsl.py.
#if defined(VERTEX)
uniform mediump vec2 TextureSize;
attribute vec4 TexCoord;
varying vec4 COL0;
attribute vec4 COLOR;
attribute vec4 VertexCoord;
vec4 _r0009;
uniform mat4 MVPMatrix;
varying mediump vec2 VARc00;
varying mediump vec2 VARc01;
varying mediump vec2 VARc02;
varying mediump vec2 VARc10;
varying vec2 VARc11;
varying mediump vec2 VARc12;
varying mediump vec2 VARc20;
varying mediump vec2 VARc21;
varying mediump vec2 VARc22;
void main ()
{
mat4 matrix_1;
matrix_1 = (MVPMatrix);
int i_2;
mat4 ret_3;
i_2 = 0;
while (true) {
int j_4;
if ((i_2 == 4)) {
break;
};
j_4 = 0;
while (true) {
if ((j_4 == 4)) {
break;
};
ret_3[i_2][j_4] = matrix_1[j_4][i_2];
j_4 = (j_4 + 1);
};
i_2 = (i_2 + 1);
};
_r0009.x = dot (ret_3[0], VertexCoord);
_r0009.y = dot (ret_3[1], VertexCoord);
_r0009.z = dot (ret_3[2], VertexCoord);
_r0009.w = dot (ret_3[3], VertexCoord);
mediump vec2 tmpvar_5;
tmpvar_5 = (0.5 / TextureSize);
mediump vec2 tmpvar_6;
tmpvar_6.x = -(tmpvar_5.x);
tmpvar_6.y = -(tmpvar_5.y);
mediump vec2 tmpvar_7;
tmpvar_7.y = 0.0;
tmpvar_7.x = -(tmpvar_5.x);
mediump vec2 tmpvar_8;
tmpvar_8.x = -(tmpvar_5.x);
tmpvar_8.y = tmpvar_5.y;
mediump vec2 tmpvar_9;
tmpvar_9.x = 0.0;
tmpvar_9.y = -(tmpvar_5.y);
mediump vec2 tmpvar_10;
tmpvar_10.x = 0.0;
tmpvar_10.y = tmpvar_5.y;
mediump vec2 tmpvar_11;
tmpvar_11.x = tmpvar_5.x;
tmpvar_11.y = -(tmpvar_5.y);
mediump vec2 tmpvar_12;
tmpvar_12.y = 0.0;
tmpvar_12.x = tmpvar_5.x;
VARc00 = (TexCoord.xy + tmpvar_6);
VARc01 = (TexCoord.xy + tmpvar_7);
VARc02 = (TexCoord.xy + tmpvar_8);
VARc10 = (TexCoord.xy + tmpvar_9);
VARc11 = TexCoord.xy;
VARc12 = (TexCoord.xy + tmpvar_10);
VARc20 = (TexCoord.xy + tmpvar_11);
VARc21 = (TexCoord.xy + tmpvar_12);
VARc22 = (TexCoord.xy + tmpvar_5);
gl_Position = _r0009;
COL0 = COLOR;
return;
}
#elif defined(FRAGMENT)
precision mediump float;
uniform sampler2D Texture;
varying vec2 VARc00;
varying vec2 VARc01;
varying vec2 VARc02;
varying vec2 VARc10;
varying vec2 VARc11;
varying vec2 VARc12;
varying vec2 VARc20;
varying vec2 VARc21;
varying vec2 VARc22;
void main ()
{
lowp vec4 tmpvar_1;
tmpvar_1 = texture2D (Texture, VARc00);
lowp vec4 tmpvar_2;
tmpvar_2 = texture2D (Texture, VARc01);
lowp vec4 tmpvar_3;
tmpvar_3 = texture2D (Texture, VARc02);
lowp vec4 tmpvar_4;
tmpvar_4 = texture2D (Texture, VARc10);
lowp vec4 tmpvar_5;
tmpvar_5 = texture2D (Texture, VARc11);
lowp vec4 tmpvar_6;
tmpvar_6 = texture2D (Texture, VARc12);
lowp vec4 tmpvar_7;
tmpvar_7 = texture2D (Texture, VARc20);
lowp vec4 tmpvar_8;
tmpvar_8 = texture2D (Texture, VARc21);
lowp vec4 tmpvar_9;
tmpvar_9 = texture2D (Texture, VARc22);
lowp float tmpvar_10;
tmpvar_10 = dot (abs((tmpvar_1.xyz - tmpvar_9.xyz)), vec3(1.0, 1.0, 1.0));
lowp float tmpvar_11;
tmpvar_11 = dot (abs((tmpvar_3.xyz - tmpvar_7.xyz)), vec3(1.0, 1.0, 1.0));
lowp float tmpvar_12;
tmpvar_12 = (dot (abs((tmpvar_9.xyz - tmpvar_5.xyz)), vec3(1.0, 1.0, 1.0)) * tmpvar_11);
lowp float tmpvar_13;
tmpvar_13 = (dot (abs((tmpvar_3.xyz - tmpvar_5.xyz)), vec3(1.0, 1.0, 1.0)) * tmpvar_10);
lowp float tmpvar_14;
tmpvar_14 = (dot (abs((tmpvar_1.xyz - tmpvar_5.xyz)), vec3(1.0, 1.0, 1.0)) * tmpvar_11);
lowp float tmpvar_15;
tmpvar_15 = (dot (abs((tmpvar_7.xyz - tmpvar_5.xyz)), vec3(1.0, 1.0, 1.0)) * tmpvar_10);
lowp float tmpvar_16;
tmpvar_16 = (tmpvar_12 + tmpvar_14);
lowp float tmpvar_17;
tmpvar_17 = (tmpvar_13 + tmpvar_15);
lowp float tmpvar_18;
tmpvar_18 = (max (tmpvar_16, tmpvar_17) + 0.0001);
lowp vec3 tmpvar_19;
tmpvar_19 = ((((((tmpvar_12 * tmpvar_1.xyz) + (tmpvar_13 * tmpvar_7.xyz)) + (tmpvar_14 * tmpvar_9.xyz)) + (tmpvar_15 * tmpvar_3.xyz)) + (tmpvar_18 * tmpvar_5.xyz)) / ((tmpvar_16 + tmpvar_17) + tmpvar_18));
lowp float tmpvar_20;
tmpvar_20 = (-0.25 / ((0.12 * dot (((tmpvar_4.xyz + tmpvar_6.xyz) + tmpvar_19), vec3(1.0, 1.0, 1.0))) + 0.25));
lowp float tmpvar_21;
tmpvar_21 = (-0.25 / ((0.12 * dot (((tmpvar_2.xyz + tmpvar_8.xyz) + tmpvar_19), vec3(1.0, 1.0, 1.0))) + 0.25));
lowp float tmpvar_22;
tmpvar_22 = max (-0.05, min (0.25, ((tmpvar_20 * dot (abs((tmpvar_19 - tmpvar_4.xyz)), vec3(1.0, 1.0, 1.0))) + 0.325)));
lowp float tmpvar_23;
tmpvar_23 = max (-0.05, min (0.25, ((tmpvar_21 * dot (abs((tmpvar_19 - tmpvar_8.xyz)), vec3(1.0, 1.0, 1.0))) + 0.325)));
lowp float tmpvar_24;
tmpvar_24 = max (-0.05, min (0.25, ((tmpvar_20 * dot (abs((tmpvar_19 - tmpvar_6.xyz)), vec3(1.0, 1.0, 1.0))) + 0.325)));
lowp float tmpvar_25;
tmpvar_25 = max (-0.05, min (0.25, ((tmpvar_21 * dot (abs((tmpvar_19 - tmpvar_2.xyz)), vec3(1.0, 1.0, 1.0))) + 0.325)));
lowp vec3 tmpvar_26;
tmpvar_26 = (((((tmpvar_22 * tmpvar_4.xyz) + (tmpvar_23 * tmpvar_8.xyz)) + (tmpvar_24 * tmpvar_6.xyz)) + (tmpvar_25 * tmpvar_2.xyz)) + (((((1.0 - tmpvar_22) - tmpvar_23) - tmpvar_24) - tmpvar_25) * tmpvar_19));
lowp vec4 tmpvar_27;
tmpvar_27.w = 1.0;
tmpvar_27.x = tmpvar_26.x;
tmpvar_27.y = tmpvar_26.y;
tmpvar_27.z = tmpvar_26.z;
gl_FragColor = tmpvar_27;
return;
}
#endif