-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathntsc-pass2.glsl
executable file
·355 lines (181 loc) · 6.53 KB
/
ntsc-pass2.glsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
// GLSL shader autogenerated by cg2glsl.py.
#if defined(VERTEX)
varying vec2 VARpix_no;
varying vec2 VARtex;
struct data {
vec2 VARtex;
vec2 VARpix_no;
};
struct input_dummy {
vec2 _video_size;
vec2 _texture_size;
vec2 _output_dummy_size;
float _frame_count;
};
vec4 _oPosition1;
data _oData1;
uniform mat4 MVPMatrix;
input_dummy _IN1;
vec4 _r0004;
attribute vec4 VertexCoord;
attribute vec4 TexCoord;
mat4 transpose_(mat4 matrix)
{
mat4 ret;
for (int i = 0; i != 4; i++)
for (int j = 0; j != 4; j++)
ret[i][j] = matrix[j][i];
return ret;
}
uniform int FrameDirection;
uniform int FrameCount;
#ifdef GL_ES
uniform mediump vec2 OutputSize;
uniform mediump vec2 TextureSize;
uniform mediump vec2 InputSize;
#else
uniform vec2 OutputSize;
uniform vec2 TextureSize;
uniform vec2 InputSize;
#endif
void main()
{
mat4 MVPMatrix_ = transpose_(MVPMatrix);
_r0004.x = dot(MVPMatrix_[0], VertexCoord);
_r0004.y = dot(MVPMatrix_[1], VertexCoord);
_r0004.z = dot(MVPMatrix_[2], VertexCoord);
_r0004.w = dot(MVPMatrix_[3], VertexCoord);
_oPosition1 = _r0004;
VARtex = TexCoord.xy;
VARpix_no = TexCoord.xy*TextureSize;
gl_Position = _r0004;
}
#elif defined(FRAGMENT)
#ifdef GL_ES
precision mediump float;
#endif
varying vec2 VARpix_no;
varying vec2 VARtex;
struct data {
vec2 VARtex;
vec2 VARpix_no;
};
struct input_dummy {
vec2 _video_size;
vec2 VARtexture_size;
vec2 _output_dummy_size;
float _frame_count;
};
vec4 _ret_0;
float _TMP9;
float _TMP8;
float _TMP7;
vec4 _TMP6;
float _TMP5;
float _TMP3;
vec4 _TMP4;
vec4 _TMP2;
float _TMP1;
float _TMP10;
input_dummy _IN1;
data _vertex1;
uniform sampler2D Texture;
float _x0019;
vec2 _c0021;
vec2 _c0025;
uniform int FrameDirection;
uniform int FrameCount;
#ifdef GL_ES
uniform mediump vec2 OutputSize;
uniform mediump vec2 TextureSize;
uniform mediump vec2 InputSize;
#else
uniform vec2 OutputSize;
uniform vec2 TextureSize;
uniform vec2 InputSize;
#endif
void main()
{
float _one_x;
float _chroma_phase;
float _mod_phase;
float _signal;
float _sums1;
float _i_mod;
float _q_mod;
vec3 _out_color;
_one_x = 1.00000000E+000/TextureSize.x;
_x0019 = VARpix_no.y/3.00000000E+000;
_TMP10 = floor(_x0019);
_TMP1 = VARpix_no.y - 3.00000000E+000*_TMP10;
_chroma_phase = 2.09449983E+000*(_TMP1 + float(FrameCount));
_mod_phase = _chroma_phase + VARpix_no.x*1.25663710E+000;
_c0021 = VARtex + vec2(-8.00000000E+000*_one_x, 0.00000000E+000);
_TMP2 = texture2D(Texture, _c0021);
_TMP3 = dot(_TMP2.xyz, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_c0025 = VARtex + vec2(8.00000000E+000*_one_x, 0.00000000E+000);
_TMP4 = texture2D(Texture, _c0025);
_TMP5 = dot(_TMP4.xyz, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_sums1 = _TMP3 + _TMP5;
_signal = _sums1*1.90000003E-003;
_c0021 = VARtex + vec2(-7.00000000E+000*_one_x, 0.00000000E+000);
_TMP2 = texture2D(Texture, _c0021);
_TMP3 = dot(_TMP2.xyz, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_c0025 = VARtex + vec2(7.00000000E+000*_one_x, 0.00000000E+000);
_TMP4 = texture2D(Texture, _c0025);
_TMP5 = dot(_TMP4.xyz, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_sums1 = _TMP3 + _TMP5;
_signal = _signal + _sums1*3.10000009E-003;
_c0021 = VARtex + vec2(-6.00000000E+000*_one_x, 0.00000000E+000);
_TMP2 = texture2D(Texture, _c0021);
_TMP3 = dot(_TMP2.xyz, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_c0025 = VARtex + vec2(6.00000000E+000*_one_x, 0.00000000E+000);
_TMP4 = texture2D(Texture, _c0025);
_TMP5 = dot(_TMP4.xyz, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_sums1 = _TMP3 + _TMP5;
_signal = _signal + _sums1*-1.08000003E-002;
_c0021 = VARtex + vec2(-4.00000000E+000*_one_x, 0.00000000E+000);
_TMP2 = texture2D(Texture, _c0021);
_TMP3 = dot(_TMP2.xyz, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_c0025 = VARtex + vec2(4.00000000E+000*_one_x, 0.00000000E+000);
_TMP4 = texture2D(Texture, _c0025);
_TMP5 = dot(_TMP4.xyz, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_sums1 = _TMP3 + _TMP5;
_signal = _signal + _sums1*4.06999998E-002;
_c0021 = VARtex + vec2(-3.00000000E+000*_one_x, 0.00000000E+000);
_TMP2 = texture2D(Texture, _c0021);
_TMP3 = dot(_TMP2.xyz, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_c0025 = VARtex + vec2(3.00000000E+000*_one_x, 0.00000000E+000);
_TMP4 = texture2D(Texture, _c0025);
_TMP5 = dot(_TMP4.xyz, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_sums1 = _TMP3 + _TMP5;
_signal = _signal + _sums1*-4.45000008E-002;
_c0021 = VARtex + vec2(-2.00000000E+000*_one_x, 0.00000000E+000);
_TMP2 = texture2D(Texture, _c0021);
_TMP3 = dot(_TMP2.xyz, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_c0025 = VARtex + vec2(2.00000000E+000*_one_x, 0.00000000E+000);
_TMP4 = texture2D(Texture, _c0025);
_TMP5 = dot(_TMP4.xyz, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_sums1 = _TMP3 + _TMP5;
_signal = _signal + _sums1*-8.07000026E-002;
_c0021 = VARtex + vec2(-_one_x, 0.00000000E+000);
_TMP2 = texture2D(Texture, _c0021);
_TMP3 = dot(_TMP2.xyz, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_c0025 = VARtex + vec2(_one_x, 0.00000000E+000);
_TMP4 = texture2D(Texture, _c0025);
_TMP5 = dot(_TMP4.xyz, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_sums1 = _TMP3 + _TMP5;
_signal = _signal + _sums1*2.91299999E-001;
_TMP6 = texture2D(Texture, VARtex);
_TMP7 = dot(_TMP6.xyz, vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000));
_signal = _signal + _TMP7*5.98200023E-001;
_TMP8 = cos(_mod_phase);
_i_mod = 2.00000000E+000*_TMP8;
_TMP9 = sin(_mod_phase);
_q_mod = 2.00000000E+000*_TMP9;
_out_color = vec3(_signal, _signal, _signal)*vec3(1.00000000E+000, _i_mod, _q_mod);
_ret_0 = vec4(_out_color.x, _out_color.y, _out_color.z, 1.00000000E+000);
gl_FragColor = _ret_0;
return;
}
#endif