-
Notifications
You must be signed in to change notification settings - Fork 28
/
Edge.glsl
executable file
·303 lines (155 loc) · 4.2 KB
/
Edge.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
// GLSL shader autogenerated by cg2glsl.py.
#if defined(VERTEX)
varying vec2 VARc22;
varying vec2 VARc20;
varying vec2 VARc02;
varying vec2 VARc00;
struct tex_coord {
vec2 VARc00;
vec2 VARc02;
vec2 VARc20;
vec2 VARc22;
};
struct input_dummy {
vec2 _video_size;
vec2 _texture_size;
vec2 _output_dummy_size;
};
vec4 _oPosition1;
tex_coord _coords1;
uniform mat4 MVPMatrix;
input_dummy _IN1;
vec4 _r0004;
attribute vec4 VertexCoord;
attribute vec4 COLOR;
varying vec4 COL0;
attribute vec4 TexCoord;
varying vec4 TEX0;
mat4 transpose_(mat4 matrix)
{
mat4 ret;
for (int i = 0; i != 4; i++)
for (int j = 0; j != 4; j++)
ret[i][j] = matrix[j][i];
return ret;
}
uniform int FrameDirection;
uniform int FrameCount;
#ifdef GL_ES
uniform mediump vec2 OutputSize;
uniform mediump vec2 TextureSize;
uniform mediump vec2 InputSize;
#else
uniform vec2 OutputSize;
uniform vec2 TextureSize;
uniform vec2 InputSize;
#endif
void main()
{
mat4 MVPMatrix_ = transpose_(MVPMatrix);
vec4 _oColor;
vec2 _oTex;
vec2 _delta;
tex_coord _TMP2;
_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;
_oColor = COLOR;
_oTex = TexCoord.xy;
_delta = 5.00000000E-001/TextureSize;
_TMP2.VARc00 = TexCoord.xy + vec2(-_delta.x, -_delta.y);
_TMP2.VARc02 = TexCoord.xy + vec2(-_delta.y, _delta.y);
_TMP2.VARc20 = TexCoord.xy + vec2(_delta.x, -_delta.y);
_TMP2.VARc22 = TexCoord.xy + vec2(_delta.x, _delta.y);
VARc00 = _TMP2.VARc00;
VARc02 = _TMP2.VARc02;
VARc20 = _TMP2.VARc20;
VARc22 = _TMP2.VARc22;
gl_Position = _r0004;
COL0 = COLOR;
TEX0.xy = TexCoord.xy;
}
#elif defined(FRAGMENT)
#ifdef GL_ES
precision mediump float;
#endif
varying vec2 VARc22;
varying vec2 VARc20;
varying vec2 VARc02;
varying vec2 VARc00;
struct tex_coord {
vec2 VARc00;
vec2 VARc02;
vec2 VARc20;
vec2 VARc22;
};
struct input_dummy {
vec2 _video_size;
vec2 _texture_size;
vec2 _output_dummy_size;
};
vec4 _ret_0;
vec3 _TMP12;
vec3 _TMP8;
float _TMP11;
float _TMP7;
float _TMP6;
float _TMP5;
vec4 _TMP4;
vec4 _TMP3;
vec4 _TMP2;
vec4 _TMP1;
vec4 _TMP0;
tex_coord _co1;
input_dummy _IN1;
uniform sampler2D Texture;
float _x0028;
vec3 _TMP29;
float _x0034;
vec3 _TMP35;
float _x0040;
vec3 _TMP41;
vec3 _a0046;
vec3 _TMP53;
varying vec4 TEX0;
uniform int FrameDirection;
uniform int FrameCount;
#ifdef GL_ES
uniform mediump vec2 OutputSize;
uniform mediump vec2 TextureSize;
uniform mediump vec2 InputSize;
#else
uniform vec2 OutputSize;
uniform vec2 TextureSize;
uniform vec2 InputSize;
#endif
void main()
{
vec3 _final;
_TMP0 = texture2D(Texture, VARc00);
_TMP1 = texture2D(Texture, VARc02);
_TMP2 = texture2D(Texture, TEX0.xy);
_TMP3 = texture2D(Texture, VARc20);
_TMP4 = texture2D(Texture, VARc22);
_x0028 = TEX0.x*TextureSize.x + 5.00000000E-001;
_TMP5 = fract(_x0028);
_TMP29 = _TMP0.xyz + _TMP5*(_TMP3.xyz - _TMP0.xyz);
_x0034 = TEX0.x*TextureSize.x + 5.00000000E-001;
_TMP6 = fract(_x0034);
_TMP35 = _TMP1.xyz + _TMP6*(_TMP4.xyz - _TMP1.xyz);
_x0040 = TEX0.y*TextureSize.y + 5.00000000E-001;
_TMP7 = fract(_x0040);
_TMP41 = _TMP29 + _TMP7*(_TMP35 - _TMP29);
_a0046 = _TMP41 - _TMP2.xyz;
_TMP8 = abs(_a0046);
_TMP11 = dot(_TMP8, vec3( 3.00000012E-001, 5.89999974E-001, 1.09999999E-001));
_final = 5.00000000E+000*vec3(_TMP11, _TMP11, _TMP11);
_TMP12 = min(vec3( 1.00000000E+000, 1.00000000E+000, 1.00000000E+000), _final);
_TMP53 = max(vec3( 0.00000000E+000, 0.00000000E+000, 0.00000000E+000), _TMP12);
_ret_0 = vec4(_TMP53.x, _TMP53.y, _TMP53.z, 1.00000000E+000);
gl_FragColor = _ret_0;
return;
}
#endif