-
Notifications
You must be signed in to change notification settings - Fork 28
/
blinky.glsl
242 lines (236 loc) · 6.56 KB
/
blinky.glsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
// GLSL shader autogenerated by cg2glsl.py.
#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_VARYING vec2 _tex_300;
COMPAT_VARYING vec2 _tex_240;
COMPAT_VARYING vec2 _tex_180;
COMPAT_VARYING vec2 _tex_120;
COMPAT_VARYING vec2 _tex_60;
COMPAT_VARYING vec2 _tex_0;
COMPAT_VARYING vec2 _tex_direct;
COMPAT_VARYING float _frame_rotation;
struct input_dummy {
vec2 _video_size;
vec2 _texture_size;
vec2 _output_dummy_size;
float _frame_count;
float _frame_direction;
float _frame_rotation;
};
struct vert_out {
vec2 _tex_direct;
vec2 _tex_0;
vec2 _tex_60;
vec2 _tex_120;
vec2 _tex_180;
vec2 _tex_240;
vec2 _tex_300;
};
vec4 _oPosition1;
float _TMP6;
float _TMP5;
float _TMP4;
float _TMP3;
float _TMP2;
input_dummy _TMP14;
input_dummy _IN1;
vec4 _r0019;
float _a0021;
vec2 _r0031;
vec2 _r0037;
vec2 _r0043;
vec2 _r0049;
vec2 _r0055;
vec2 _r0061;
COMPAT_ATTRIBUTE vec4 VertexCoord;
COMPAT_ATTRIBUTE vec4 TexCoord;
COMPAT_VARYING vec4 TEX1;
COMPAT_VARYING vec4 TEX2;
COMPAT_VARYING vec4 TEX3;
COMPAT_VARYING vec4 TEX4;
COMPAT_VARYING vec4 TEX5;
COMPAT_VARYING vec4 TEX6;
COMPAT_VARYING vec4 TEX7;
uniform mat4 MVPMatrix;
uniform int FrameDirection;
uniform int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
void main()
{
vert_out _verts;
vec2 _one;
float _scale;
vec2 _TMP15[2];
_r0019 = VertexCoord.x*MVPMatrix[0];
_r0019 = _r0019 + VertexCoord.y*MVPMatrix[1];
_r0019 = _r0019 + VertexCoord.z*MVPMatrix[2];
_r0019 = _r0019 + VertexCoord.w*MVPMatrix[3];
_oPosition1 = _r0019;
_one = 1.00000000E+00/TextureSize;
_TMP14._frame_count = float(FrameCount)/2.00000000E+01;
_a0021 = 5.00000000E-01*_TMP14._frame_count;
_TMP2 = sin(_a0021);
_scale = 1.00000000E+00 + 2.00000003E-01*_TMP2;
_TMP3 = cos(_TMP14._frame_count);
_TMP4 = sin(_TMP14._frame_count);
_TMP5 = sin(_TMP14._frame_count);
_TMP6 = cos(_TMP14._frame_count);
_TMP15[0] = _scale*vec2(_TMP3, _TMP4);
_TMP15[1] = _scale*vec2(-_TMP5, _TMP6);
_verts._tex_direct = TexCoord.xy;
_r0031.x = dot(_TMP15[0], vec2( 1.00000000E+00, 0.00000000E+00));
_r0031.y = dot(_TMP15[1], vec2( 1.00000000E+00, 0.00000000E+00));
_verts._tex_0 = TexCoord.xy + _one*_r0031;
_r0037.x = dot(_TMP15[0], vec2( 5.00000000E-01, 6.99999988E-01));
_r0037.y = dot(_TMP15[1], vec2( 5.00000000E-01, 6.99999988E-01));
_verts._tex_60 = TexCoord.xy + _one*_r0037;
_r0043.x = dot(_TMP15[0], vec2( -5.00000000E-01, 6.99999988E-01));
_r0043.y = dot(_TMP15[1], vec2( -5.00000000E-01, 6.99999988E-01));
_verts._tex_120 = TexCoord.xy + _one*_r0043;
_r0049.x = dot(_TMP15[0], vec2( -1.00000000E+00, 0.00000000E+00));
_r0049.y = dot(_TMP15[1], vec2( -1.00000000E+00, 0.00000000E+00));
_verts._tex_180 = TexCoord.xy + _one*_r0049;
_r0055.x = dot(_TMP15[0], vec2( -5.00000000E-01, -6.99999988E-01));
_r0055.y = dot(_TMP15[1], vec2( -5.00000000E-01, -6.99999988E-01));
_verts._tex_240 = TexCoord.xy + _one*_r0055;
_r0061.x = dot(_TMP15[0], vec2( 5.00000000E-01, -6.99999988E-01));
_r0061.y = dot(_TMP15[1], vec2( 5.00000000E-01, -6.99999988E-01));
_verts._tex_300 = TexCoord.xy + _one*_r0061;
gl_Position = _r0019;
TEX1.xy = TexCoord.xy;
TEX2.xy = _verts._tex_0;
TEX3.xy = _verts._tex_60;
TEX4.xy = _verts._tex_120;
TEX5.xy = _verts._tex_180;
TEX6.xy = _verts._tex_240;
TEX7.xy = _verts._tex_300;
}
#elif defined(FRAGMENT)
#if __VERSION__ >= 130
#define COMPAT_VARYING in
#define COMPAT_TEXTURE texture
out vec4 FragColor;
#else
#define COMPAT_VARYING varying
#define FragColor gl_FragColor
#define COMPAT_TEXTURE texture2D
#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
COMPAT_VARYING vec2 _tex_300;
COMPAT_VARYING vec2 _tex_240;
COMPAT_VARYING vec2 _tex_180;
COMPAT_VARYING vec2 _tex_120;
COMPAT_VARYING vec2 _tex_60;
COMPAT_VARYING vec2 _tex_0;
COMPAT_VARYING vec2 _tex_direct;
COMPAT_VARYING float _frame_rotation;
struct input_dummy {
vec2 _video_size;
vec2 _texture_size;
vec2 _output_dummy_size;
float _frame_count;
float _frame_direction;
float _frame_rotation;
};
struct vert_out {
vec2 _tex_direct;
vec2 _tex_0;
vec2 _tex_60;
vec2 _tex_120;
vec2 _tex_180;
vec2 _tex_240;
vec2 _tex_300;
};
vec4 _ret_0;
float _TMP12;
float _TMP11;
float _TMP10;
float _TMP9;
vec4 _TMP7;
vec4 _TMP6;
vec4 _TMP5;
vec4 _TMP4;
vec4 _TMP3;
vec4 _TMP2;
vec4 _TMP1;
vec4 _TMP0;
uniform sampler2D Texture;
vec4 _TMP48;
vec4 _x0049;
COMPAT_VARYING vec4 TEX1;
COMPAT_VARYING vec4 TEX2;
COMPAT_VARYING vec4 TEX3;
COMPAT_VARYING vec4 TEX4;
COMPAT_VARYING vec4 TEX5;
COMPAT_VARYING vec4 TEX6;
COMPAT_VARYING vec4 TEX7;
uniform int FrameDirection;
uniform int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
void main()
{
vec4 _tex_mid;
vec4 _tex0;
vec4 _tex60;
vec4 _tex120;
vec4 _tex180;
vec4 _tex240;
vec4 _tex300;
vec4 _minimum;
vec4 _maximum;
vec4 _diff;
_tex_mid = COMPAT_TEXTURE(Texture, TEX1.xy);
_tex0 = COMPAT_TEXTURE(Texture, TEX2.xy);
_tex60 = COMPAT_TEXTURE(Texture, TEX3.xy);
_tex120 = COMPAT_TEXTURE(Texture, TEX4.xy);
_tex180 = COMPAT_TEXTURE(Texture, TEX5.xy);
_tex240 = COMPAT_TEXTURE(Texture, TEX6.xy);
_tex300 = COMPAT_TEXTURE(Texture, TEX7.xy);
_TMP0 = min(_tex0, _tex60);
_TMP1 = min(_tex120, _tex180);
_TMP2 = min(_TMP0, _TMP1);
_TMP3 = min(_tex240, _tex300);
_minimum = min(_TMP2, _TMP3);
_TMP4 = max(_tex0, _tex60);
_TMP5 = max(_tex120, _tex180);
_TMP6 = max(_TMP4, _TMP5);
_TMP7 = max(_tex240, _tex300);
_maximum = max(_TMP6, _TMP7);
_x0049 = -(_maximum - _minimum);
_TMP9 = pow(2.71828198E+00, _x0049.x);
_TMP10 = pow(2.71828198E+00, _x0049.y);
_TMP11 = pow(2.71828198E+00, _x0049.z);
_TMP12 = pow(2.71828198E+00, _x0049.w);
_TMP48 = vec4(_TMP9, _TMP10, _TMP11, _TMP12);
_diff = 1.00000000E+00 - _TMP48;
_ret_0 = _tex_mid + 8.99999976E-01*(_diff - _tex_mid);
FragColor = _ret_0;
return;
}
#endif