forked from numberwolf/FFmpeg-PlusPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsplit_9_shader.gl
More file actions
29 lines (24 loc) · 726 Bytes
/
split_9_shader.gl
File metadata and controls
29 lines (24 loc) · 726 Bytes
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
//precision highp float;
uniform sampler2D tex;
varying vec2 TextureCoordsVarying;
uniform float playTime;
void main() {
//TextureCoordsVarying.x = TextureCoordsVarying.x * 0.5 + 0.5;
//TextureCoordsVarying.y = TextureCoordsVarying.y * 0.5 + 0.5;
vec2 uv = TextureCoordsVarying.xy;
if (uv.x <= 1.0 / 3.0) {
uv.x = uv.x * 3.0;
}else if (uv.x <= 2.0 / 3.0) {
uv.x = (uv.x - 1.0 / 3.0) * 3.0;
}else {
uv.x = (uv.x - 2.0 / 3.0) * 3.0;
}
if (uv.y <= 1.0 / 3.0) {
uv.y = uv.y * 3.0;
}else if (uv.y <= 2.0 / 3.0) {
uv.y = (uv.y - 1.0 / 3.0) * 3.0;
}else {
uv.y = (uv.y - 2.0 / 3.0) * 3.0;
}
gl_FragColor = texture2D(tex, uv);
}