2014-05-05 13:27:47 +08:00
|
|
|
// Shader from here: http://www.iquilezles.org/
|
|
|
|
|
|
|
|
#ifdef GL_ES
|
|
|
|
precision highp float;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
uniform vec2 resolution;
|
|
|
|
uniform sampler2D tex0;
|
|
|
|
uniform sampler2D tex1;
|
2019-09-04 09:58:40 +08:00
|
|
|
uniform vec2 u_screenSize;
|
2019-03-26 13:45:03 +08:00
|
|
|
uniform vec4 u_Time;
|
|
|
|
uniform vec4 u_CosTime
|
|
|
|
|
2014-05-05 13:27:47 +08:00
|
|
|
void main(void)
|
|
|
|
{
|
2019-09-04 09:58:40 +08:00
|
|
|
#ifdef METAL
|
|
|
|
vec2 fragCoord = vec2(gl_FragCoord.x, u_screenSize.y - gl_FragCoord.y);
|
|
|
|
#else
|
|
|
|
vec2 fragCoord = gl_FragCoord.xy;
|
|
|
|
#endif
|
2019-03-26 13:45:03 +08:00
|
|
|
float time = u_Time[1];
|
2019-09-04 09:58:40 +08:00
|
|
|
vec2 p = -1.0 + 2.0 * fragCoord / resolution.xy;
|
2014-05-05 13:27:47 +08:00
|
|
|
vec2 uv;
|
|
|
|
|
|
|
|
float a = atan(p.y,p.x);
|
|
|
|
float r = sqrt(dot(p,p));
|
|
|
|
|
2019-03-26 13:45:03 +08:00
|
|
|
uv.x = r - u_Time[2];
|
|
|
|
uv.y = sin(a*10.0 + 2.0*u_CosTime[0];
|
2014-05-05 13:27:47 +08:00
|
|
|
|
|
|
|
vec3 col = (.5+.5*uv.y)*texture2D(tex0,uv).xyz;
|
|
|
|
|
|
|
|
gl_FragColor = vec4(col,1.0);
|
2016-10-17 15:44:41 +08:00
|
|
|
}
|